Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding the possibility to check if the tick thread is gone #187

Merged
merged 2 commits into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading