diff options
author | Hanoh Haim <hhaim@cisco.com> | 2015-11-16 21:02:14 +0200 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2015-11-16 21:02:14 +0200 |
commit | 3b8eb91e17f8f4647b4ba9a78ba485f5c490bfac (patch) | |
tree | 1d607cb91c661a5cec3c6208941924699f5ab563 /src/stateless/dp/trex_stateless_dp_core.cpp | |
parent | 8017ebe740a1c1d138559795aea9d8ee72236da2 (diff) |
clean termination - stateless and stateful - fix pure virtual function error
Diffstat (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp')
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index 96c18dbd..25984dfc 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -72,6 +72,14 @@ TrexStatelessDpCore::idle_state_loop() { } } + + +void TrexStatelessDpCore::quit_main_loop(){ + m_core->set_terminate_mode(true); /* mark it as terminated */ + add_duration(0.0001); /* add message to terminate */ +} + + /** * scehduler runs when traffic exists * it will return when no more transmitting is done on this @@ -106,6 +114,10 @@ TrexStatelessDpCore::start() { while (true) { run_once(); + + if ( m_core->is_terminated_by_master() ) { + break; + } } } |