diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-06-07 15:16:13 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-06-07 15:16:13 +0300 |
commit | ca8b613f14121579d99ce8b7c994e5b87984d410 (patch) | |
tree | 2d7cc0d34c88815df747a02f08e814bf3430f1ac /src/trex_watchdog.h | |
parent | 38bcd9c376add0f94e3f660bbcf0558c55f31135 (diff) |
fix wd issue, in some cases it can't exit with CTRL-C
Diffstat (limited to 'src/trex_watchdog.h')
-rw-r--r-- | src/trex_watchdog.h | 12 |
1 files changed, 7 insertions, 5 deletions
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<monitor_st> 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__ */ |