summaryrefslogtreecommitdiffstats
path: root/Modules/threadmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* #17091: update docstring for _thread.Lock.acquire.R David Murray2013-02-041-2/+2
| | | | | | The main docs were fixed to remove mention of None long ago, but the docstring was not. Reported by Armin Rigo, patch by Ian Cordasco.
* protect this call, tooBenjamin Peterson2012-04-021-1/+1
|
* prevent writing to stderr from messing up the exception state (closes #14474)Benjamin Peterson2012-04-021-0/+3
|
* Fix error message to use the Python name instead of the C nameÉric Araujo2011-05-311-1/+1
|
* #11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti2011-03-151-1/+1
|
* Merged revisions 84344 via svnmerge fromAntoine Pitrou2010-08-281-43/+38
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84344 | antoine.pitrou | 2010-08-28 20:17:03 +0200 (sam., 28 août 2010) | 4 lines Issue #1868: Eliminate subtle timing issues in thread-local objects by getting rid of the cached copy of thread-local attribute dictionary. ........
* Merged revisions 84106 via svnmerge fromAlexander Belopolsky2010-08-161-1/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84106 | alexander.belopolsky | 2010-08-16 16:17:07 -0400 (Mon, 16 Aug 2010) | 1 line Issue #8983: Corrected docstrings. ........
* Merged revisions 83918 via svnmerge fromAntoine Pitrou2010-08-091-45/+224
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83918 | antoine.pitrou | 2010-08-10 00:38:19 +0200 (mar., 10 août 2010) | 5 lines Issue #3757: thread-local objects now support cyclic garbage collection. Thread-local objects involved in reference cycles will be deallocated timely by the cyclic GC, even if the underlying thread is still running. ........
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-465/+465
|
* Issue #7544: Preallocate thread memory before creating the thread to avoid aVictor Stinner2010-03-031-2/+10
| | | | fatal error in low memory condition.
* Issue #3299: fix thread.allocate_lock() error handler, replace PyObject_Del()Victor Stinner2010-03-031-8/+9
| | | | by Py_DECREF() to fix a crash in pydebug mode.
* #4852: Remove dead code in every thread implementation, unused for many years.Amaury Forgeot d'Arc2010-02-231-16/+0
|
* Remove official documentation entry for thread._count() and make theAntoine Pitrou2009-10-301-2/+8
| | | | docstring more descriptive instead.
* Issue #7222: Make thread "reaping" more reliable so that referenceAntoine Pitrou2009-10-301-1/+19
| | | | | | | leak-chasing test runs give sensible results. The previous method of reaping threads could return successfully while some Thread objects were still referenced. This also introduces a new private function: :func:hread._count().
* #6990: clear threading.local's key only after its thread state is removed:Philip Jenvey2009-09-291-1/+1
| | | | | fixes local subclasses leaving old state around after a ref cycle GC which could be recycled by new locals
* Add weakref support to the thread.lock type.Gregory P. Smith2009-08-201-2/+7
|
* stop using Py_FindMethodBenjamin Peterson2009-05-241-8/+22
|
* #Issue3088 in-progress: Race condition with instances of classes derived ↵Amaury Forgeot d'Arc2008-06-301-1/+4
| | | | | | | | | | | | | from threading.local: When a thread touches such an object for the first time, a new thread-local __dict__ is created, and the __init__ method is run. But a thread switch can occur here; if the other thread touches the same object, it installs another __dict__; when the first thread resumes, it updates the dictionary of the second... This is the deep cause of the failures in test_multiprocessing involving "managers" objects. Also a 2.5 backport candidate.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-1/+1
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-1/+1
|
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-4/+4
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-8/+6
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Add some asserts. In sysmodule, I think these were to try to silenceNeal Norwitz2006-10-281-0/+1
| | | | | | | some warnings from Klokwork. They verify the assumptions of the format of svn version output. The assert in the thread module helped debug a problem on HP-UX.
* Remove unused variable.Brett Cannon2006-06-131-1/+0
|
* Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre2006-06-131-0/+58
| | | | | | | | | | Heavily revised, comprising revisions: 46640 - original trunk revision (backed out in r46655) 46647 - markup fix (backed out in r46655) 46692:46918 merged from branch aimacintyre-sf1454481 branch tested on buildbots (Windows buildbots had problems not related to these changes).
* Revert revisions:Tim Peters2006-06-041-48/+0
| | | | | | | | | | | | | | | | 46640 Patch #1454481: Make thread stack size runtime tunable. 46647 Markup fix The first is causing many buildbots to fail test runs, and there are multiple causes with seemingly no immediate prospects for repairing them. See python-dev discussion. Note that a branch can (and should) be created for resolving these problems, like svn copy svn+ssh://svn.python.org/python/trunk -r46640 svn+ssh://svn.python.org/python/branches/NEW_BRANCH followed by merging rev 46647 to the new branch.
* Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre2006-06-041-0/+48
|
* Make use of METH_O and METH_NOARGS where possible.Georg Brandl2006-05-291-1/+2
| | | | Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
* Get rid of __context__, per the latest changes to PEP 343 and python-devGuido van Rossum2006-05-021-9/+0
| | | | | | | | discussion. There are two places of documentation that still mention __context__: Doc/lib/libstdtypes.tex -- I wasn't quite sure how to rewrite that without spending a whole lot of time thinking about it; and whatsnew, which Andrew usually likes to change himself.
* remove forward declarations, move constructor functions. makes code C++ safe.Anthony Baxter2006-04-121-43/+42
|
* Remove unnecessary casts from type object initializers.Georg Brandl2006-03-301-18/+18
|
* Um, I thought I'd already checked this in.Guido van Rossum2006-03-101-27/+4
| | | | | | | Anyway, this is the changes to the with-statement so that __exit__ must return a true value in order for a pending exception to be ignored. The PEP (343) is already updated.
* typoGeorg Brandl2006-03-081-1/+1
|
* Updates to the with-statement:Guido van Rossum2006-02-281-0/+36
| | | | | | | | | | | | | | | | - New semantics for __exit__() -- it must re-raise the exception if type is not None; the with-statement itself doesn't do this. (See the updated PEP for motivation.) - Added context managers to: - file - thread.LockType - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore} - decimal.Context - Added contextlib.py, which defines @contextmanager, nested(), closing(). - Unit tests all around; bot no docs yet.
* Check return result from Py_InitModule*(). This API can fail.Neal Norwitz2006-01-191-0/+2
| | | | Probably should be backported.
* Fix bug:Michael W. Hudson2005-06-201-3/+6
| | | | | | | | [ 1163563 ] Sub threads execute in restricted mode basically by fixing bug 1010677 in a non-broken way. Backport candidate.
* Consistently use hard tabs for indentation.Michael W. Hudson2005-06-151-172/+165
| | | | | | Slightly de-Fultonize two bits of C layout. No semantic changes.
* Add a missing incref.Michael W. Hudson2005-06-151-0/+1
| | | | Backport candidate.
* Delete some vestigial code; execution will never reach the 'if' statement if ↵Andrew M. Kuchling2005-06-021-6/+1
| | | | args is NULL
* The error message "can't start new thread" should not end in aGuido van Rossum2005-02-201-1/+1
| | | | newline.
* Fix for [ 1010677 ] thread Module Breaks PyGILState_Ensure(),Mark Hammond2004-08-241-5/+3
| | | | | and a test case. When booting a new thread, use the PyGILState API to manage the GIL.
* Implemented thread-local data as proposed on python-dev:Jim Fulton2004-07-141-0/+260
| | | | http://mail.python.org/pipermail/python-dev/2004-June/045785.html
* Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin2004-03-241-1/+1
|
* Correct function name.Kurt B. Kaiser2003-06-161-3/+3
|
* Add interrupt_main() to thread module.Kurt B. Kaiser2003-06-131-0/+17
|
* When an unhandled exception happens, report the repr() of the functionGuido van Rossum2003-04-291-5/+13
| | | | | | | that was used to start the thread. This is useful to track down the source of the problem when there is no traceback, as can happen when a daemon thread gets to run after Python is finialized (a new kind of event, somehow this is now possible due to changes in Py_Finalize()).
* --with(out)-thread is deprecated according to configure --helpNeal Norwitz2002-09-051-1/+1
|
* Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond2002-08-021-1/+1
| | | | | | for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
* staticforward bites the dust.Jeremy Hylton2002-07-171-1/+1
| | | | | | | | | | | | | | | The staticforward define was needed to support certain broken C compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the static keyword when it was used with a forward declaration of a static initialized structure. Standard C allows the forward declaration with static, and we've decided to stop catering to broken C compilers. (In fact, we expect that the compilers are all fixed eight years later.) I'm leaving staticforward and statichere defined in object.h as static. This is only for backwards compatibility with C extensions that might still use it. XXX I haven't updated the documentation.
* Patch #568124: Add doc string macros.Martin v. Löwis2002-06-131-18/+18
|