You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by sh...@apache.org on 2016/04/27 18:11:53 UTC

[trafficserver] branch master updated: TS-3429: Fix reference counting for TSContScheduleEvery. This closes #576.

This is an automated email from the ASF dual-hosted git repository.

shinrich pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  3286600   TS-3429: Fix reference counting for TSContScheduleEvery.  This closes #576.
3286600 is described below

commit 3286600d90be4b6291b35867720adbd864f580ea
Author: shinrich <sh...@yahoo-inc.com>
AuthorDate: Mon Apr 18 10:15:16 2016 -0500

    TS-3429: Fix reference counting for TSContScheduleEvery.  This closes #576.
---
 proxy/InkAPI.cc | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/proxy/InkAPI.cc b/proxy/InkAPI.cc
index f525ee3..7e1ec07 100644
--- a/proxy/InkAPI.cc
+++ b/proxy/InkAPI.cc
@@ -990,7 +990,16 @@ INKContInternal::handle_event(int event, void *edata)
       Warning("INKCont Deletable but not deleted %d", m_event_count);
     }
   } else {
-    return m_event_func((TSCont)this, (TSEvent)event, edata);
+    int retval = m_event_func((TSCont)this, (TSEvent)event, edata);
+    if (edata && event == EVENT_INTERVAL) {
+      Event *e = reinterpret_cast<Event *>(edata);
+      if (e->period != 0) {
+        // In the interval case, we must re-increment the m_event_count for
+        // the next go around.  Otherwise, our event count will go negative.
+        ink_release_assert(ink_atomic_increment((int *)&this->m_event_count, 1) >= 0);
+      }
+    }
+    return retval;
   }
   return EVENT_DONE;
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].