Changeset 673


Ignore:
Timestamp:
Aug 11, 2006 12:42:50 PM (18 years ago)
Author:
bennylp
Message:

Fixed bugs in previous deadlock workaround

Location:
pjproject/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/build

    • Property svn:ignore
      •  

        old new  
        22*.opt 
        33.pjmedia* 
         4.pjsdp* 
        45*.plg 
        56*.vcproj* 
  • pjproject/trunk/pjsip/src/pjsip/sip_dialog.c

    r671 r673  
    690690PJ_DEF(void) pjsip_dlg_inc_lock(pjsip_dialog *dlg) 
    691691{ 
     692    PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_inc_lock(), sess_count=%d",  
     693              dlg->sess_count)); 
     694 
    692695    pjsip_ua_lock_dlg_table(); 
    693696 
     
    695698    dlg->sess_count++; 
    696699 
    697     pjsip_ua_unlock_dlg_table(); 
     700    //pjsip_ua_unlock_dlg_table(); 
     701 
     702    PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_inc_lock(), sess_count=%d",  
     703              dlg->sess_count)); 
    698704} 
    699705 
     
    705711PJ_DEF(void) pjsip_dlg_dec_lock(pjsip_dialog *dlg) 
    706712{ 
    707     pjsip_ua_lock_dlg_table(); 
     713    PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d",  
     714              dlg->sess_count)); 
     715 
     716    //pjsip_ua_lock_dlg_table(); 
    708717 
    709718    pj_assert(dlg->sess_count > 0); 
     
    719728 
    720729    pjsip_ua_unlock_dlg_table(); 
     730 
     731    PJ_LOG(6,(THIS_FILE, "Leaving pjsip_dlg_dec_lock() (dlg=%p)", dlg)); 
    721732} 
    722733 
  • pjproject/trunk/pjsip/src/pjsip/sip_ua_layer.c

    r671 r673  
    587587 
    588588    /* Lock the dialog */ 
     589    PJ_LOG(6,(dlg->obj_name, "UA layer acquiring dialog lock for request")); 
    589590    pjsip_dlg_inc_lock(dlg); 
     591 
     592    /* Pass to dialog. */ 
     593    pjsip_dlg_on_rx_request(dlg, rdata); 
     594 
     595    /* Unlock the dialog. This may destroy the dialog */ 
     596    pjsip_dlg_dec_lock(dlg); 
    590597 
    591598    /* Done processing in the UA */ 
    592599    pj_mutex_unlock(mod_ua.mutex); 
    593  
    594     /* Pass to dialog. */ 
    595     pjsip_dlg_on_rx_request(dlg, rdata); 
    596  
    597     /* Unlock the dialog. This may destroy the dialog */ 
    598     pjsip_dlg_dec_lock(dlg); 
    599600 
    600601    /* Report as handled. */ 
     
    783784 
    784785    /* Acquire lock to the dialog. */ 
     786    PJ_LOG(6,(dlg->obj_name, "UA layer acquiring dialog lock for response")); 
    785787    pjsip_dlg_inc_lock(dlg); 
     788 
     789    /* Pass the response to the dialog. */ 
     790    pjsip_dlg_on_rx_response(dlg, rdata); 
     791 
     792    /* Unlock the dialog. This may destroy the dialog. */ 
     793    pjsip_dlg_dec_lock(dlg); 
    786794 
    787795    /* Unlock dialog hash table. */ 
    788796    pj_mutex_unlock(mod_ua.mutex); 
    789  
    790     /* Pass the response to the dialog. */ 
    791     pjsip_dlg_on_rx_response(dlg, rdata); 
    792  
    793     /* Unlock the dialog. This may destroy the dialog. */ 
    794     pjsip_dlg_dec_lock(dlg); 
    795797 
    796798    /* Done. */ 
Note: See TracChangeset for help on using the changeset viewer.