[issue18808] Thread.join returns before PyThreadState is destroyed

Antoine Pitrou report at bugs.python.org
Sun Sep 8 20:01:51 CEST 2013


Antoine Pitrou added the comment:

> join() and is_alive() are too complicated now, because of the 2-step
> dance to check whether the thread is done:  we have both an Event
> (_stopped) and a lock (_tstate_lock) to check now.  The Event doesn't
> serve a purpose anymore:  it's almost always uninteresting to know
> _just_ that the Python part of the thread has ended.

Yes, that crossed my mind too. The difficulty is that only plain lock
objects are available from C code, not Events. But if the first join()er
releases the lock just after taking it, it will be enough to make the
code correct?

(after all, it's an event that's never reset, which simplifies things)

(also, why is the current Event implementation based on Condition? isn't
an Event actually simpler than a Condition?)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18808>
_______________________________________


More information about the Python-bugs-list mailing list