Ignore:
Timestamp:
Jul 3, 2006 2:18:17 PM (18 years ago)
Author:
bennylp
Message:

Fixed minor bug in pool_caching.c that prevent pool from being reused if the capacity has changed when the pool is released

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_endpoint.c

    r561 r581  
    8989 
    9090 
     91#if defined(PJSIP_SAFE_MODULE) && PJSIP_SAFE_MODULE!=0 
     92#   define LOCK_MODULE_ACCESS(ept)      pj_rwmutex_lock_read(ept->mod_mutex) 
     93#   define UNLOCK_MODULE_ACCESS(ept)    pj_rwmutex_unlock_read(ept->mod_mutex) 
     94#else 
     95#   define LOCK_MODULE_ACCESS(endpt) 
     96#   define UNLOCK_MODULE_ACCESS(endpt) 
     97#endif 
     98 
     99 
    91100 
    92101/* 
     
    582591    PJ_LOG(6, (THIS_FILE, "Releasing pool %s", pj_pool_getobjname(pool))); 
    583592 
    584     pj_mutex_lock(endpt->mutex); 
     593    /* Don't need to acquire mutex since pool factory is thread safe 
     594       pj_mutex_lock(endpt->mutex); 
     595     */ 
    585596    pj_pool_release( pool ); 
     597 
     598    /* 
    586599    pj_mutex_unlock(endpt->mutex); 
     600     */ 
    587601} 
    588602 
     
    777791 
    778792    /* Distribute to modules, starting from modules with highest priority */ 
    779     pj_rwmutex_lock_read(endpt->mod_mutex); 
     793    LOCK_MODULE_ACCESS(endpt); 
    780794 
    781795    if (msg->type == PJSIP_REQUEST_MSG) { 
     
    824838    } 
    825839 
    826     pj_rwmutex_unlock_read(endpt->mod_mutex); 
     840    UNLOCK_MODULE_ACCESS(endpt); 
    827841 
    828842    /* Must clear mod_data before returning rdata to transport, since 
     
    843857 
    844858    /* Distribute to modules, starting from modules with LOWEST priority */ 
    845     pj_rwmutex_lock_read(endpt->mod_mutex); 
     859    LOCK_MODULE_ACCESS(endpt); 
    846860 
    847861    mod = endpt->module_list.prev; 
     
    865879    } 
    866880 
    867     pj_rwmutex_unlock_read(endpt->mod_mutex); 
     881    UNLOCK_MODULE_ACCESS(endpt); 
    868882 
    869883    return status; 
Note: See TracChangeset for help on using the changeset viewer.