| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-14054)
* bpo-36402: Fix threading._shutdown() race condition (GH-13948)
Fix a race condition at Python shutdown when waiting for threads.
Wait until the Python thread state of all non-daemon threads get
deleted (join all non-daemon threads), rather than just wait until
Python threads complete.
* Add threading._shutdown_locks: set of Thread._tstate_lock locks
of non-daemon threads used by _shutdown() to wait until all Python
thread states get deleted. See Thread._set_tstate_lock().
* Add also threading._shutdown_locks_lock to protect access to
threading._shutdown_locks.
* Add test_finalization_shutdown() test.
(cherry picked from commit 468e5fec8a2f534f1685d59da3ca4fad425c38dd)
* bpo-36402: Fix threading.Thread._stop() (GH-14047)
Remove the _tstate_lock from _shutdown_locks, don't remove None.
(cherry picked from commit 6f75c873752a16a7ad8f35855b1e29f59d048e84)
(cherry picked from commit e40a97a721d46307dfdc2b0322028ccded6eb571)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
|
|
| |
(cherry picked from commit 62fa51f1216e788310d3118f4259f1b4b1e529fe)
Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
|
| |
|
| |
Add a pending deprecated warning for the threading.Thread.isAlive() method.
|
| |
|
|
|
| |
(cherry picked from commit 5634331a76dfe9fbe4b76475e11307a0922d6a15)
Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
|
| |
|
|
| |
bpo-31516: current_thread() should not return a dummy thread at shutdown
|
| |
|
|
|
|
| |
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
|
| |
|
|
|
|
|
|
| |
be joined on exit (#3111)
* bpo-18966: non-daemonic threads created by a multiprocessing.Process should be joined on exit
* Add NEWS blurb
|
| |
|
|
| |
Instead use keyword only arguments to os.register_at_fork for each of the scenarios.
Updates the documentation for clarity.
|
| |
|
|
|
|
| |
* bpo-16500: Use register_at_fork() in the threading module
* Update comment at top of _after_fork()
|
| |
|
|
|
|
| |
* Doc nits for bpo-16500
* Fix more references
|
| |
|
|
|
|
|
|
|
|
|
| |
* bpo-6532: Make the thread id an unsigned integer.
From C API side the type of results of PyThread_start_new_thread() and
PyThread_get_thread_ident(), the id parameter of
PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState
changed from "long" to "unsigned long".
* Restore a check in thread_get_ident().
|
| | |
|
| |\ |
|
| | | |
|
| |\ \
| |/ |
|
| | |
| |
| |
| | |
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
|
| |\ \
| |/ |
|
| | |
| |
| |
| |
| | |
This was inadvertently changed in 644b677c2ae5 to use self._stderr
instead of _sys.stderr.
|
| |/ |
|
| |\ |
|
| | |
| |
| |
| | |
Patch by Nir Soffer.
|
| |\ \
| |/ |
|
| | | |
|
| |\ \
| |/
| |
| | |
threads.
|
| | |
| |
| |
| | |
Original patch by Peter Saveliev.
|
| |\ \
| |/
| |
| | |
AttributeError when sys.stderr is None.
|
| | |
| |
| |
| | |
AttributeError when sys.stderr is None.
|
| | |
| |
| |
| |
| | |
threading.Lock.acquire(), threading.RLock.acquire() and socket operations now
use a monotonic clock, instead of the system clock, when a timeout is used.
|
| |\ \
| |/
| |
| |
| |
| | |
caused by mutation of the waiters queue without holding the lock.
Patch by Doug Zongker.
|
| | |
| |
| |
| |
| |
| | |
caused by mutation of the waiters queue without holding the lock.
Patch by Doug Zongker.
|
| |/ |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
| |
Change Thread.join() with a negative timeout to just return. The
behavior isn't documented then, but this restores previous
behavior.
|
| |\ |
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Due to recent changes, a Thread doesn't know that it's over before
someone calls .join() or .is_alive(). That meant repr(Thread)
continued to include "started" (and not "stopped") before one of
those methods was called, even if hours passed since the thread
ended.
Repaired that.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Antoine Pitrou found a variation that worked for him on the
thread+fork tests, and added an important
self._is_stopped = True
to the after-fork code. I confess I don't know why things passed
before. But then mixing fork with threads is insane ;-)
|
| | |
| |
| |
| | |
Unixy buildbots were failing the thread + fork tests :-(
|
| | |
| |
| |
| | |
Documented some obscurities, and assert'ed ._stop()'s crucial precondition.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
already-stopped threads.
(AFAICT, in theory, we must reset all the locks, not just those in use)
|
| | |
| |
| |
| |
| |
| |
| | |
test_is_alive_after_fork is failing on some old Linux kernels, but
passing on all newer ones. Since virtually anything can go wrong
with locks when mixing threads with fork, replace the most likely
cause with a redundant simple data member.
|
| | |
| |
| |
| |
| |
| | |
destroyed before returning.
This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
|
| | | |
|
| | | |
|