diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-05-10 17:49:25 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-05-10 17:49:25 +0300 |
commit | 2d37b9f98020a4458aaad1f3fd05ca5e408213e0 (patch) | |
tree | 3a8cd16eb748711b72df37c6f7eea4842d73290a /scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_async_client.py | |
parent | 996f2451dba01f534420418eaac2856510682757 (diff) | |
parent | 63bf6aba10075a03fe6609369c1c7008afb85ba7 (diff) |
merge from master
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): |