47 Commits

Author SHA1 Message Date
Brett Cannon
cfced277da Backport of patch #1314396: prevent threading.Thread.join() from blocking if a
previous call raised an exception (e.g., calling it with an illegal argument).
2005-11-23 02:19:18 +00:00
Brett Cannon
22f1b0990f Fixed typo in verbose output for RLock acquire.
Fixes bug #1110998.
2005-01-27 22:49:39 +00:00
Tim Peters
21429932e4 Thread.__delete: Discussion of internal obscurities belongs in comments
rather than in docstrings.  Rewrote so that _active_limbo_lock is released
no matter what happens (it could have been left locked if _sys got None'd
out).  Use "in" in preference to has_key() for dict lookup.  Don't bother
looking for 'dummy_threading' in sys.modules unless KeyError is raised.
Since the heart of the method is the del, do that in only one place.
2004-07-21 03:36:52 +00:00
Brett Cannon
8b3d92a977 Fix bug where a KeyError was raised if -O was being used for the interpreter
and Thread.__delete() was called after a Thread instance was created.  Problem
resulted from a currentThread() call in an 'assert' statement being optimized
out and dummy_thread.get_ident() always returning -1 and thus overwriting the
entry for the _MainThread() instance created in 'threading' at import time.

Closes bug #993394.
2004-07-21 02:21:58 +00:00
Jim Fulton
d15dc06df0 Implemented thread-local data as proposed on python-dev:
http://mail.python.org/pipermail/python-dev/2004-June/045785.html
2004-07-14 19:11:50 +00:00
Brett Cannon
cc4e935ea5 threading.Thread objects will now print a traceback for an exception raised
during interpreter shutdown instead of masking it with another traceback about
accessing a NoneType when trying to print the exception out in the first place.

Closes bug #754449 (using patch #954922).
2004-07-03 03:52:35 +00:00
Brett Cannon
4b6b7f1515 Remove calls to currentThread() in _Condition methods that were side-effect.
Side-effects were deemed unnecessary and were causing problems at shutdown
time when threads were catching exceptions at start time and then triggering
exceptions trying to call currentThread() after gc'ed.  Masked the initial
exception which was deemed bad.

Fixes bug #754449 .
2004-03-08 22:18:57 +00:00
Raymond Hettinger
756b3f3c15 * Move collections.deque() in from the sandbox
* Add unittests, newsitem, and whatsnew
* Apply to Queue.py mutex.py threading.py pydoc.py and shlex.py
* Docs are forthcoming
2004-01-29 06:37:52 +00:00
Neil Schemenauer
f607fc5395 Add traceback.format_exc(). 2003-11-05 23:03:00 +00:00
Tim Peters
59aba128a5 Make the classes exposed by threading.py new-style classes. This is
mostly for convenience and to aid debugging.
2003-07-01 20:01:55 +00:00
Tim Peters
0939fac795 Resolved minor XXX question in the obvious way. 2003-07-01 19:28:44 +00:00
Tim Peters
d1b108b953 Whitespace normalization. 2003-06-29 17:24:17 +00:00
Jeremy Hylton
89392c0005 Remove stub settrace() and setprofile() calls. 2003-06-29 17:07:46 +00:00
Jeremy Hylton
bfccb35b58 Add settrace() and setprofile() functions to the threading library. 2003-06-29 16:58:41 +00:00
Tim Peters
685e69739e Provide dummy (do-nothing) settrace() and setprofile() functions until
Jeremy can check in the real things.
2003-06-29 16:50:06 +00:00
Guido van Rossum
68468eba63 Get rid of many apply() calls. 2003-02-27 20:14:51 +00:00
Fred Drake
a872595f31 - prefer "import ... as" to "import / (assignments) / del" for most things
- when the thread module isn't available, subsequent attempts to import
  threading should not suceed
2002-12-30 23:32:50 +00:00
Guido van Rossum
c262a1f51c Add __all__. (Brett Cannon.) 2002-12-30 21:59:55 +00:00
Guido van Rossum
21b60147e9 The _Event class should be more careful with releasing its lock when
interrupted.  A try/finally will do nicely.  Maybe other classes need
this too, but since they manipulate more state it's less clear that
that is always the right thing, and I'm in a hurry.

Backport candidate.
2002-11-21 21:08:39 +00:00
Jeremy Hylton
92bb6e7b96 Docstring nits: The module is neither proposed nor new. 2002-08-14 19:25:42 +00:00
Jeremy Hylton
29c2106465 Explain use of currentThread() in _Condition methods. 2002-08-14 17:56:13 +00:00
Jeremy Hylton
39c12bfba1 Explain a little more. 2002-08-14 17:46:40 +00:00
Jeremy Hylton
af7fde7f34 Explain a minor mystery. 2002-08-14 17:43:59 +00:00
Raymond Hettinger
46ac8eb3c8 Code modernization. Replace v=s[i]; del s[i] with single lookup v=s.pop(i) 2002-06-30 03:39:14 +00:00
Guido van Rossum
8ca162f417 Partial introduction of bools where appropriate. 2002-04-07 06:36:23 +00:00