From 3b8eb91e17f8f4647b4ba9a78ba485f5c490bfac Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Mon, 16 Nov 2015 21:02:14 +0200 Subject: clean termination - stateless and stateful - fix pure virtual function error --- src/stateless/dp/trex_stateless_dp_core.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/stateless/dp/trex_stateless_dp_core.cpp') 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; + } } } -- cgit 1.2.3-korg