pjproject: Add timer patch from pjproject r5934
authorSean Bright <sean.bright@gmail.com>
Tue, 26 Mar 2019 18:07:25 +0000 (14:07 -0400)
committerSean Bright <sean.bright@gmail.com>
Wed, 27 Mar 2019 14:10:51 +0000 (08:10 -0600)
ASTERISK-28161 #close
Reported by: Ross Beer

Change-Id: I65331d554695753005eaa66c1d5d4807fe9009c8

third-party/pjproject/patches/0030-Re-2176-Removed-pop_freelist-push_freelist-after-rem.patch [new file with mode: 0644]

diff --git a/third-party/pjproject/patches/0030-Re-2176-Removed-pop_freelist-push_freelist-after-rem.patch b/third-party/pjproject/patches/0030-Re-2176-Removed-pop_freelist-push_freelist-after-rem.patch
new file mode 100644 (file)
index 0000000..8a44cae
--- /dev/null
@@ -0,0 +1,37 @@
+From 9f57a5728aaec1949908bf7bbd15768fce74e315 Mon Sep 17 00:00:00 2001
+From: Nanang Izzuddin <nanang@teluu.com>
+Date: Wed, 13 Feb 2019 06:51:09 +0000
+Subject: [PATCH] Re #2176: Removed pop_freelist() + push_freelist() after
+ remove_node() as they are not only unnecessary, they cause problem.
+
+git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@5934 74dad513-b988-da41-8d7b-12977e46ad98
+---
+ pjlib/src/pj/timer.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/pjlib/src/pj/timer.c b/pjlib/src/pj/timer.c
+index 90a95e37..a1e1932c 100644
+--- a/pjlib/src/pj/timer.c
++++ b/pjlib/src/pj/timer.c
+@@ -630,7 +630,8 @@ PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht,
+     {
+       pj_timer_entry *node = remove_node(ht, 0);
+       /* Avoid re-use of this timer until the callback is done. */
+-      pj_timer_id_t node_timer_id = pop_freelist(ht);
++      ///Not necessary, even causes problem (see also #2176).
++      ///pj_timer_id_t node_timer_id = pop_freelist(ht);
+       pj_grp_lock_t *grp_lock;
+       ++count;
+@@ -650,7 +651,7 @@ PJ_DEF(unsigned) pj_timer_heap_poll( pj_timer_heap_t *ht,
+       lock_timer_heap(ht);
+       /* Now, the timer is really free for re-use. */
+-      push_freelist(ht, node_timer_id);
++      ///push_freelist(ht, node_timer_id);
+     }
+     if (ht->cur_size && next_delay) {
+       *next_delay = ht->heap[0]->_timer_value;
+-- 
+2.17.1
+