]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Issue 18984: Remove ._stopped Event from Thread internals.
authorTim Peters <tim@python.org>
Sun, 8 Sep 2013 23:44:40 +0000 (18:44 -0500)
committerTim Peters <tim@python.org>
Sun, 8 Sep 2013 23:44:40 +0000 (18:44 -0500)
commitc363a23eff25d8ee74de145be4f447602a5c1a29
treefa1345be35646a508a90a0ff7fca60586369827b
parent050b62d1a684925635193707d2fd1256b4021f6e
Issue 18984:  Remove ._stopped Event from Thread internals.

The fix for issue 18808 left us checking two things to be sure a Thread
was done:  an Event (._stopped) and a mutex (._tstate_lock).  Clumsy &
brittle.  This patch removes the Event, leaving just a happy lock :-)

The bulk of the patch removes two excruciating tests, which were
verifying sanity of the internals of the ._stopped Event after a fork.
Thanks to Antoine Pitrou for verifying that's the only real value
these tests had.

One consequence of moving from an Event to a mutex:  waiters (threads
calling Thread.join()) used to block each on their own unique mutex
(internal to the ._stopped event), but now all contend on the same
mutex (._tstate_lock).  These approaches have different performance
characteristics on different platforms.  I don't think it matters in
this context.
Lib/test/test_threading.py
Lib/threading.py