Skip to content

Commit

Permalink
adding the possibility to check if the tick thread is gone (#187)
Browse files Browse the repository at this point in the history
* adding the possibility to check if the tick thread is gone

* use join to wait for thread
  • Loading branch information
snubba authored Oct 31, 2024
1 parent a1c037c commit bd1f800
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pysyncobj/syncobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,21 @@ def destroy(self):
else:
self._doDestroy()

def tick_thread_alive(self):
"""
Check if the tick thread is alive.
"""
if self.__thread and self.__thread.is_alive():
return True
return False

def destroy_synchronous(self):
"""
Correctly destroy SyncObj. Stop autoTickThread, close connections, etc. and ensure the threads are gone.
"""
self.destroy()
self.__thread.join()

def waitReady(self):
"""
Waits until the transport is ready for operation.
Expand Down

0 comments on commit bd1f800

Please sign in to comment.