Misc (re #1751): Fixed possible bad assertion caused by race condition between regc_tsx_callback() and pjsip_regc_send() (thanks John Ryan for the report).

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@4876 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
Nanang Izzuddin 2014-07-14 04:49:25 +00:00
parent ec2f27eff9
commit 92ca5b5756
1 changed files with 6 additions and 1 deletions

View File

@ -1362,7 +1362,12 @@ PJ_DEF(pj_status_t) pjsip_regc_send(pjsip_regc *regc, pjsip_tx_data *tdata)
return PJSIP_EBUSY;
}
pj_assert(regc->current_op == REGC_IDLE);
/* Just regc->has_tsx check above should be enough. This assertion check
* may cause problem, e.g: when regc_tsx_callback() invokes callback,
* lock is released and 'has_tsx' is set to FALSE and 'current_op' has
* not been updated to REGC_IDLE yet.
*/
//pj_assert(regc->current_op == REGC_IDLE);
/* Invalidate message buffer. */
pjsip_tx_data_invalidate_msg(tdata);