I have a list of threads in my Python application. An additional thread is managing all these threads and sometimes it calls thread.join()
on the other threads. The problem is that some of these threads might not have been started yet. This leads to the error:
RuntimeError("cannot join thread before it is started")
How can I check if a thread has been started, before calling the join()
?
Apparently, the event thread._started
should do the trick. So thread._started.is_set()
returns true if the thread has been started.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments