Ignore:
Timestamp:
Mar 5, 2013 11:59:54 AM (12 years ago)
Author:
bennylp
Message:

Implementation of Re #1628: Modify SIP transaction to use group lock to avoid deadlock etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip/sip_transaction.h

    r3553 r4420  
    8686    pjsip_module               *tsx_user;       /**< Transaction user.      */ 
    8787    pjsip_endpoint             *endpt;          /**< Endpoint instance.     */ 
    88     pj_mutex_t                 *mutex;          /**< Mutex for this tsx.    */ 
     88    pj_bool_t                   terminating;    /**< terminate() was called */ 
     89    pj_grp_lock_t              *grp_lock;       /**< Transaction grp lock.  */ 
    8990    pj_mutex_t                 *mutex_b;        /**< Second mutex to avoid 
    9091                                                     deadlock. It is used to 
     
    214215 
    215216/** 
     217 * Variant of pjsip_tsx_create_uac() with additional parameter to specify 
     218 * the group lock to use. Group lock can be used to synchronize locking 
     219 * among several objects to prevent deadlock, and to synchronize the 
     220 * lifetime of objects sharing the same group lock. 
     221 * 
     222 * See pjsip_tsx_create_uac() for general info about this function. 
     223 * 
     224 * @param tsx_user  Module to be registered as transaction user of the new 
     225 *                  transaction, which will receive notification from the 
     226 *                  transaction via on_tsx_state() callback. 
     227 * @param tdata     The outgoing request message. 
     228 * @param grp_lock  Optional group lock to use by this transaction. If 
     229 *                  the value is NULL, the transaction will create its 
     230 *                  own group lock. 
     231 * @param p_tsx     On return will contain the new transaction instance. 
     232 * 
     233 * @return          PJ_SUCCESS if successfull. 
     234 */ 
     235PJ_DECL(pj_status_t) pjsip_tsx_create_uac2(pjsip_module *tsx_user, 
     236                                           pjsip_tx_data *tdata, 
     237                                           pj_grp_lock_t *grp_lock, 
     238                                           pjsip_transaction **p_tsx); 
     239 
     240/** 
    216241 * Create, initialize, and register a new transaction as UAS from the 
    217242 * specified incoming request in \c rdata. After calling this function, 
     
    231256                                           pjsip_transaction **p_tsx ); 
    232257 
     258/** 
     259 * Variant of pjsip_tsx_create_uas() with additional parameter to specify 
     260 * the group lock to use. Group lock can be used to synchronize locking 
     261 * among several objects to prevent deadlock, and to synchronize the 
     262 * lifetime of objects sharing the same group lock. 
     263 * 
     264 * See pjsip_tsx_create_uas() for general info about this function. 
     265 * 
     266 * @param tsx_user  Module to be registered as transaction user of the new 
     267 *                  transaction, which will receive notification from the 
     268 *                  transaction via on_tsx_state() callback. 
     269 * @param rdata     The received incoming request. 
     270 * @param grp_lock  Optional group lock to use by this transaction. If 
     271 *                  the value is NULL, the transaction will create its 
     272 *                  own group lock. 
     273 * @param p_tsx     On return will contain the new transaction instance. 
     274 * 
     275 * @return          PJ_SUCCESS if successfull. 
     276 */ 
     277PJ_DECL(pj_status_t) pjsip_tsx_create_uas2(pjsip_module *tsx_user, 
     278                                           pjsip_rx_data *rdata, 
     279                                           pj_grp_lock_t *grp_lock, 
     280                                           pjsip_transaction **p_tsx ); 
    233281 
    234282/** 
Note: See TracChangeset for help on using the changeset viewer.