diff options
author | Benny Prijono <bennylp@teluu.com> | 2007-05-02 11:29:37 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2007-05-02 11:29:37 +0000 |
commit | 8bb2ecb06d7e994b4b5c94af831fb02c465ecb49 (patch) | |
tree | daf006ab1fcc27244ae19cf4816d61756cab84ad /pjlib/src/pj/os_core_symbian.cpp | |
parent | 67ecaf91d4e3383af948d75df8164436c7116bbc (diff) |
PJSUA-LIB was ported to Symbian and added simple Symbian app. Testing follows
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1242 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjlib/src/pj/os_core_symbian.cpp')
-rw-r--r-- | pjlib/src/pj/os_core_symbian.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/pjlib/src/pj/os_core_symbian.cpp b/pjlib/src/pj/os_core_symbian.cpp index 7386fd63..fbc30233 100644 --- a/pjlib/src/pj/os_core_symbian.cpp +++ b/pjlib/src/pj/os_core_symbian.cpp @@ -270,6 +270,8 @@ PJ_DECL(void) pj_shutdown(void); */ PJ_DEF(pj_status_t) pj_init(void) { + pj_status_t status; + pj_ansi_strcpy(main_thread.obj_name, "pjthread"); // Init main thread @@ -280,10 +282,17 @@ PJ_DEF(pj_status_t) pj_init(void) PJ_LOG(4,(THIS_FILE, "Initializing PJLIB for Symbian OS..")); - TInt err; + TInt err; err = os->Initialize(); if (err != KErrNone) goto on_error; + + /* Initialize exception ID for the pool. + * Must do so after critical section is configured. + */ + status = pj_exception_id_alloc("PJLIB/No memory", &PJ_NO_MEMORY_EXCEPTION); + if (status != PJ_SUCCESS) + return status; PJ_LOG(5,(THIS_FILE, "PJLIB initialized.")); return PJ_SUCCESS; @@ -307,13 +316,11 @@ PJ_DEF(pj_status_t) pj_atexit(void (*func)(void)) PJ_DEF(void) pj_shutdown(void) { - unsigned i; - /* Call atexit() functions */ - for (i=atexit_count-1; i>=0; --i) { - (*atexit_func[i])(); + while (atexit_count > 0) { + (*atexit_func[atexit_count-1])(); + --atexit_count; } - atexit_count = 0; /* Free exception ID */ if (PJ_NO_MEMORY_EXCEPTION != -1) { |