Author: stippi Date: Tue Apr 20 01:32:35 2010 New Revision: 430 URL: http://mmlr.dyndns.org/changeset/430 Log: Also cancel sending the message at all in the timer thread, when stopping timers. Modified: webkit/trunk/WebCore/platform/haiku/SharedTimerHaiku.cpp Modified: webkit/trunk/WebCore/platform/haiku/SharedTimerHaiku.cpp ============================================================================== --- webkit/trunk/WebCore/platform/haiku/SharedTimerHaiku.cpp Tue Apr 20 01:31:43 2010 (r429) +++ webkit/trunk/WebCore/platform/haiku/SharedTimerHaiku.cpp Tue Apr 20 01:32:35 2010 (r430) @@ -33,6 +33,7 @@ #include <support/Locker.h> #include <support/Autolock.h> #include <wtf/CurrentTime.h> +#include <stdio.h> #define FIRE_MESSAGE 'fire' @@ -103,9 +104,11 @@ case B_TIMED_OUT: // do events, that are supposed to go off if (!m_terminating && Lock() && system_time() >= m_nextFireTime) { + bool sendMessage = m_nextFireTime > 0; m_nextFireTime = 0; Unlock(); - m_timer.SendMessage(FIRE_MESSAGE); + if (sendMessage) + m_timer.SendMessage(FIRE_MESSAGE); } if (IsLocked()) Unlock(); @@ -197,6 +200,7 @@ void SharedTimerHaiku::stop() { m_shouldRun = false; + m_timerThread->setNextEventTime(0); } void SharedTimerHaiku::MessageReceived(BMessage*)