diff options
author | 2015-11-21 18:22:55 +0200 | |
---|---|---|
committer | 2015-11-21 18:22:55 +0200 | |
commit | 8c1cf5d7690fd3e44d196fc6453a2bc5db5a3c9b (patch) | |
tree | 38d05ba22918242f27103c702fb66e9e1cb12e22 /src/stateless | |
parent | ede162750d582cf1dd8c2d7cea3f30b008fb5d42 (diff) |
fix crash in case of CNTL-C
Diffstat (limited to 'src/stateless')
-rw-r--r-- | src/stateless/dp/trex_stateless_dp_core.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/stateless/dp/trex_stateless_dp_core.cpp b/src/stateless/dp/trex_stateless_dp_core.cpp index c4fdd44b..a6fe3f56 100644 --- a/src/stateless/dp/trex_stateless_dp_core.cpp +++ b/src/stateless/dp/trex_stateless_dp_core.cpp @@ -126,7 +126,11 @@ bool TrexStatelessDpPerPort::update_number_of_active_streams(uint32_t d){ void TrexStatelessDpPerPort::stop_traffic(uint8_t port_id){ - assert(m_state==TrexStatelessDpPerPort::ppSTATE_TRANSMITTING); + /* there could be race of stop after stop */ + if (m_state == TrexStatelessDpPerPort::ppSTATE_IDLE) { + assert(m_active_streams==0); + return; + } for (auto dp_stream : m_active_nodes) { CGenNodeStateless * node =dp_stream.m_node; @@ -259,8 +263,10 @@ TrexStatelessDpCore::start_scheduler() { double old_offset = 0.0; m_core->m_node_gen.flush_file(-1, 0.0, false, m_core, old_offset); - /* TBD do we need that ? */ - m_core->m_node_gen.close_file(m_core); + /* bail out in case of terminate */ + if (m_state != TrexStatelessDpCore::STATE_TERMINATE) { + m_core->m_node_gen.close_file(m_core); + } } |