Changeset 1112:d87cee14b051 in freeDiameter for libfdcore
- Timestamp:
- May 13, 2013, 7:50:26 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/core.c
r1111 r1112 84 84 static int core_state_wait(enum core_state waitstate) 85 85 { 86 int ret ;86 int ret = 0; 87 87 CHECK_POSIX( pthread_mutex_lock( &core_mtx )); 88 88 pthread_cleanup_push( fd_cleanup_mutex, &core_mtx ); 89 do{89 while (waitstate > core_state) { 90 90 CHECK_POSIX_DO(ret = pthread_cond_wait(&core_cnd, &core_mtx), break); 91 } while (waitstate > core_state);91 } 92 92 pthread_cleanup_pop( 0 ); 93 93 CHECK_POSIX( pthread_mutex_unlock( &core_mtx )); … … 189 189 } 190 190 191 LOG_ D("libfdproto initialized.");191 LOG_N("libfdproto initialized."); 192 192 193 193 /* Name this thread */ … … 305 305 if (cur_state < CORE_RUNNING) { 306 306 core_shutdown(); 307 core_state_set(CORE_TERM); 307 308 } else if (cur_state == CORE_RUNNING) { 308 309 core_state_set(CORE_SHUTDOWN); … … 323 324 void * th_ret = NULL; 324 325 326 CHECK_FCT(core_state_wait(CORE_SHUTDOWN)); 327 325 328 if (cur_state == CORE_TERM) 326 329 return 0; 327 330 328 CHECK_FCT(core_state_wait(CORE_SHUTDOWN));329 330 331 /* Just wait for core_runner_thread to complete and return gracefully */ 331 332 CHECK_POSIX(pthread_join(core_runner, &th_ret));
Note: See TracChangeset
for help on using the changeset viewer.