Changeset 5680 for pjproject/trunk/pjlib/src/pj/ioqueue_select.c
- Timestamp:
- Nov 3, 2017 6:54:54 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ioqueue_select.c
r5539 r5680 479 479 pj_ioqueue_lock_key(key); 480 480 481 /* Best effort to avoid double key-unregistration */ 482 if (IS_CLOSING(key)) { 483 pj_ioqueue_unlock_key(key); 484 return PJ_SUCCESS; 485 } 486 481 487 /* Also lock ioqueue */ 482 488 pj_lock_acquire(ioqueue->lock); 483 489 484 pj_assert(ioqueue->count > 0); 485 --ioqueue->count; 490 /* Avoid "negative" ioqueue count */ 491 if (ioqueue->count > 0) { 492 --ioqueue->count; 493 } else { 494 /* If this happens, very likely there is double unregistration 495 * of a key. 496 */ 497 pj_assert(!"Bad ioqueue count in key unregistration!"); 498 PJ_LOG(1,(THIS_FILE, "Bad ioqueue count in key unregistration!")); 499 } 500 486 501 #if !PJ_IOQUEUE_HAS_SAFE_UNREG 487 502 /* Ticket #520, key will be erased more than once */
Note: See TracChangeset
for help on using the changeset viewer.