Changeset 3854
- Timestamp:
- Oct 25, 2011 12:12:44 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/clock_thread.c
r3840 r3854 222 222 clock->quitting = PJ_FALSE; 223 223 224 if ((clock->options & PJMEDIA_CLOCK_NO_ASYNC) == 0 ) {224 if ((clock->options & PJMEDIA_CLOCK_NO_ASYNC) == 0 && !clock->thread) { 225 225 status = pj_thread_create(clock->pool, "clock", &clock_thread, clock, 226 226 0, 0, &clock->thread); … … 246 246 247 247 if (clock->thread) { 248 pj_thread_join(clock->thread); 249 clock->thread = NULL; 248 if (pj_thread_join(clock->thread) == PJ_SUCCESS) { 249 clock->thread = NULL; 250 } else { 251 clock->quitting = PJ_FALSE; 252 } 250 253 } 251 254 … … 375 378 (*clock->cb)(&clock->timestamp, clock->user_data); 376 379 380 /* Best effort way to detect if we've been destroyed in the callback */ 381 if (clock->quitting) 382 break; 383 377 384 /* Increment timestamp */ 378 385 clock->timestamp.u64 += clock->timestamp_inc;
Note: See TracChangeset
for help on using the changeset viewer.