Changeset 5795


Ignore:
Timestamp:
May 23, 2018 1:33:00 AM (6 years ago)
Author:
ming
Message:

Fixed #2115: Deadlock between PJSUA LOCK and conference mutex

File:
1 edited

Legend:

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

    r5788 r5795  
    37613761{ 
    37623762    pjsua_call *call; 
     3763    unsigned num_locks = 0; 
    37633764 
    37643765    pj_log_push_indent(); 
     
    38953896    } 
    38963897 
     3898    /* Release locks before calling callbacks, to avoid deadlock. */ 
     3899    while (PJSUA_LOCK_IS_LOCKED()) { 
     3900        num_locks++; 
     3901        PJSUA_UNLOCK(); 
     3902    } 
     3903 
    38973904    /* Ticket #1627: Invoke on_call_tsx_state() when call is disconnected. */ 
    38983905    if (inv->state == PJSIP_INV_STATE_DISCONNECTED && 
     
    39073914    if (pjsua_var.ua_cfg.cb.on_call_state) 
    39083915        (*pjsua_var.ua_cfg.cb.on_call_state)(call->index, e); 
     3916 
     3917    /* Re-acquire the locks. */ 
     3918    for (;num_locks > 0; num_locks--) 
     3919        PJSUA_LOCK(); 
    39093920 
    39103921    /* call->inv may be NULL now */ 
Note: See TracChangeset for help on using the changeset viewer.