summaryrefslogtreecommitdiff
path: root/third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch
diff options
context:
space:
mode:
Diffstat (limited to 'third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch')
-rw-r--r--third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch b/third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch
new file mode 100644
index 000000000..0c5e9866c
--- /dev/null
+++ b/third-party/pjproject/patches/0035-r5572-svn-backport-dialog-transaction-deadlock.patch
@@ -0,0 +1,32 @@
+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);
++ }
+ }
+