From 2dc25cec721c628d15781473fc0ae1bc52e42f0f Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Tue, 17 Sep 2013 14:13:06 -0700 Subject: [PATCH] Fix DeadlineTimer, callback while holding lock --- modules/beast_core/thread/beast_DeadlineTimer.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/modules/beast_core/thread/beast_DeadlineTimer.cpp b/modules/beast_core/thread/beast_DeadlineTimer.cpp index 797c5b0a7..1ea8e516b 100644 --- a/modules/beast_core/thread/beast_DeadlineTimer.cpp +++ b/modules/beast_core/thread/beast_DeadlineTimer.cpp @@ -119,8 +119,10 @@ public: timer->m_isActive = false; } - // Listener will be called later and we will - // go through the loop again without waiting. + timer->m_listener->onDeadlineTimer (*timer); + + // re-loop + seconds = -1; } else { @@ -138,11 +140,7 @@ public: // Note that we have released the lock here. - if (timer != nullptr) - { - timer->m_listener->onDeadlineTimer (*timer); - } - else if (seconds > 0) + if (seconds > 0) { // Wait until interrupt or next timer. //