Changeset 4242 for pjproject/trunk


Ignore:
Timestamp:
Aug 31, 2012 10:07:05 AM (12 years ago)
Author:
bennylp
Message:

Fixed #1578: Possible deadlock when call is adding new media with ICE and STUN enabled:
svn commit pjsip/src/pjsua-lib/pjsua_media.c -m Fixed

File:
1 edited

Legend:

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

    r4225 r4242  
    527527{ 
    528528    pjsua_call_media *call_med = (pjsua_call_media*)user_data; 
    529     pjsua_call *call = NULL; 
    530     pjsip_dialog *dlg = NULL; 
    531529 
    532530    if (call_med->call == NULL) 
    533531        return; 
    534532 
    535     acquire_call("med_tp_timer_cb", call_med->call->index, &call, &dlg); 
    536  
     533    /* No need to acquire_call() if we only change the tp_ready flag 
     534     * (i.e. transport is being created synchronously). Otherwise 
     535     * calling acquire_call() here may cause deadlock. See 
     536     * https://trac.pjsip.org/repos/ticket/1578 
     537     */ 
    537538    call_med->tp_ready = call_med->tp_result; 
    538     if (call_med->med_create_cb) 
     539 
     540    if (call_med->med_create_cb) { 
     541        pjsua_call *call = NULL; 
     542        pjsip_dialog *dlg = NULL; 
     543 
     544        acquire_call("med_tp_timer_cb", call_med->call->index, &call, &dlg); 
     545 
    539546        (*call_med->med_create_cb)(call_med, call_med->tp_ready, 
    540547                                   call_med->call->secure_level, NULL); 
    541548 
    542     if (dlg) 
    543         pjsip_dlg_dec_lock(dlg); 
     549        if (dlg) 
     550            pjsip_dlg_dec_lock(dlg); 
     551    } 
    544552} 
    545553 
Note: See TracChangeset for help on using the changeset viewer.