Index: /pjproject/branches/symbian/build/cc-mwcc.mak
===================================================================
--- /pjproject/branches/symbian/build/cc-mwcc.mak	(revision 679)
+++ /pjproject/branches/symbian/build/cc-mwcc.mak	(revision 680)
@@ -2,4 +2,10 @@
 export AR = echo ar
 export LD = mwldsym2.exe -sym full -subsystem windows -msgstyle parseable -nowraplines -nodefaultlibs -addcommand export:_E32Dll\=__E32Dll -shared -export dllexport -stdlib -L"C:\Symbian\9.1\S60_3rd\Epoc32\release\winscw\udeb" -L"C:\Program Files\Carbide\plugins\com.nokia.carbide.cpp.support_1.0.0\Symbian_Support\Runtime\Runtime_x86\Runtime_Win32\Libs" -ledll.lib -leuser.lib -lestlib.lib
+
+#mwldsym2.exe -sym full -subsystem windows -msgstyle parseable -nowraplines -nodefaultlibs -stdlib -L"C:\Symbian\9.1\S60_3rd\Epoc32\release\winscw\udeb" -L"C:\Program Files\Carbide\plugins\com.nokia.carbide.cpp.support_1.0.0\Symbian_Support\Runtime\Runtime_x86\Runtime_Win32\Libs"
+#DLL -addcommand export:_E32Dll\=__E32Dll -shared -export dllexport 
+#o
+# -ledll.lib -leuser.lib -lestlib.lib
+export LDEXE = mwldsym2.exe -sym full -subsystem windows -msgstyle parseable -nowraplines -nodefaultlibs -stdlib -L"C:\Symbian\9.1\S60_3rd\epoc32\release\winscw\udeb" -noimplib -m="?_E32Bootstrap@@YGXXZ" -leexe.lib -leuser.lib
 export LDOUT = -o 
 export RANLIB = echo ranlib
@@ -18,5 +24,5 @@
 export CC_CFLAGS := -sym full -wchar_t off -align 4 -enum int -str pool -nostdinc -exc ms -inline off -msgstyle parseable -nowraplines -O0 -D_UNICODE -D__SYMBIAN32__ -D__CW32__ -D__WINS__ -D__DLL__ -D__WINSCW__ -D_DEBUG -D__SUPPORT_CPP_EXCEPTIONS__ -D__SERIES60_30__ -D__SERIES60_3X__ -w cmdline -w pragmas -w empty -w possible -w unusedvar -w extracomma -w pedantic -w largeargs -w ptrintconv -w tokenpasting -w missingreturn
 #export CC_CFLAGS += -Wdeclaration-after-statement
-export CC_CXXFLAGS := 
+export CC_CXXFLAGS := -sym full -wchar_t off -align 4 -enum int -str pool -nostdinc -exc ms -inline off -msgstyle parseable -nowraplines -O0 -D_UNICODE -D__SYMBIAN32__ -D__CW32__ -D__WINS__ -D__DLL__ -D__WINSCW__ -D_DEBUG -D__SUPPORT_CPP_EXCEPTIONS__ -D__SERIES60_30__ -D__SERIES60_3X__ -w cmdline -w pragmas -w empty -w possible -w unusedvar -w extracomma -w pedantic -w largeargs -w ptrintconv -w tokenpasting -w missingreturn
 export CC_LDFLAGS :=
 export MWLibraries=C:\Program Files\Carbide\plugins\com.nokia.carbide.cpp.support_1.0.0\Symbian_Support\Win32-x86 Support\Libraries\Win32 SDK;C:\Program Files\Carbide\plugins\com.nokia.carbide.cpp.support_1.0.0\Symbian_Support\MSL\MSL_C\MSL_Common\Include;C:\Program Files\Carbide\plugins\com.nokia.carbide.cpp.support_1.0.0\Symbian_Support\MSL\MSL_C\MSL_Win32\Include;C:\Program Files\Carbide\plugins\com.nokia.carbide.cpp.support_1.0.0\Symbian_Support\MSL\MSL_C++\MSL_Common\Include;C:\Program Files\Carbide\plugins\com.nokia.carbide.cpp.support_1.0.0\Symbian_Support\Runtime\Runtime_x86\Runtime_Win32\Libs
Index: /pjproject/branches/symbian/build/os-symbian.mak
===================================================================
--- /pjproject/branches/symbian/build/os-symbian.mak	(revision 679)
+++ /pjproject/branches/symbian/build/os-symbian.mak	(revision 680)
@@ -1,5 +1,5 @@
 export OS_CFLAGS   := $(CC_DEF)PJ_SYMBIAN=1 -include "$(SYMBIAN_SDK_PATH)/include/variant/Symbian_OS_v9.1.hrh" -i- $(CC_INC)$(SYMBIAN_SDK_PATH)/include $(CC_INC)$(SYMBIAN_SDK_PATH)/include/variant $(CC_INC)$(SYMBIAN_SDK_PATH)/include/libc $(CC_INC)../src/pjlib-test -O
 
-export OS_CXXFLAGS :=
+export OS_CXXFLAGS   := $(CC_DEF)PJ_SYMBIAN=1 -include "$(SYMBIAN_SDK_PATH)/include/variant/Symbian_OS_v9.1.hrh" -i- $(CC_INC)$(SYMBIAN_SDK_PATH)/include $(CC_INC)$(SYMBIAN_SDK_PATH)/include/variant $(CC_INC)$(SYMBIAN_SDK_PATH)/include/libc $(CC_INC)../src/pjlib-test -O
 
 export OS_LDFLAGS  := 
Index: /pjproject/branches/symbian/build/rules.mak
===================================================================
--- /pjproject/branches/symbian/build/rules.mak	(revision 679)
+++ /pjproject/branches/symbian/build/rules.mak	(revision 680)
@@ -80,5 +80,5 @@
 
 $(EXE): $(BINDIR) $(OBJDIRS) $(OBJS) $($(APP)_EXTRA_DEP)
-	$(LD) $(LDOUT)$(subst /,$(HOST_PSEP),$(EXE)) \
+	$(LDEXE) $(LDOUT)$(subst /,$(HOST_PSEP),$(EXE)) \
 	    $(subst /,$(HOST_PSEP),$(OBJS)) $($(APP)_LDFLAGS)
 
Index: /pjproject/branches/symbian/pjlib/build/Makefile
===================================================================
--- /pjproject/branches/symbian/pjlib/build/Makefile	(revision 679)
+++ /pjproject/branches/symbian/pjlib/build/Makefile	(revision 680)
@@ -43,4 +43,5 @@
 		    util.o
 export TEST_CFLAGS += $(_CFLAGS)
+export TEST_CXXFLAGS += $(_CXXFLAGS)
 export TEST_LDFLAGS += $(_LDFLAGS)
 export TEST_EXE := ../bin/pjlib-test-$(TARGET_NAME)$(HOST_EXE)
Index: /pjproject/branches/symbian/pjlib/build/os-symbian.mak
===================================================================
--- /pjproject/branches/symbian/pjlib/build/os-symbian.mak	(revision 679)
+++ /pjproject/branches/symbian/pjlib/build/os-symbian.mak	(revision 680)
@@ -13,5 +13,5 @@
 			os_error_unix.o os_time_unix.o \
 			os_timestamp_common.o os_timestamp_posix.o \
-			pool_policy_malloc.o compat/string.o sock_bsd.o sock_select.o
+			pool_policy_malloc.o compat/string.o sock_bsd.o sock_select.o 
 
 #
@@ -19,5 +19,5 @@
 # the test application.
 #
-export TEST_OBJS +=	main.o
+export TEST_OBJS += main.o main_symbian.o 
 
 #
@@ -30,5 +30,5 @@
 # Additional LDFLAGS for pjlib-test
 #
-export TEST_LDFLAGS +=
+export TEST_LDFLAGS += 
 
 #
@@ -39,3 +39,2 @@
 
 
-
Index: /pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp	(revision 679)
+++ /pjproject/branches/symbian/pjlib/src/pj/os_core_symbian.cpp	(revision 680)
@@ -66,8 +66,8 @@
  * This is the main entry for all threads.
  */
-TInt *thread_main(TAny *param)
+TInt thread_main(TAny *param)
 {
     pj_thread_t *rec = (pj_thread_t *) param;
-    TInt *result;
+    TInt result;
     /* pj_status_t rc; */
 
@@ -75,5 +75,5 @@
 
     /* Call user's entry! */
-    result = (TInt*)(long)(*rec->proc)(rec->arg);
+    result = (TInt)(*rec->proc)(rec->arg);
 
     /* Done. */
@@ -119,6 +119,6 @@
     rec->proc = proc;
     rec->arg = arg;
-    _LIT( KThreadName, "A name");
-    rc = rec->thread.Create(KThreadName, thread_main, 4096, KMinHeapSize, 256*16, rec->arg, EOwnerProcess);
+    _LIT( KThreadName, "Athread");
+    rc = rec->thread.Create(KThreadName, thread_main, 4096, KMinHeapSize, 256*16, rec->arg, EOwnerThread);
     if (rc != 0) {
 	return PJ_RETURN_OS_ERROR(rc);
@@ -131,8 +131,81 @@
 }
 
+/*
+ * pj_thread-get_name()
+ */
+PJ_DEF(const char*) pj_thread_get_name(pj_thread_t *p)
+{
+    pj_thread_t *rec = (pj_thread_t*)p;
+
+    return rec->obj_name;
+}
+
+/*
+ * pj_thread_resume()
+ */
+PJ_DEF(pj_status_t) pj_thread_resume(pj_thread_t *p)
+{
+    pj_status_t rc;
+
+    pj_thread_t *rec = (pj_thread_t*)p;
+
+    rec->thread.Resume();
+
+    rc = PJ_SUCCESS;
+
+    return rc;
+}
+
+/*
+ * pj_thread_this()
+ */
+PJ_DEF(pj_thread_t*) pj_thread_this(void)
+{
+    // TODO
+    return NULL;
+}
+
+/*
+ * pj_thread_join()
+ */
+PJ_DEF(pj_status_t) pj_thread_join(pj_thread_t *p)
+{
+    pj_thread_t *rec = (pj_thread_t *)p;
+    TRequestStatus result;
+
+    //PJ_LOG(6, (pj_thread_this()->obj_name, "Joining thread %s", p->obj_name));
+
+    rec->thread.Rendezvous(result);
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * pj_thread_destroy()
+ */
+PJ_DEF(pj_status_t) pj_thread_destroy(pj_thread_t *p)
+{
+    pj_thread_t *rec = (pj_thread_t *)p;
+    rec->thread.Kill(1);
+	
+
+    return PJ_SUCCESS;
+}
+
+/*
+ * pj_thread_sleep()
+ */
+PJ_DEF(pj_status_t) pj_thread_sleep(unsigned msec)
+{
+    if (sleep(msec * 1000) == 0)
+	return PJ_SUCCESS;
+}
+
+
 ///////////////////////////////////////////////////////////////////////////////
 /*
  * pj_thread_local_alloc()
  */
+
 PJ_DEF(pj_status_t) pj_thread_local_alloc(long *index)
 {
@@ -175,4 +248,5 @@
 					    pj_mutex_t **mutex )
 {
+    (*mutex) = (pj_mutex_t *)1;
     return PJ_SUCCESS;
 }
@@ -187,4 +261,12 @@
 
 /*
+ * pj_mutex_trylock()
+ */
+PJ_DEF(pj_status_t) pj_mutex_trylock(pj_mutex_t *mutex)
+{
+    return PJ_SUCCESS;
+}
+
+/*
  * pj_mutex_unlock()
  */
Index: /pjproject/branches/symbian/pjlib/src/pjlib-test/main_symbian.cpp
===================================================================
--- /pjproject/branches/symbian/pjlib/src/pjlib-test/main_symbian.cpp	(revision 680)
+++ /pjproject/branches/symbian/pjlib/src/pjlib-test/main_symbian.cpp	(revision 680)
@@ -0,0 +1,72 @@
+#include "test.h"
+#include <pj/os.h>
+
+#include <e32base.h>
+#include <e32std.h>
+#include <e32cons.h>            // Console
+
+
+//  Constants
+
+_LIT(KTextConsoleTitle, "Console");
+_LIT(KTextFailed, " failed, leave code = %d");
+_LIT(KTextPressAnyKey, " [press any key]\n");
+
+
+//  Global Variables
+
+LOCAL_D CConsoleBase* console;  // write all messages to this
+
+
+//  Local Functions
+
+LOCAL_C void MainL()
+    {
+    //
+    // add your program code here, example code below
+    //
+    console->Write(_L("Hello, world!\n"));
+    }
+
+
+LOCAL_C void DoStartL()
+    {
+    // Create active scheduler (to run active objects)
+    CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
+    CleanupStack::PushL(scheduler);
+    CActiveScheduler::Install(scheduler);
+
+    MainL();
+
+    // Delete active scheduler
+    CleanupStack::PopAndDestroy(scheduler);
+    }
+
+
+//  Global Functions
+
+GLDEF_C TInt E32Main()
+    {
+    // Create cleanup stack
+    __UHEAP_MARK;
+    CTrapCleanup* cleanup = CTrapCleanup::New();
+
+    // Create output console
+    TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(KConsFullScreen,KConsFullScreen)));
+    if (createError)
+        return createError;
+
+    // Run application code inside TRAP harness, wait keypress when terminated
+    TRAPD(mainError, DoStartL());
+    if (mainError)
+        console->Printf(KTextFailed, mainError);
+    console->Printf(KTextPressAnyKey);
+    console->Getch();
+    console->Printf(KTextPressAnyKey);
+    console->Getch();
+    
+    delete console;
+    delete cleanup;
+    __UHEAP_MARKEND;
+    return KErrNone;
+    }
