Changeset 691:78b665400097 in freeDiameter for libfdcore/p_expiry.c
- Timestamp:
- Jan 20, 2011, 7:44:27 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libfdcore/p_expiry.c
r686 r691 98 98 TRACE_ENTRY( "%p", arg ); 99 99 100 CHECK_POSIX_DO( pthread_mutex_lock(&exp_mtx), goto error);100 CHECK_POSIX_DO( pthread_mutex_lock(&exp_mtx), { ASSERT(0); } ); 101 101 pthread_cleanup_push( fd_cleanup_mutex, &exp_mtx ); 102 102 … … 108 108 if (FD_IS_LIST_EMPTY(&exp_list)) { 109 109 /* Just wait for a change or cancelation */ 110 CHECK_POSIX_DO( pthread_cond_wait( &exp_cnd, &exp_mtx ), goto error);110 CHECK_POSIX_DO( pthread_cond_wait( &exp_cnd, &exp_mtx ), { ASSERT(0); } ); 111 111 /* Restart the loop on wakeup */ 112 112 continue; … … 118 118 119 119 /* Get the current time */ 120 CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), goto error);120 CHECK_SYS_DO( clock_gettime(CLOCK_REALTIME, &now), { ASSERT(0); } ); 121 121 122 122 /* If first peer is not expired, we just wait until it happens */ … … 125 125 CHECK_POSIX_DO2( pthread_cond_timedwait( &exp_cnd, &exp_mtx, &first->p_exp_timer ), 126 126 ETIMEDOUT, /* ETIMEDOUT is a normal return value, continue */, 127 /* on other error, */ goto error);127 /* on other error, */ { ASSERT(0); } ); 128 128 129 129 /* on wakeup, loop */ … … 133 133 /* Now, the first peer in the list is expired; signal it */ 134 134 fd_list_unlink( &first->p_expiry ); 135 CHECK_FCT_DO( fd_event_send(first->p_events, FDEVP_TERMINATE, 0, "DO_NOT_WANT_TO_TALK_TO_YOU"), goto error);135 CHECK_FCT_DO( fd_event_send(first->p_events, FDEVP_TERMINATE, 0, "DO_NOT_WANT_TO_TALK_TO_YOU"), break ); 136 136 137 137 } while (1); 138 138 139 139 pthread_cleanup_pop( 1 ); 140 error: 140 141 141 TRACE_DEBUG(INFO, "An error occurred in peers module! Expiry thread is terminating..."); 142 ASSERT(0);143 142 CHECK_FCT_DO(fd_event_send(fd_g_config->cnf_main_ev, FDEV_TERMINATE, 0, NULL), ); 144 143 return NULL;
Note: See TracChangeset
for help on using the changeset viewer.