Ignore:
Timestamp:
Jan 29, 2020 4:05:51 AM (4 years ago)
Author:
ming
Message:

Fixed #2264: Potential deadlock between pjsua lock and sip transport's lock

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r6141 r6142  
    27792779        } 
    27802780 
     2781        /* Increment ref counter and release PJSUA lock here, to avoid 
     2782         * deadlock while making sure that regc won't be destroyed. 
     2783         */ 
     2784        pjsip_regc_add_ref(pjsua_var.acc[acc_id].regc); 
     2785        PJSUA_UNLOCK(); 
     2786         
    27812787        //pjsua_process_msg_data(tdata, NULL); 
    27822788        status = pjsip_regc_send( pjsua_var.acc[acc_id].regc, tdata ); 
     2789         
     2790        PJSUA_LOCK(); 
     2791        if (pjsip_regc_dec_ref(pjsua_var.acc[acc_id].regc) == PJ_EGONE) { 
     2792            /* regc has been deleted. */ 
     2793            goto on_return; 
     2794        } 
    27832795    } 
    27842796 
Note: See TracChangeset for help on using the changeset viewer.