Changeset 2826 for pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c
- Timestamp:
- Jul 2, 2009 8:24:22 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ioqueue_common_abs.c
r2394 r2826 688 688 689 689 pj_mutex_lock(key->mutex); 690 /* Check again. Handle may have been closed after the previous check 691 * in multithreaded app. If we add bad handle to the set it will 692 * corrupt the ioqueue set. See #913 693 */ 694 if (IS_CLOSING(key)) { 695 pj_mutex_unlock(key->mutex); 696 return PJ_ECANCELLED; 697 } 690 698 pj_list_insert_before(&key->read_list, read_op); 691 699 ioqueue_add_to_set(key->ioqueue, key, READABLE_EVENT); … … 756 764 757 765 pj_mutex_lock(key->mutex); 766 /* Check again. Handle may have been closed after the previous check 767 * in multithreaded app. If we add bad handle to the set it will 768 * corrupt the ioqueue set. See #913 769 */ 770 if (IS_CLOSING(key)) { 771 pj_mutex_unlock(key->mutex); 772 return PJ_ECANCELLED; 773 } 758 774 pj_list_insert_before(&key->read_list, read_op); 759 775 ioqueue_add_to_set(key->ioqueue, key, READABLE_EVENT); … … 862 878 863 879 pj_mutex_lock(key->mutex); 880 /* Check again. Handle may have been closed after the previous check 881 * in multithreaded app. If we add bad handle to the set it will 882 * corrupt the ioqueue set. See #913 883 */ 884 if (IS_CLOSING(key)) { 885 pj_mutex_unlock(key->mutex); 886 return PJ_ECANCELLED; 887 } 864 888 pj_list_insert_before(&key->write_list, write_op); 865 889 ioqueue_add_to_set(key->ioqueue, key, WRITEABLE_EVENT); … … 979 1003 980 1004 pj_mutex_lock(key->mutex); 1005 /* Check again. Handle may have been closed after the previous check 1006 * in multithreaded app. If we add bad handle to the set it will 1007 * corrupt the ioqueue set. See #913 1008 */ 1009 if (IS_CLOSING(key)) { 1010 pj_mutex_unlock(key->mutex); 1011 return PJ_ECANCELLED; 1012 } 981 1013 pj_list_insert_before(&key->write_list, write_op); 982 1014 ioqueue_add_to_set(key->ioqueue, key, WRITEABLE_EVENT); … … 1048 1080 1049 1081 pj_mutex_lock(key->mutex); 1082 /* Check again. Handle may have been closed after the previous check 1083 * in multithreaded app. If we add bad handle to the set it will 1084 * corrupt the ioqueue set. See #913 1085 */ 1086 if (IS_CLOSING(key)) { 1087 pj_mutex_unlock(key->mutex); 1088 return PJ_ECANCELLED; 1089 } 1050 1090 pj_list_insert_before(&key->accept_list, accept_op); 1051 1091 ioqueue_add_to_set(key->ioqueue, key, READABLE_EVENT); … … 1084 1124 /* Pending! */ 1085 1125 pj_mutex_lock(key->mutex); 1126 /* Check again. Handle may have been closed after the previous 1127 * check in multithreaded app. See #913 1128 */ 1129 if (IS_CLOSING(key)) { 1130 pj_mutex_unlock(key->mutex); 1131 return PJ_ECANCELLED; 1132 } 1086 1133 key->connecting = PJ_TRUE; 1087 1134 ioqueue_add_to_set(key->ioqueue, key, WRITEABLE_EVENT);
Note: See TracChangeset
for help on using the changeset viewer.