Changeset 6134


Ignore:
Timestamp:
Jan 16, 2020 6:37:40 AM (4 years ago)
Author:
ming
Message:

Fixed #2260: Potential deadlock between sip_transaction and sip_reg

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_reg.c

    r6035 r6134  
    11911191 
    11921192        if (status == PJ_SUCCESS) { 
     1193            /* Need to unlock the regc temporarily while sending the message 
     1194             * to prevent deadlock (see ticket #2260 and #1247). 
     1195             * It should be safe to do this since the regc's refcount has been 
     1196             * incremented. 
     1197             */ 
     1198            pj_lock_release(regc->lock); 
    11931199            status = pjsip_regc_send(regc, tdata); 
     1200            pj_lock_acquire(regc->lock); 
    11941201        } 
    11951202         
     
    12811288        status = pjsip_regc_register(regc, regc->auto_reg, &tdata); 
    12821289        if (status == PJ_SUCCESS) { 
     1290            /* Need to unlock the regc temporarily while sending the message 
     1291             * to prevent deadlock (see ticket #2260 and #1247). 
     1292             * It should be safe to do this since the regc's refcount has been 
     1293             * incremented. 
     1294             */ 
     1295            pj_lock_release(regc->lock); 
    12831296            status = pjsip_regc_send(regc, tdata); 
     1297            pj_lock_acquire(regc->lock); 
    12841298        } 
    12851299 
Note: See TracChangeset for help on using the changeset viewer.