You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a new thread is started (`Thread.start()`), the current thread
waits for the new thread's `_started` signal (`self._started.wait()`).
If the new thread doesn't have enough memory, it might crash before
signaling its start to the parent thread, causing the parent thread
to wait indefinitely (still in `Thread.start()`).
To fix this, we reintroduce the timeout for `Thread.start()` that was
removed by commit 9e7f1d2. When the
timeout occurs, we check `_os_thread_handle` to see if the thread has
somehow died. If it has, we can confirm the thread exited without
sending the start signal.
We also change `Thread._delete()` to use `pop` to remove the thread from
`_active`, as there is no guarantee that the thread exists in
`_active[get_ident()]`, thus avoiding a potential `KeyError`.
This can happen if `_bootstrap_inner` crashes before
`_active[self._ident] = self` executes. We use `self._ident` because we
know `set_ident()` has already been called.
Moreover, remove the old comment in `_delete` because
`_active_limbo_lock` became reentrant in commit
243fd01.
0 commit comments