| 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>
|
| |
|
|
|
|
|
|
| |
handled (GH-7778)
``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python.
(cherry picked from commit 608876b6b1eb59538e6c29671a733033fb8b5be7)
Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
|
| |
|
| |
Add a pending deprecated warning for the threading.Thread.isAlive() method.
|
| |
|
|
|
|
|
| |
(GH-8052)
(cherry picked from commit 65d2f8c044bf597685ba72f66cbcc6b3f7a3ee9c)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
| |
Drop support of FreeBSD 9 and older.
|
| |
|
|
|
|
|
|
|
|
|
| |
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate.
Same change for MB and GB which become MiB and GiB.
Change the output of Tools/iobench/iobench.py.
Round also the size of the documentation from 5.5 MB to 5 MiB.
|
| | |
|
| |
|
|
| |
bpo-31516: current_thread() should not return a dummy thread at shutdown
|
| |
|
|
| |
Call the .join() method of threading.Timer timers to prevent the
"threading_cleanup() failed to cleanup 1 threads" warning.
|
| |
|
|
| |
Use _thread.count() to wait until threads exit. The new context
manager prevents the "dangling thread" warning.
|
| |
|
| |
Call thread.join() to prevent the "dangling thread" warning.
|
| |
|
|
|
|
| |
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
|
| |
|
|
| |
test_bare_raise_in_brand_new_thread() now explicitly breaks a
reference cycle to not leak a dangling thread.
|
| |
|
|
|
|
|
|
|
| |
test_is_alive_after_fork() now joins directly the thread to avoid the
following warning added by bpo-30357:
Warning -- threading_cleanup() failed to cleanup 0 threads
after 2 sec (count: 0, dangling: 21)
Use also a different exit code to catch generic exit code 1.
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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().
|
| | |
|
| | |
|
| |\ |
|
| | |
| |
| |
| |
| |
| |
| |
| | |
Issue #27558: Fix a SystemError in the implementation of "raise" statement.
In a brand new thread, raise a RuntimeError since there is no active
exception to reraise.
Patch written by Xiang Zhang.
|
| |\ \
| |/ |
|
| | | |
|
| | | |
|
| | | |
|
| |\ \
| |/
| |
| | |
messages.
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| |/ |
|
| | |
|
| |
|
|
| |
Patch by Christie Wilson.
|
| | |
|
| |
|
|
| |
AttributeError when sys.stderr is None.
|
| |
|
|
|
| |
regression: don't clear anymore the state of Python threads early during the
Python shutdown.
|
| |\ |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
Fix a crash when a generator is created in a C thread that is destroyed while
the generator is still used. The issue was that a generator contains a frame,
and the frame kept a reference to the Python state of the destroyed C thread.
The crash occurs when a trace function is setup.
|
| | |
| |
| |
| |
| |
| |
| | |
crash when a generator is created in a C thread that is destroyed while the
generator is still used. The issue was that a generator contains a frame, and
the frame kept a reference to the Python state of the destroyed C thread. The
crash occurs when a trace function is setup.
|
| | | |
|
| | |
| |
| |
| |
| | |
shutdown to call objects destructors. So "unclosed file" resource warnings are
now corretly emitted for daemon threads.
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
suppression, and use it in more tests.
Patch by Valerie Lambert and Zachary Ware.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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)
|
| | |
| |
| |
| |
| |
| | |
destroyed before returning.
This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
|
| | | |
|
| |\ \
| |/ |
|
| | | |
|