Skip to content

Commit bd1f800

Browse files
authored
adding the possibility to check if the tick thread is gone (#187)
* adding the possibility to check if the tick thread is gone * use join to wait for thread
1 parent a1c037c commit bd1f800

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

pysyncobj/syncobj.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,21 @@ def destroy(self):
291291
else:
292292
self._doDestroy()
293293

294+
def tick_thread_alive(self):
295+
"""
296+
Check if the tick thread is alive.
297+
"""
298+
if self.__thread and self.__thread.is_alive():
299+
return True
300+
return False
301+
302+
def destroy_synchronous(self):
303+
"""
304+
Correctly destroy SyncObj. Stop autoTickThread, close connections, etc. and ensure the threads are gone.
305+
"""
306+
self.destroy()
307+
self.__thread.join()
308+
294309
def waitReady(self):
295310
"""
296311
Waits until the transport is ready for operation.

0 commit comments

Comments
 (0)