Changeset 4749 for pjproject


Ignore:
Timestamp:
Feb 18, 2014 12:34:25 PM (10 years ago)
Author:
bennylp
Message:

Fixed #1737: Deadlock between ioqueue key mutex and SIP dialog when adding video media with ICE and STUN enabled

File:
1 edited

Legend:

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

    r4694 r4749  
    830830    if (!async) { 
    831831        pj_bool_t has_pjsua_lock = PJSUA_LOCK_IS_LOCKED(); 
     832        pjsip_dialog *dlg = call_med->call->inv ? 
     833                                call_med->call->inv->dlg : NULL; 
    832834        if (has_pjsua_lock) 
    833835            PJSUA_UNLOCK(); 
     836        if (dlg) { 
     837            /* Don't lock otherwise deadlock: 
     838             * https://trac.pjsip.org/repos/ticket/1737 
     839             */ 
     840            ++dlg->sess_count; 
     841            pjsip_dlg_dec_lock(dlg); 
     842        } 
    834843        while (call_med->tp_ready == PJ_EPENDING) { 
    835844            pjsua_handle_events(100); 
     845        } 
     846        if (dlg) { 
     847            pjsip_dlg_inc_lock(dlg); 
     848            --dlg->sess_count; 
    836849        } 
    837850        if (has_pjsua_lock) 
Note: See TracChangeset for help on using the changeset viewer.