Changeset 691:78b665400097 in freeDiameter for extensions/test_netemul/tne_process.c
- Timestamp:
- Jan 20, 2011, 7:44:27 PM (13 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/test_netemul/tne_process.c
r656 r691 247 247 248 248 CHECK_POSIX_DO( pthread_mutex_lock(&mtx), goto error ); 249 pthread_cleanup_push( fd_cleanup_mutex, &mtx ); 249 250 250 251 /* The loop */ 251 252 while (1) { 252 253 /* First, test if we are canceled */ 253 CHECK_POSIX_DO( pthread_mutex_unlock(&mtx), goto error );254 254 pthread_testcancel(); 255 CHECK_POSIX_DO( pthread_mutex_lock(&mtx), goto error );256 257 pthread_cleanup_push( fd_cleanup_mutex, &mtx );258 255 259 256 /* Send all messages that are ready (free resources before using new ones) */ 260 CHECK_FCT_DO( send_all_ready(), goto error_ul);257 CHECK_FCT_DO( send_all_ready(), break ); 261 258 262 259 /* Now process the new messages in input list for duplicate filter */ 263 CHECK_FCT_DO( do_duplicates(), goto error_ul);260 CHECK_FCT_DO( do_duplicates(), break ); 264 261 265 262 /* Now compute the latency for each new item */ 266 CHECK_FCT_DO( do_latency(), goto error_ul);263 CHECK_FCT_DO( do_latency(), break ); 267 264 268 265 /* Now, wait then loop */ 269 266 if (FD_IS_LIST_EMPTY(&waitlist)) { 270 CHECK_POSIX_DO( pthread_cond_wait(&cnd, &mtx), goto error_ul);267 CHECK_POSIX_DO( pthread_cond_wait(&cnd, &mtx), break ); 271 268 } else { 272 269 CHECK_POSIX_DO2( pthread_cond_timedwait(&cnd, &mtx, &((struct process_item *)(waitlist.next))->ts), 273 270 ETIMEDOUT, /* ETIMEDOUT is a normal return value, continue */, 274 /* on other error, */ goto error_ul);271 /* on other error, */ break ); 275 272 } 276 273 277 pthread_cleanup_pop( 0 );278 274 /* loop */ 279 275 } 280 276 281 error_ul: 277 pthread_cleanup_pop( 0 ); 282 278 CHECK_POSIX_DO( pthread_mutex_unlock(&mtx), ); 283 279 error:
Note: See TracChangeset
for help on using the changeset viewer.