diff options
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py')
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py index 022077a9..5c9faf0f 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py @@ -194,11 +194,13 @@ class CTRexAsyncClient(): if not self.connected: return + # mark for join + self.active = False + # signal that the context was destroyed (exit the thread loop) self.context.term() - # mark for join and join - self.active = False + # join self.t.join() # done @@ -239,6 +241,7 @@ class CTRexAsyncClient(): except zmq.ContextTerminated: # outside thread signaled us to exit + assert(not self.active) break msg = json.loads(line) @@ -256,6 +259,8 @@ class CTRexAsyncClient(): # closing of socket must be from the same thread self.socket.close(linger = 0) + def is_thread_alive (self): + return self.t.is_alive() # did we get info for the last 3 seconds ? def is_alive (self): |