Ignore:
Timestamp:
Mar 30, 2012 7:10:13 AM (12 years ago)
Author:
bennylp
Message:

Re #1474: Merged all changes from 1.12 - HEAD (from the 1.x branch)

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk

  • pjproject/trunk/pjlib/src/pj/os_core_symbian.cpp

    r3664 r3999  
    7676}; 
    7777 
     78/* Flag and reference counter for PJLIB instance */ 
     79static int initialized; 
     80 
    7881/* Flags to indicate which TLS variables have been used */ 
    7982static int tls_vars[PJ_MAX_TLS]; 
     
    8285static unsigned atexit_count; 
    8386static void (*atexit_func[32])(void); 
    84  
    85  
    8687 
    8788 
     
    336337    pj_status_t status; 
    337338     
     339    /* Check if PJLIB have been initialized */ 
     340    if (initialized) { 
     341        ++initialized; 
     342        return PJ_SUCCESS; 
     343    } 
     344 
    338345    pj_ansi_strcpy(main_thread.obj_name, "pjthread"); 
    339346 
     
    369376#endif 
    370377 
     378    /* Flag PJLIB as initialized */ 
     379    ++initialized; 
     380    pj_assert(initialized == 1); 
     381 
    371382    PJ_LOG(5,(THIS_FILE, "PJLIB initialized.")); 
    372383    return PJ_SUCCESS; 
     
    391402PJ_DEF(void) pj_shutdown(void) 
    392403{ 
     404    /* Only perform shutdown operation when 'initialized' reaches zero */ 
     405    pj_assert(initialized > 0); 
     406    if (--initialized != 0) 
     407        return; 
     408 
    393409    /* Call atexit() functions */ 
    394410    while (atexit_count > 0) { 
Note: See TracChangeset for help on using the changeset viewer.