Changeset 3999 for pjproject/trunk/pjlib/src/pj/os_core_unix.c
- Timestamp:
- Mar 30, 2012 7:10:13 AM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk
-
pjproject/trunk/pjlib/src/pj/os_core_unix.c
r3670 r3999 103 103 104 104 105 /* 106 * Flag and reference counter for PJLIB instance. 107 */ 108 static int initialized; 109 105 110 #if PJ_HAS_THREADS 106 111 static pj_thread_t main_thread; … … 127 132 pj_str_t guid; 128 133 pj_status_t rc; 134 135 /* Check if PJLIB have been initialized */ 136 if (initialized) { 137 ++initialized; 138 return PJ_SUCCESS; 139 } 129 140 130 141 #if PJ_HAS_THREADS … … 168 179 #endif 169 180 181 /* Flag PJLIB as initialized */ 182 ++initialized; 183 pj_assert(initialized == 1); 184 170 185 PJ_LOG(4,(THIS_FILE, "pjlib %s for POSIX initialized", 171 186 PJ_VERSION)); … … 192 207 { 193 208 int i; 209 210 /* Only perform shutdown operation when 'initialized' reaches zero */ 211 pj_assert(initialized > 0); 212 if (--initialized != 0) 213 return; 194 214 195 215 /* Call atexit() functions */
Note: See TracChangeset
for help on using the changeset viewer.