summaryrefslogtreecommitdiff
path: root/Modules/_threadmodule.c
AgeCommit message (Collapse)AuthorLines
2016-08-30Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger-1/+1
2016-05-02Issue #18916: Update thread module docstringsBerker Peksag-3/+4
* Fix acquire() signature * Remove outdated help(LockType) reference * Replace PyThread_allocate_lock() with threading.Lock() Patch by Christopher Welborn.
2015-05-30Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),Serhiy Storchaka-6/+12
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly.
2015-05-30Issue #24115: Update uses of PyObject_IsTrue(), PyObject_Not(),Serhiy Storchaka-6/+12
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains() to check for and handle errors correctly.
2015-04-03Issue #22117: Add a new _PyTime_FromSeconds() functionVictor Stinner-1/+1
Fix also _Py_InitializeEx_Private(): initialize time before initializing import, import_init() uses the _PyTime API (for thread locks).
2015-03-30PEP 475: on EINTR, retry the function even if the timeout is equals to zeroVictor Stinner-1/+1
Retry: * signal.sigtimedwait() * threading.Lock.acquire() * threading.RLock.acquire() * time.sleep()
2015-03-30Issue #22117: Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILINGVictor Stinner-3/+4
All these functions only accept positive timeouts, so this change has no effect in practice.
2015-03-28Issue #22117: The thread module uses the new _PyTime_t timestamp APIVictor Stinner-75/+64
Add also a new _PyTime_AsMicroseconds() function. threading.TIMEOUT_MAX is now be smaller: only 292 years instead of 292,271 years on 64-bit system for example. Sorry, your threads will hang a *little bit* shorter. Call me if you want to ensure that your locks wait longer, I can share some tricks with you.
2014-09-02Issue #22043: time.monotonic() is now always availableVictor Stinner-2/+2
threading.Lock.acquire(), threading.RLock.acquire() and socket operations now use a monotonic clock, instead of the system clock, when a timeout is used.
2014-05-25Issue 21137: Better repr for threading.Lock()Raymond Hettinger-3/+12
2014-01-02threading.RLock._acquire_restore() now raises a TypeError instead of aVictor Stinner-3/+3
SystemError when it is not called with 2 arguments
2013-11-07Issue #19512, #19515: remove shared identifiers, move identifiers where theyVictor Stinner-1/+3
are used. Move also _Py_IDENTIFIER() defintions to the top in modified files to remove identifiers duplicated in the same file.
2013-11-06Issue #19512: add some common identifiers to only create common strings once,Victor Stinner-1/+1
instead of creating temporary Unicode string objects Add also more identifiers in pythonrun.c to avoid temporary Unicode string objets for the interactive interpreter.
2013-11-05Issue #19437: Fix _threading.RLock constructor (rlock_new), callVictor Stinner-10/+14
Py_DECREF(self) if PyThread_allocate_lock() failed instead of calling directly type->tp_free(self), to keep the chained list of objects consistent when Python is compiled in debug mode fails, don't consume the row (restore it) and fail immediatly (don't call pysqlite_step())
2013-09-07Issue #18808: Thread.join() now waits for the underlying thread state to be ↵Antoine Pitrou-0/+62
destroyed before returning. This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
2013-02-04merge #17091: update docstring for _thread.Lock.acquire.R David Murray-2/+2
2013-02-04merge #17091: update docstring for _thread.Lock.acquire.R David Murray-2/+2
2013-02-04#17091: update docstring for _thread.Lock.acquire.R David Murray-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.
2012-12-25Issue #15422: get rid of PyCFunction_New macroAndrew Svetlov-1/+1
2012-06-22Issue #15124: Optimize _thread.LockType deletion and acquisition whenKristjan Valur Jonsson-21/+17
not contested, similar to what _thread.RLock already has.
2012-04-02merge 3.2Benjamin Peterson-0/+3
2012-04-02prevent writing to stderr from messing up the exception state (closes #14474)Benjamin Peterson-0/+3
2011-06-01Merge 3.2Éric Araujo-1/+1
2011-05-31Fix error message to use the Python name instead of the C nameÉric Araujo-1/+1
2011-04-30Issue #11223: Replace threading._info() by sys.thread_infoVictor Stinner-13/+0
2011-04-24Issue #11915: threading.RLock()._release_save() raises a RuntimeError if theVictor Stinner-0/+6
lock was not acquired.
2011-04-19Issue #11223: Add threading._info() function providing informations about theVictor Stinner-7/+17
thread implementation. Skip test_lock_acquire_interruption() and test_rlock_acquire_interruption() of test_threadsignals if a thread lock is implemented using a POSIX mutex and a POSIX condition variable. A POSIX condition variable cannot be interrupted by a signal (e.g. on Linux, the futex system call is restarted).
2011-03-15#11515: Merge with 3.1.Ezio Melotti-1/+1
2011-03-15#11515: fix several typos. Patch by Piotr Kasprzyk.Ezio Melotti-1/+1
2011-03-15#11515: Merge with 3.2.Ezio Melotti-1/+1
2011-03-06Issue #11408: In threading.Lock.acquire(), only call gettimeofday() whenAntoine Pitrou-2/+2
really necessary. Patch by Charles-François Natali.
2011-02-28Issue #11140: Lock.release() now raises a RuntimeError when attemptingAntoine Pitrou-1/+3
to release an unacquired lock, as claimed in the threading documentation. The _thread.error exception is now an alias of RuntimeError.
2011-02-22Issue #8914: fix various warnings from the Clang static analyzer v254.Brett Cannon-1/+2
2010-12-15Issue #8844: Regular and recursive lock acquisitions can now be interruptedAntoine Pitrou-13/+67
by signals on platforms using pthreads. Patch by Reid Kleckner.
2010-08-28Merged revisions 84344 via svnmerge fromAntoine Pitrou-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. ........
2010-08-28Issue #1868: Eliminate subtle timing issues in thread-local objects byAntoine Pitrou-43/+38
getting rid of the cached copy of thread-local attribute dictionary.
2010-08-16Merged revisions 84106 via svnmerge fromAlexander Belopolsky-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. ........
2010-08-16Issue #8983: Corrected docstrings.Alexander Belopolsky-1/+1
2010-08-09Merged revisions 83918 via svnmerge fromAntoine Pitrou-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. ........
2010-08-09Issue #3757: thread-local objects now support cyclic garbage collection.Antoine Pitrou-45/+224
Thread-local objects involved in reference cycles will be deallocated timely by the cyclic GC, even if the underlying thread is still running.
2010-05-09Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou-444/+444
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81032 | antoine.pitrou | 2010-05-09 17:52:27 +0200 (dim., 09 mai 2010) | 9 lines Recorded merge of revisions 81029 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........ ................
2010-05-09Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou-672/+672
svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
2010-04-14Issue #7316: the acquire() method of lock objects in the :mod:`threading`Antoine Pitrou-14/+75
module now takes an optional timeout argument in seconds. Timeout support relies on the system threading library, so as to avoid a semi-busy wait loop.
2010-03-03Merged revisions 78639 via svnmerge fromVictor Stinner-2/+10
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78639 | victor.stinner | 2010-03-04 00:28:07 +0100 (jeu., 04 mars 2010) | 10 lines Merged revisions 78638 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78638 | victor.stinner | 2010-03-04 00:20:25 +0100 (jeu., 04 mars 2010) | 3 lines Issue #7544: Preallocate thread memory before creating the thread to avoid a fatal error in low memory condition. ........ ................
2010-03-03Merged revisions 78638 via svnmerge fromVictor Stinner-2/+10
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78638 | victor.stinner | 2010-03-04 00:20:25 +0100 (jeu., 04 mars 2010) | 3 lines Issue #7544: Preallocate thread memory before creating the thread to avoid a fatal error in low memory condition. ........
2010-03-03Merged revisions 78611 via svnmerge fromVictor Stinner-8/+9
svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r78611 | victor.stinner | 2010-03-03 01:50:12 +0100 (mer., 03 mars 2010) | 10 lines Merged revisions 78610 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78610 | victor.stinner | 2010-03-03 01:43:44 +0100 (mer., 03 mars 2010) | 3 lines Issue #3299: fix thread.allocate_lock() error handler, replace PyObject_Del() by Py_DECREF() to fix a crash in pydebug mode. ........ ................
2010-03-03Merged revisions 78610 via svnmerge fromVictor Stinner-8/+9
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78610 | victor.stinner | 2010-03-03 01:43:44 +0100 (mer., 03 mars 2010) | 3 lines Issue #3299: fix thread.allocate_lock() error handler, replace PyObject_Del() by Py_DECREF() to fix a crash in pydebug mode. ........
2010-02-24Merged revisions 78393 via svnmerge fromAmaury Forgeot d'Arc-16/+0
svn+ssh://pythondev@svn.python.org/python/trunk ........ r78393 | amaury.forgeotdarc | 2010-02-24 00:19:39 +0100 (mer., 24 févr. 2010) | 2 lines #4852: Remove dead code in every thread implementation, unused for many years. ........
2009-11-10Issue #3001: Add a C implementation of recursive locks which is used byAntoine Pitrou-0/+273
default when instantiating a `Threading.RLock` object. This makes recursive locks as fast as regular non-recursive locks (previously, they were slower by 10x to 15x).
2009-10-30Merged revisions 75969 via svnmerge fromAntoine Pitrou-2/+8
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75969 | antoine.pitrou | 2009-10-30 23:19:09 +0100 (ven., 30 oct. 2009) | 5 lines Remove official documentation entry for thread._count() and make the docstring more descriptive instead. ........