summaryrefslogtreecommitdiffstats
path: root/Modules/threadmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* #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
|
* Lock methods acquire() and locked() now return bools.Guido van Rossum2002-04-071-7/+7
|
* Remove METH_OLDARGS:Neal Norwitz2002-03-311-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.
* Missed change METH_OLDARGS to METH_NOARGS for two aliased functionsNeal Norwitz2002-03-261-2/+2
|
* Missed change METH_OLDARGS to METH_NOARGS for two aliased functionsNeal Norwitz2002-03-251-2/+2
|
* Remove many uses of PyArg_NoArgs macro, change METH_OLDARGS to METH_NOARGS.Neal Norwitz2002-03-251-22/+10
|
* Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum2001-12-081-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.
* Partial patch from SF #452266, by Jason Petrone.Guido van Rossum2001-10-161-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.)
* Fix typo in docstringAndrew M. Kuchling2001-10-051-1/+1
|
* Use PyThreadState_DeleteCurrent() instead of PyThreadState_Delete()Guido van Rossum2001-01-231-2/+1
| | | | | | | and PyEval_ReleaseThread(). This fixes SF bug #125673 PyThreadState_Delete: invalid tstate (Unix only?).
* t_bootstram(): Use PySys_WriteStderr() instead of fprintf(stderr,...).Fred Drake2000-10-201-1/+1
| | | | This closes bug #117324.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* The second argument to start_new_thread() is not a tuple, as pointedGuido van Rossum2000-09-011-2/+2
| | | | out by Curtis Jensen on c.l.py and forwarded by Fredrik Lundh.
* Use METH_OLDARGS instead of numeric constant 0 in method def. tablesAndrew M. Kuchling2000-08-031-16/+22
|
* Use METH_VARARGS instead of numeric constant 1 in method def. tablesAndrew M. Kuchling2000-08-031-2/+4
|
* Bunch of minor ANSIfications: 'void initfunc()' -> 'void initfunc(void)',Thomas Wouters2000-07-211-2/+2
| | | | | | | | | | | | | | | | | | and a couple of functions that were missed in the previous batches. Not terribly tested, but very carefully scrutinized, three times. All these were found by the little findkrc.py that I posted to python-dev, which means there might be more lurking. Cases such as this: long func(a, b) long a; long b; /* flagword */ { and other cases where the last ; in the argument list isn't followed by a newline and an opening curly bracket. Regexps to catch all are welcome, of course ;)
* ANSI-ficationPeter Schneider-Kamp2000-07-101-31/+11
|
* Change copyright notice - 2nd try.Guido van Rossum2000-06-301-6/+0
|