From ca8b613f14121579d99ce8b7c994e5b87984d410 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 7 Jun 2016 15:16:13 +0300 Subject: fix wd issue, in some cases it can't exit with CTRL-C --- src/trex_watchdog.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/trex_watchdog.h') diff --git a/src/trex_watchdog.h b/src/trex_watchdog.h index 63255180..0c1969b1 100644 --- a/src/trex_watchdog.h +++ b/src/trex_watchdog.h @@ -37,10 +37,11 @@ public: m_thread = NULL; m_active = false; m_pending = 0; - - register_signal(); + m_enable = false; } + void init(bool enable); + /** * registering a monitor happens from another thread * this make sure that start will be able to block until @@ -119,16 +120,17 @@ public: /* for for a full cacheline */ uint8_t pad[15]; - }; + } __rte_cache_aligned ; private: void register_signal(); void _main(); + std::vector m_monitors __rte_cache_aligned; std::mutex m_lock; - + bool m_enable; volatile bool m_active; std::thread *m_thread; volatile int m_pending; @@ -136,6 +138,6 @@ private: static bool g_signal_init; }; -static_assert(sizeof(TrexWatchDog::monitor_st) >= RTE_CACHE_LINE_SIZE, "sizeof(monitor_st) != RTE_CACHE_LINE_SIZE" ); +static_assert(sizeof(TrexWatchDog::monitor_st) == RTE_CACHE_LINE_SIZE, "sizeof(monitor_st) != RTE_CACHE_LINE_SIZE" ); #endif /* __TREX_WATCHDOG_H__ */ -- cgit 1.2.3-korg