summaryrefslogtreecommitdiff
path: root/Modules/threadmodule.c
AgeCommit message (Collapse)AuthorLines
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-437/+437
2010-03-03Issue #7544: Preallocate thread memory before creating the thread to avoid aVictor Stinner-2/+10
fatal error in low memory condition.
2010-03-03Issue #3299: fix thread.allocate_lock() error handler, replace PyObject_Del()Victor Stinner-8/+9
by Py_DECREF() to fix a crash in pydebug mode.
2010-02-23#4852: Remove dead code in every thread implementation, unused for many years.Amaury Forgeot d'Arc-16/+0
2009-10-30Remove official documentation entry for thread._count() and make theAntoine Pitrou-2/+8
docstring more descriptive instead.
2009-10-30Issue #7222: Make thread "reaping" more reliable so that referenceAntoine Pitrou-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().
2009-09-29#6990: clear threading.local's key only after its thread state is removed:Philip Jenvey-1/+1
fixes local subclasses leaving old state around after a ref cycle GC which could be recycled by new locals
2009-08-20Add weakref support to the thread.lock type.Gregory P. Smith-2/+7
2009-05-24stop using Py_FindMethodBenjamin Peterson-8/+22
2008-06-30#Issue3088 in-progress: Race condition with instances of classes derived ↵Amaury Forgeot d'Arc-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.
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-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.
2008-05-26Renamed PyString to PyBytesChristian Heimes-1/+1
2007-12-19#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes-4/+4
Py_REFCNT. Macros for b/w compatibility are available.
2007-07-21PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis-8/+6
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
2006-10-28Add some asserts. In sysmodule, I think these were to try to silenceNeal Norwitz-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.
2006-06-13Remove unused variable.Brett Cannon-1/+0
2006-06-13Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre-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).
2006-06-04Revert revisions:Tim Peters-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.
2006-06-04Patch #1454481: Make thread stack size runtime tunable.Andrew MacIntyre-0/+48
2006-05-29Make use of METH_O and METH_NOARGS where possible.Georg Brandl-1/+2
Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
2006-05-02Get rid of __context__, per the latest changes to PEP 343 and python-devGuido van Rossum-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.
2006-04-12remove forward declarations, move constructor functions. makes code C++ safe.Anthony Baxter-43/+42
2006-03-30Remove unnecessary casts from type object initializers.Georg Brandl-18/+18
2006-03-10Um, I thought I'd already checked this in.Guido van Rossum-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.
2006-03-08typoGeorg Brandl-1/+1
2006-02-28Updates to the with-statement:Guido van Rossum-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.
2006-01-19Check return result from Py_InitModule*(). This API can fail.Neal Norwitz-0/+2
Probably should be backported.
2005-06-20Fix bug:Michael W. Hudson-3/+6
[ 1163563 ] Sub threads execute in restricted mode basically by fixing bug 1010677 in a non-broken way. Backport candidate.
2005-06-15Consistently use hard tabs for indentation.Michael W. Hudson-159/+152
Slightly de-Fultonize two bits of C layout. No semantic changes.
2005-06-15Add a missing incref.Michael W. Hudson-0/+1
Backport candidate.
2005-06-02Delete some vestigial code; execution will never reach the 'if' statement if ↵Andrew M. Kuchling-6/+1
args is NULL
2005-02-20The error message "can't start new thread" should not end in aGuido van Rossum-1/+1
newline.
2004-08-24Fix for [ 1010677 ] thread Module Breaks PyGILState_Ensure(),Mark Hammond-5/+3
and a test case. When booting a new thread, use the PyGILState API to manage the GIL.
2004-07-14Implemented thread-local data as proposed on python-dev:Jim Fulton-0/+260
http://mail.python.org/pipermail/python-dev/2004-June/045785.html
2004-03-24Changed random calls to PyThreadState_Get() to use the macroNicholas Bastin-1/+1
2003-06-16Correct function name.Kurt B. Kaiser-3/+3
2003-06-13Add interrupt_main() to thread module.Kurt B. Kaiser-0/+17
2003-04-29When an unhandled exception happens, report the repr() of the functionGuido van Rossum-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()).
2002-09-05--with(out)-thread is deprecated according to configure --helpNeal Norwitz-1/+1
2002-08-02Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond-1/+1
for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
2002-07-17staticforward bites the dust.Jeremy Hylton-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.
2002-06-13Patch #568124: Add doc string macros.Martin v. Löwis-18/+18
2002-04-07Lock methods acquire() and locked() now return bools.Guido van Rossum-7/+7
2002-03-31Remove METH_OLDARGS:Neal Norwitz-11/+8
Convert METH_OLDARGS -> METH_VARARGS: also PyArg_Parse -> PyArg_ParseTuple Convert METH_OLDARGS -> METH_NOARGS: remove args parameter Please review. All tests pass, but some modules don't have tests. I spot checked various functions to try to make sure nothing broke.
2002-03-26Missed change METH_OLDARGS to METH_NOARGS for two aliased functionsNeal Norwitz-2/+2
2002-03-25Missed change METH_OLDARGS to METH_NOARGS for two aliased functionsNeal Norwitz-2/+2
2002-03-25Remove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS.Neal Norwitz-22/+10
2001-12-08Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum-1/+1
type.__module__ behavior. This adds the module name and a dot in front of the type name in every type object initializer, except for built-in types (and those that already had this). Note that it touches lots of Mac modules -- I have no way to test these but the changes look right. Apologies if they're not. This also touches the weakref docs, which contains a sample type object initializer. It also touches the mmap test output, because the mmap type's repr is included in that output. It touches object.h to put the correct description in a comment.
2001-10-16Partial patch from SF #452266, by Jason Petrone.Guido van Rossum-9/+10
This changes Pythread_start_thread() to return the thread ID, or -1 for an error. (It's technically an incompatible API change, but I doubt anyone calls it.)
2001-10-05Fix typo in docstringAndrew M. Kuchling-1/+1