asterisk/third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch
George Joseph 01e9eaf3a6 pjproject_bundled: Add 3 upstream patches
0035-r5572-svn-backport-dialog-transaction-deadlock.patch
0036-r5573-svn-backport-ua-pjsua-transaction-deadlock.patch
0037-r5576-svn-backport-session-timer-crash.patch

Also removed the progress bar from wget download to stdout.

ASTERISK-26905 #close
Reported-by: Ross Beer

Change-Id: I268fb3cf71a3bb24283ff0d24bd8b03239d81256
2017-04-05 17:17:24 -05:00

33 lines
1.2 KiB
Diff

Index: trunk/pjsip/src/pjsip/sip_transaction.c
===================================================================
--- a/pjsip/src/pjsip/sip_transaction.c (revision 5244)
+++ b/pjsip/src/pjsip/sip_transaction.c (revision 5572)
@@ -1231,5 +1231,27 @@
PJSIP_EVENT_INIT_TSX_STATE(e, tsx, event_src_type, event_src,
prev_state);
+
+ /* For timer event, release lock to avoid deadlock.
+ * This should be safe because:
+ * 1. The tsx state just switches to TERMINATED or DESTROYED.
+ * 2. There should be no other processing taking place. All other
+ * events, such as the ones handled by tsx_on_state_terminated()
+ * should be ignored.
+ * 3. tsx_shutdown() hasn't been called.
+ * Refer to ticket #2001 (https://trac.pjsip.org/repos/ticket/2001).
+ */
+ if (event_src_type == PJSIP_EVENT_TIMER &&
+ (pj_timer_entry *)event_src == &tsx->timeout_timer)
+ {
+ pj_grp_lock_release(tsx->grp_lock);
+ }
+
(*tsx->tsx_user->on_tsx_state)(tsx, &e);
+
+ if (event_src_type == PJSIP_EVENT_TIMER &&
+ (pj_timer_entry *)event_src == &tsx->timeout_timer)
+ {
+ pj_grp_lock_acquire(tsx->grp_lock);
+ }
}