From 716a11c953cb1ab7c521cf4e56add6c6e367bed0 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Mon, 14 Jul 2014 04:49:25 +0000 Subject: 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: http://svn.pjsip.org/repos/pjproject/trunk@4876 74dad513-b988-da41-8d7b-12977e46ad98 --- pjsip/src/pjsip-ua/sip_reg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pjsip/src/pjsip-ua/sip_reg.c b/pjsip/src/pjsip-ua/sip_reg.c index ca907bab..cca2526d 100644 --- a/pjsip/src/pjsip-ua/sip_reg.c +++ b/pjsip/src/pjsip-ua/sip_reg.c @@ -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); -- cgit v1.2.3