Changeset 1188:f40de74bd1c7 in freeDiameter for libfdproto
- Timestamp:
- Jun 10, 2013, 3:27:15 PM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.