Changeset 1188:f40de74bd1c7 in freeDiameter
- Timestamp:
- Jun 10, 2013, 3:27:15 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
include/freeDiameter/libfdproto.h
r1186 r1188 3122 3122 fd_fifo_post_int((queue), (void *)(item)) 3123 3123 3124 /* Similar function but does not block. It can cause the number of items in the queue to exceed the maximum set. Do not use for normal operation, 3125 only for failure recovery for example. */ 3126 int fd_fifo_post_noblock( struct fifo * queue, void ** item ); 3127 3124 3128 /* 3125 3129 * FUNCTION: fd_fifo_get -
libfdcore/p_sr.c
r1153 r1188 327 327 328 328 /* Requeue for sending to another peer */ 329 CHECK_FCT_DO( ret = fd_fifo_post (fd_g_outgoing,&sr->req),329 CHECK_FCT_DO( ret = fd_fifo_post_noblock(fd_g_outgoing, (void *)&sr->req), 330 330 { 331 331 char buf[256]; -
libfdcore/peers.c
r1186 r1188 243 243 while ( fd_fifo_tryget(peer->p_tosend, &m) == 0 ) { 244 244 fd_hook_call(HOOK_MESSAGE_FAILOVER, m, peer, NULL, fd_msg_pmdl_get(m)); 245 CHECK_FCT_DO(fd_fifo_post (fd_g_outgoing,&m),245 CHECK_FCT_DO(fd_fifo_post_noblock(fd_g_outgoing, (void *)&m), 246 246 { 247 247 /* fallback: destroy the message */ -
libfdproto/fifo.c
r1186 r1188 377 377 378 378 /* Post a new item in the queue */ 379 int fd_fifo_post_int ( struct fifo * queue, void ** item)379 int fd_fifo_post_internal ( struct fifo * queue, void ** item, int skip_max ) 380 380 { 381 381 struct fifo_item * new; … … 383 383 struct timespec posted_on, queued_on; 384 384 385 TRACE_ENTRY( "%p %p", queue, item );386 387 /* Check the parameters */388 CHECK_PARAMS( CHECK_FIFO( queue ) && item && *item );389 390 385 /* Get the timing of this call */ 391 386 CHECK_SYS( clock_gettime(CLOCK_REALTIME, &posted_on) ); … … 394 389 CHECK_POSIX( pthread_mutex_lock( &queue->mtx ) ); 395 390 396 if ( queue->max) {391 if ((!skip_max) && (queue->max)) { 397 392 while (queue->count >= queue->max) { 398 393 int ret = 0; … … 460 455 /* Done */ 461 456 return 0; 457 } 458 459 /* Post a new item in the queue */ 460 int fd_fifo_post_int ( struct fifo * queue, void ** item ) 461 { 462 TRACE_ENTRY( "%p %p", queue, item ); 463 464 /* Check the parameters */ 465 CHECK_PARAMS( CHECK_FIFO( queue ) && item && *item ); 466 467 return fd_fifo_post_internal ( queue,item, 0 ); 468 469 } 470 471 /* Post a new item in the queue, not blocking */ 472 int fd_fifo_post_noblock ( struct fifo * queue, void ** item ) 473 { 474 TRACE_ENTRY( "%p %p", queue, item ); 475 476 /* Check the parameters */ 477 CHECK_PARAMS( CHECK_FIFO( queue ) && item && *item ); 478 479 return fd_fifo_post_internal ( queue,item, 1 ); 480 462 481 } 463 482
Note: See TracChangeset
for help on using the changeset viewer.