Changeset 4630 for pjproject/trunk
- Timestamp:
- Oct 22, 2013 10:16:28 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsip/sip_transaction.c
r4567 r4630 649 649 pj_hash_get_lower( mod_tsx_layer.htable, key->ptr, 650 650 (unsigned)key->slen, &hval ); 651 652 /* Prevent the transaction to get deleted before we have chance to lock it. 653 */ 654 if (tsx && lock) 655 pj_grp_lock_add_ref(tsx->grp_lock); 656 651 657 pj_mutex_unlock(mod_tsx_layer.mutex); 652 658 … … 655 661 hval, key->slen, key->ptr, tsx)); 656 662 657 /* Race condition! 658 * Transaction may gets deleted before we have chance to lock it. 659 */ 660 PJ_TODO(FIX_RACE_CONDITION_HERE); 663 /* Simulate race condition! */ 661 664 PJ_RACE_ME(5); 662 665 663 if (tsx && lock) 666 if (tsx && lock) { 664 667 pj_grp_lock_acquire(tsx->grp_lock); 668 pj_grp_lock_dec_ref(tsx->grp_lock); 669 } 665 670 666 671 return tsx; … … 799 804 } 800 805 806 /* Prevent the transaction to get deleted before we have chance to lock it 807 * in pjsip_tsx_recv_msg(). 808 */ 809 pj_grp_lock_add_ref(tsx->grp_lock); 810 801 811 /* Unlock hash table. */ 802 812 pj_mutex_unlock( mod_tsx_layer.mutex ); 803 813 804 /* Race condition! 805 * Transaction may gets deleted before we have chance to lock it 806 * in pjsip_tsx_recv_msg(). 807 */ 808 PJ_TODO(FIX_RACE_CONDITION_HERE); 814 /* Simulate race condition! */ 809 815 PJ_RACE_ME(5); 810 816 811 817 /* Pass the message to the transaction. */ 812 818 pjsip_tsx_recv_msg(tsx, rdata ); 819 820 pj_grp_lock_dec_ref(tsx->grp_lock); 813 821 814 822 return PJ_TRUE; … … 850 858 } 851 859 860 /* Prevent the transaction to get deleted before we have chance to lock it 861 * in pjsip_tsx_recv_msg(). 862 */ 863 pj_grp_lock_add_ref(tsx->grp_lock); 864 852 865 /* Unlock hash table. */ 853 866 pj_mutex_unlock( mod_tsx_layer.mutex ); 854 867 855 /* Race condition! 856 * Transaction may gets deleted before we have chance to lock it 857 * in pjsip_tsx_recv_msg(). 858 */ 859 PJ_TODO(FIX_RACE_CONDITION_HERE); 868 /* Simulate race condition! */ 860 869 PJ_RACE_ME(5); 861 870 862 871 /* Pass the message to the transaction. */ 863 872 pjsip_tsx_recv_msg(tsx, rdata ); 873 874 pj_grp_lock_dec_ref(tsx->grp_lock); 864 875 865 876 return PJ_TRUE;
Note: See TracChangeset
for help on using the changeset viewer.