Changeset 5680 for pjproject/trunk/pjlib/src/pj/ioqueue_epoll.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_epoll.c
r5194 r5680 517 517 pj_ioqueue_lock_key(key); 518 518 519 /* Best effort to avoid double key-unregistration */ 520 if (IS_CLOSING(key)) { 521 pj_ioqueue_unlock_key(key); 522 return PJ_SUCCESS; 523 } 524 519 525 /* Also lock ioqueue */ 520 526 pj_lock_acquire(ioqueue->lock); 521 527 522 pj_assert(ioqueue->count > 0); 523 --ioqueue->count; 528 /* Avoid "negative" ioqueue count */ 529 if (ioqueue->count > 0) { 530 --ioqueue->count; 531 } else { 532 /* If this happens, very likely there is double unregistration 533 * of a key. 534 */ 535 pj_assert(!"Bad ioqueue count in key unregistration!"); 536 PJ_LOG(1,(THIS_FILE, "Bad ioqueue count in key unregistration!")); 537 } 538 524 539 #if !PJ_IOQUEUE_HAS_SAFE_UNREG 525 540 pj_list_erase(key); … … 532 547 pj_status_t rc = pj_get_os_error(); 533 548 pj_lock_release(ioqueue->lock); 549 pj_ioqueue_unlock_key(key); 534 550 return rc; 535 551 }
Note: See TracChangeset
for help on using the changeset viewer.