From fff19c8c2faced0972601ca9956bb36a33aa6e87 Mon Sep 17 00:00:00 2001 From: imarom Date: Wed, 21 Dec 2016 14:25:16 +0200 Subject: watchdog disable for time capability Signed-off-by: imarom --- src/trex_watchdog.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/trex_watchdog.cpp') diff --git a/src/trex_watchdog.cpp b/src/trex_watchdog.cpp index 9b6f5865..d2bbeafa 100644 --- a/src/trex_watchdog.cpp +++ b/src/trex_watchdog.cpp @@ -126,12 +126,15 @@ static void _callstack_signal_handler(int signr, siginfo_t *info, void *secret) *************************************/ void TrexMonitor::create(const std::string &name, double timeout_sec) { - m_active = true; - m_tid = pthread_self(); - m_name = name; - m_timeout_sec = timeout_sec; - m_tickled = true; - m_ts = 0; + m_active_time_sec = now_sec(); + m_tid = pthread_self(); + m_name = name; + m_timeout_sec = timeout_sec; + m_tickled = true; + m_ts = 0; + + /* the rare case of m_active_time_sec set out of order with tickled */ + asm volatile("mfence" ::: "memory"); } /************************************** @@ -236,7 +239,7 @@ void TrexWatchDog::_main() { TrexMonitor *monitor = m_monitors[i]; /* skip non active monitors */ - if (!monitor->is_active()) { + if (!monitor->is_active(now)) { continue; } -- cgit 1.2.3-korg