Changeset 958 for pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c
- Timestamp:
- Feb 17, 2007 12:30:24 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ioqueue_winnt.c
r821 r958 667 667 PJ_DEF(pj_status_t) pj_ioqueue_unregister( pj_ioqueue_key_t *key ) 668 668 { 669 unsigned i; 670 enum { RETRY = 10 }; 671 669 672 PJ_ASSERT_RETURN(key, PJ_EINVAL); 670 673 … … 714 717 * an ugly solution.. 715 718 */ 716 while (pj_atomic_get(key->ref_count) != 1) 719 //This will loop forever if unregistration is done on the callback. 720 //Doing this with RETRY I think should solve the IOCP setting the 721 //socket signalled, without causing the deadlock. 722 //while (pj_atomic_get(key->ref_count) != 1) 723 // pj_thread_sleep(0); 724 for (i=0; pj_atomic_get(key->ref_count) != 1 && i<RETRY; ++i) 717 725 pj_thread_sleep(0); 718 726 … … 755 763 /* Check the closing keys only when there's no activity and when there are 756 764 * pending closing keys. 757 */ 758 if (event_count == 0 && !pj_list_empty(&ioqueue->closing_list)) { 765 * blp: 766 * no, always check the list. Otherwise on busy activity, this will cause 767 * ioqueue to reject new registration. 768 */ 769 if (/*event_count == 0 &&*/ !pj_list_empty(&ioqueue->closing_list)) { 759 770 pj_time_val now; 760 771 pj_ioqueue_key_t *key;
Note: See TracChangeset
for help on using the changeset viewer.