Martin Panter
69332c1a64
Fix spelling and grammar in documentation and code comments
10 years ago
Martin Panter
46f50726a0
Issue #27076 : Doc, comment and tests spelling fixes
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
10 years ago
Zachary Ware
78b5ed98d8
Issue #26987 : Correct implementation to match comment
This was inadvertently changed in 644b677c2ae5 to use self._stderr
instead of _sys.stderr.
10 years ago
Martin Panter
19e69c5a20
Issue #23883 : Add missing APIs to __all__; patch by Jacek Kołodziej
10 years ago
Benjamin Peterson
414918a939
use the with statement for locking the internal condition ( closes #25362 )
Patch by Nir Soffer.
10 years ago
Benjamin Peterson
15982aad2b
reinitialize an Event's Condition with a regular lock ( closes #25319 )
10 years ago
R David Murray
b186f1df41
#11866 : Eliminate race condition in the computation of names for new threads.
Original patch by Peter Saveliev.
12 years ago
Serhiy Storchaka
52005c2e13
Issue #22423 : Unhandled exception in thread no longer causes unhandled
AttributeError when sys.stderr is None.
12 years ago
Victor Stinner
ae58649721
Issue #22043 : time.monotonic() is now always available
threading.Lock.acquire(), threading.RLock.acquire() and socket operations now
use a monotonic clock, instead of the system clock, when a timeout is used.
12 years ago
Antoine Pitrou
a64b92edd3
Issue #22185 : Fix an occasional RuntimeError in threading.Condition.wait() caused by mutation of the waiters queue without holding the lock.
Patch by Doug Zongker.
12 years ago
Raymond Hettinger
62f4dad816
Issue 21137: Better repr for threading.Lock()
12 years ago
Victor Stinner
7fa767e517
Issue #20976 : pyflakes: Remove unused imports
12 years ago
Antoine Pitrou
1095907624
Remove stray semicolon
12 years ago
Tim Peters
a577f1e0f1
Changed a comment to end grammar bikeshedding ;-)
12 years ago
Tim Peters
7bad39f174
Fiddled Thread.join() to be a little simpler. Kinda ;-)
12 years ago
Tim Peters
e5bb0bf04d
Issue #19399 : fix sporadic test_subprocess failure.
Change Thread.join() with a negative timeout to just return. The
behavior isn't documented then, but this restores previous
behavior.
12 years ago
Georg Brandl
c30b59fe3d
Closes #17375 : port new threading docstrings from 2.7.
12 years ago
Tim Peters
7634e1cf90
Issue 19158: a rare race in BoundedSemaphore could allow .release() too often.
13 years ago
Tim Peters
72460fa68b
Get "stopped" back into repr(Thread) when appropriate.
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.
13 years ago
Tim Peters
b5e9ac9ec6
Another stab at the thread cleanup patch.
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 ;-)
13 years ago
Tim Peters
7875523f16
Backed out changeset 1f5a7853680c
Unixy buildbots were failing the thread + fork tests :-(
13 years ago
Tim Peters
7a6054b19d
Minor cleanup of the new scheme for detecting thread termination.
Documented some obscurities, and assert'ed ._stop()'s crucial precondition.
13 years ago
Tim Peters
c363a23eff
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.
13 years ago
Antoine Pitrou
5da7e7959e
Issue #18808 again: fix the after-fork logic for not-yet-started or already-stopped threads.
(AFAICT, in theory, we must reset all the locks, not just those in use)
13 years ago
Tim Peters
68d7f78703
Issue 18808: blind attempt to repair some buildbot failures.
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.
13 years ago
Antoine Pitrou
7b4769937f
Issue #18808 : Thread.join() now waits for the underlying thread state to be destroyed before returning.
This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
13 years ago
Andrew Svetlov
b1dd5572d3
Add docstring for threading.main_thread().
13 years ago
Andrew Svetlov
58b5c5ad14
Issue #18882 : Add threading.main_thread() function.
13 years ago
Charles-François Natali
9939cc89a4
Issue #18418 : After fork(), reinit all threads states, not only active ones.
Patch by A. Jesse Jiryu Davis.
13 years ago
Ezio Melotti
30b9d5d3af
#18705 : fix a number of typos. Patch by Févry Thibault.
13 years ago
Brett Cannon
cd171c8e92
Issue #18200 : Back out usage of ModuleNotFoundError (8d28d44f3a9a)
13 years ago
Brett Cannon
0a140668fa
Issue #18200 : Update the stdlib (except tests) to use
ModuleNotFoundError.
13 years ago
Serhiy Storchaka
81a5855a27
Issue #11714 : Use 'with' statements to assure a Semaphore releases a
condition variable. Original patch by Thomas Rachel.
13 years ago
R David Murray
19aeb439c6
Issue #17435 : Don't use mutable default values in Timer.
Patch by Denver Coneybeare with some test modifications by me.
13 years ago
Raymond Hettinger
3030728138
Fix import
13 years ago
Raymond Hettinger
b65e579926
Improve variable names
13 years ago
Raymond Hettinger
ec4b174de4
Issue #17385 : Fix quadratic behavior in threading.Condition
13 years ago
Raymond Hettinger
720da57159
Update code to increment and decrement using the cleaner += 1 and -= 1 style.
13 years ago
Raymond Hettinger
9f7e247a88
Issue #17375 : Add docstrings to the threading module.
13 years ago
Brian Curtin
a939105a40
Fix #15567 . collections.deque wasn't imported
14 years ago
Victor Stinner
ec89539ccc
Issue #14428 , #14397 : Implement the PEP 418
* 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
14 years ago
Antoine Pitrou
52849bfaa3
Issue #14308 : Fix an exception when a "dummy" thread is in the threading module's active list after a fork().
14 years ago
Antoine Pitrou
8e6e0fdb7f
Issue #14308 : Fix an exception when a "dummy" thread is in the threading module's active list after a fork().
14 years ago
Victor Stinner
3d7c878fe3
Issue #14222 : Use the new time.steady() function instead of time.time() for
timeout in queue and threading modules to not be affected of system time
update.
14 years ago
Victor Stinner
135b6d8aa5
Close #13550 : Remove the debug machinery from the threading module: remove
verbose arguments from all threading classes and functions.
14 years ago
Benjamin Peterson
050a05aeef
remove unused import
14 years ago
Benjamin Peterson
0013783d2f
remove unused import
14 years ago
Charles-François Natali
ded0348c08
Issue #13502 : threading: Fix a race condition in Event.wait() that made it
return False when the event was set and cleared right after.
14 years ago
Charles-François Natali
6d5f9e73d9
Issue #11870 : threading: Properly reinitialize threads internal locks and
condition variables to avoid deadlocks in child processes.
14 years ago
Charles-François Natali
41616300b1
Issue #11870 : threading: Properly reinitialize threads internal locks and
condition variables to avoid deadlocks in child processes.
14 years ago