We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f3cf861 commit 53fada2Copy full SHA for 53fada2
1 file changed
src/thread/thread.py
@@ -166,6 +166,19 @@ def result(self) -> Data_Out:
166
else:
167
raise exceptions.ThreadStillRunningError()
168
169
+
170
+ def is_alive(self) -> bool:
171
+ """
172
+ See if thread is still alive
173
174
+ Raises
175
+ ------
176
+ ThreadNotInitializedError: If the thread is not intialized
177
178
+ if not self._thread:
179
+ raise exceptions.ThreadNotInitializedError()
180
+ return self._thread.is_alive()
181
182
183
def add_hook(self, hook: Callable[[Data_Out], Any | None]) -> None:
184
"""
0 commit comments