summaryrefslogtreecommitdiffstats
path: root/Lib/threading.py
Commit message (Collapse)AuthorAgeFilesLines
* Issue #27076: Doc, comment and tests spelling fixesMartin Panter2016-05-261-1/+1
| | | | Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
* Issue #26987: Correct implementation to match commentZachary Ware2016-05-091-1/+1
| | | | | This was inadvertently changed in 644b677c2ae5 to use self._stderr instead of _sys.stderr.
* merge 3.4 (#25362)Benjamin Peterson2015-10-111-12/+3
|\
| * use the with statement for locking the internal condition (closes #25362)Benjamin Peterson2015-10-111-12/+3
| | | | | | | | Patch by Nir Soffer.
* | merge 3.4 (#25319)Benjamin Peterson2015-10-061-1/+1
|\ \ | |/
| * reinitialize an Event's Condition with a regular lock (closes #25319)Benjamin Peterson2015-10-061-1/+1
| |
* | Merge: #11866: Eliminate race condition in the computation of names for new ↵R David Murray2014-10-041-5/+4
|\ \ | |/ | | | | threads.
| * #11866: Eliminate race condition in the computation of names for new threads.R David Murray2014-10-041-5/+4
| | | | | | | | Original patch by Peter Saveliev.
* | Issue #22423: Unhandled exception in thread no longer causes unhandledSerhiy Storchaka2014-09-211-8/+8
|\ \ | |/ | | | | AttributeError when sys.stderr is None.
| * Issue #22423: Unhandled exception in thread no longer causes unhandledSerhiy Storchaka2014-09-211-8/+8
| | | | | | | | AttributeError when sys.stderr is None.
* | Issue #22043: time.monotonic() is now always availableVictor Stinner2014-09-021-4/+1
| | | | | | | | | | threading.Lock.acquire(), threading.RLock.acquire() and socket operations now use a monotonic clock, instead of the system clock, when a timeout is used.
* | Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait() ↵Antoine Pitrou2014-08-291-5/+6
|\ \ | |/ | | | | | | | | caused by mutation of the waiters queue without holding the lock. Patch by Doug Zongker.
| * Issue #22185: Fix an occasional RuntimeError in threading.Condition.wait() ↵Antoine Pitrou2014-08-291-5/+6
| | | | | | | | | | | | caused by mutation of the waiters queue without holding the lock. Patch by Doug Zongker.
* | Issue 21137: Better repr for threading.Lock()Raymond Hettinger2014-05-261-2/+8
|/
* Issue #20976: pyflakes: Remove unused importsVictor Stinner2014-03-201-1/+0
|
* Remove stray semicolonAntoine Pitrou2014-03-171-1/+1
|
* Changed a comment to end grammar bikeshedding ;-)Tim Peters2013-10-261-1/+1
|
* Fiddled Thread.join() to be a little simpler. Kinda ;-)Tim Peters2013-10-261-4/+4
|
* Issue #19399: fix sporadic test_subprocess failure.Tim Peters2013-10-261-1/+4
| | | | | | Change Thread.join() with a negative timeout to just return. The behavior isn't documented then, but this restores previous behavior.
* merge with 3.3Georg Brandl2013-10-131-39/+375
|\
| * Closes #17375: port new threading docstrings from 2.7.Georg Brandl2013-10-131-39/+375
| |
* | Issue 19158: a rare race in BoundedSemaphore could allow .release() too often.Tim Peters2013-10-091-3/+5
|\ \ | |/
| * Issue 19158: a rare race in BoundedSemaphore could allow .release() too often.Tim Peters2013-10-091-3/+5
| |
* | Get "stopped" back into repr(Thread) when appropriate.Tim Peters2013-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | 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.
* | Another stab at the thread cleanup patch.Tim Peters2013-09-091-3/+26
| | | | | | | | | | | | | | | | | | | | 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 ;-)
* | Backed out changeset 1f5a7853680cTim Peters2013-09-091-26/+5
| | | | | | | | Unixy buildbots were failing the thread + fork tests :-(
* | Minor cleanup of the new scheme for detecting thread termination.Tim Peters2013-09-091-5/+26
| | | | | | | | Documented some obscurities, and assert'ed ._stop()'s crucial precondition.
* | Issue 18984: Remove ._stopped Event from Thread internals.Tim Peters2013-09-081-30/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Issue #18808 again: fix the after-fork logic for not-yet-started or ↵Antoine Pitrou2013-09-081-9/+7
| | | | | | | | | | | | already-stopped threads. (AFAICT, in theory, we must reset all the locks, not just those in use)
* | Issue 18808: blind attempt to repair some buildbot failures.Tim Peters2013-09-081-1/+6
| | | | | | | | | | | | | | 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.
* | Issue #18808: Thread.join() now waits for the underlying thread state to be ↵Antoine Pitrou2013-09-071-32/+55
| | | | | | | | | | | | destroyed before returning. This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
* | Add docstring for threading.main_thread().Andrew Svetlov2013-09-041-0/+5
| |
* | Issue #18882: Add threading.main_thread() function.Andrew Svetlov2013-09-041-16/+20
| |
* | Issue #18418: After fork(), reinit all threads states, not only active ones.Charles-François Natali2013-08-301-1/+1
|\ \ | |/ | | | | Patch by A. Jesse Jiryu Davis.
| * Issue #18418: After fork(), reinit all threads states, not only active ones.Charles-François Natali2013-08-301-1/+1
| | | | | | | | Patch by A. Jesse Jiryu Davis.
* | #18705: merge with 3.3.Ezio Melotti2013-08-171-1/+1
|\ \ | |/
| * #18705: fix a number of typos. Patch by Févry Thibault.Ezio Melotti2013-08-171-1/+1
| |
* | Issue #18200: Back out usage of ModuleNotFoundError (8d28d44f3a9a)Brett Cannon2013-07-041-3/+3
| |
* | Issue #18200: Update the stdlib (except tests) to useBrett Cannon2013-06-141-3/+3
| | | | | | | | ModuleNotFoundError.
* | Issue #11714: Use 'with' statements to assure a Semaphore releases aSerhiy Storchaka2013-04-221-20/+18
|\ \ | |/ | | | | condition variable. Original patch by Thomas Rachel.
| * Issue #11714: Use 'with' statements to assure a Semaphore releases aSerhiy Storchaka2013-04-221-20/+18
| | | | | | | | condition variable. Original patch by Thomas Rachel.
* | Merge #17435: Don't use mutable default values in Timer.R David Murray2013-03-301-4/+4
|\ \ | |/ | | | | Patch by Denver Coneybeare with some test modifications by me.
| * Issue #17435: Don't use mutable default values in Timer.R David Murray2013-03-301-4/+4
| | | | | | | | Patch by Denver Coneybeare with some test modifications by me.
* | Fix importRaymond Hettinger2013-03-211-2/+1
| |
* | Improve variable namesRaymond Hettinger2013-03-111-5/+5
| |
* | Issue #17385: Fix quadratic behavior in threading.ConditionRaymond Hettinger2013-03-111-2/+8
| |
* | Update code to increment and decrement using the cleaner += 1 and -= 1 style.Raymond Hettinger2013-03-101-4/+4
|/
* Issue #14428, #14397: Implement the PEP 418Victor Stinner2012-04-291-1/+5
| | | | | | | | | * Rename time.steady() to time.monotonic() * On Windows, time.monotonic() uses GetTickCount/GetTickCount64() instead of QueryPerformanceCounter() * time.monotonic() uses CLOCK_HIGHRES if available * Add time.get_clock_info(), time.perf_counter() and time.process_time() functions
* Issue #14308: Fix an exception when a dummy thread is in the threading ↵Antoine Pitrou2012-04-191-0/+3
|\ | | | | | | module's active list after a fork().
| * Issue #14308: Fix an exception when a "dummy" thread is in the threading ↵Antoine Pitrou2012-04-191-0/+3
| | | | | | | | module's active list after a fork().