Eric Snow
2ebc5ce42a
bpo-30860: Consolidate stateful runtime globals. ( #3397 )
* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals
Other globals are excluded (see globals.txt and check-c-globals.py).
9 years ago
Antoine Pitrou
a6a4dc816d
bpo-31370: Remove support for threads-less builds ( #3385 )
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
9 years ago
Eric Snow
05351c1bd8
Revert "bpo-30860: Consolidate stateful runtime globals." ( #3379 )
Windows buildbots started failing due to include-related errors.
9 years ago
Eric Snow
76d5abc868
bpo-30860: Consolidate stateful runtime globals. ( #2594 )
* group the (stateful) runtime globals into various topical structs
* consolidate the topical structs under a single top-level _PyRuntimeState struct
* add a check-c-globals.py script that helps identify runtime globals
Other globals are excluded (see globals.txt and check-c-globals.py).
9 years ago
Serhiy Storchaka
aefa7ebf0f
bpo-6532: Make the thread id an unsigned integer. ( #781 )
* bpo-6532: Make the thread id an unsigned integer.
From C API side the type of results of PyThread_start_new_thread() and
PyThread_get_thread_ident(), the id parameter of
PyThreadState_SetAsyncExc(), and the thread_id field of PyThreadState
changed from "long" to "unsigned long".
* Restore a check in thread_get_ident().
9 years ago
INADA Naoki
72dccde884
bpo-29548: Fix some inefficient call API usage (GH-97)
9 years ago
Serhiy Storchaka
228b12edcc
Issue #28999 : Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE wherever
possible. Patch is writen with Coccinelle.
9 years ago
Martin Panter
0be894b2f6
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
10 years ago
Raymond Hettinger
15f44ab043
Issue #27895 : Spelling fixes (Contributed by Ville Skyttä).
10 years ago
Berker Peksag
720e65541c
Issue #18916 : Update thread module docstrings
* Fix acquire() signature
* Remove outdated help(LockType) reference
* Replace PyThread_allocate_lock() with threading.Lock()
Patch by Christopher Welborn.
10 years ago
Serhiy Storchaka
fa494fd883
Issue #24115 : Update uses of PyObject_IsTrue(), PyObject_Not(),
PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
to check for and handle errors correctly.
11 years ago
Victor Stinner
13019fdef3
Issue #22117 : Add a new _PyTime_FromSeconds() function
Fix also _Py_InitializeEx_Private(): initialize time before initializing
import, import_init() uses the _PyTime API (for thread locks).
11 years ago
Victor Stinner
6aa446cf03
PEP 475: on EINTR, retry the function even if the timeout is equals to zero
Retry:
* signal.sigtimedwait()
* threading.Lock.acquire()
* threading.RLock.acquire()
* time.sleep()
11 years ago
Victor Stinner
869e1778c0
Issue #22117 : Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILING
All these functions only accept positive timeouts, so this change has no effect
in practice.
11 years ago
Victor Stinner
f5faad2bf0
Issue #22117 : The thread module uses the new _PyTime_t timestamp API
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.
11 years ago
Victor Stinner
ae58649721
Issue #22043 : time.monotonic() is now always available
threading.Lock.acquire(), threading.RLock.acquire() and socket operations now
use a monotonic clock, instead of the system clock, when a timeout is used.
12 years ago
Raymond Hettinger
62f4dad816
Issue 21137: Better repr for threading.Lock()
12 years ago
Victor Stinner
e8794526db
threading.RLock._acquire_restore() now raises a TypeError instead of a
SystemError when it is not called with 2 arguments
12 years ago
Victor Stinner
bd303c165b
Issue #19512 , #19515 : remove shared identifiers, move identifiers where they
are used.
Move also _Py_IDENTIFIER() defintions to the top in modified files to remove
identifiers duplicated in the same file.
13 years ago
Victor Stinner
090543736f
Issue #19512 : add some common identifiers to only create common strings once,
instead of creating temporary Unicode string objects
Add also more identifiers in pythonrun.c to avoid temporary Unicode string
objets for the interactive interpreter.
13 years ago
Victor Stinner
357f5155dc
Issue #19437 : Fix _threading.RLock constructor (rlock_new), call
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())
13 years ago
Antoine Pitrou
7b4769937f
Issue #18808 : Thread.join() now waits for the underlying thread state to be destroyed before returning.
This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
13 years ago
R David Murray
95b7110a11
#17091 : update docstring for _thread.Lock.acquire.
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.
13 years ago
Andrew Svetlov
3ba3a3ee56
Issue #15422 : get rid of PyCFunction_New macro
13 years ago
Kristjan Valur Jonsson
69cf913ba1
Issue #15124 : Optimize _thread.LockType deletion and acquisition when
not contested, similar to what _thread.RLock already has.
14 years ago
Benjamin Peterson
e900096dc4
prevent writing to stderr from messing up the exception state ( closes #14474 )
14 years ago
Éric Araujo
9bcf8bfb24
Fix error message to use the Python name instead of the C name
15 years ago
Victor Stinner
d5c355ccc7
Issue #11223 : Replace threading._info() by sys.thread_info
15 years ago
Victor Stinner
c2824d41c3
Issue #11915 : threading.RLock()._release_save() raises a RuntimeError if the
lock was not acquired.
15 years ago
Victor Stinner
754851f456
Issue #11223 : Add threading._info() function providing informations about the
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).
15 years ago
Ezio Melotti
42da663e6f
#11515 : fix several typos. Patch by Piotr Kasprzyk.
15 years ago
Antoine Pitrou
125d5c8770
Issue #11408 : In threading.Lock.acquire(), only call gettimeofday() when
really necessary. Patch by Charles-François Natali.
15 years ago
Antoine Pitrou
fcf81fd031
Issue #11140 : Lock.release() now raises a RuntimeError when attempting
to release an unacquired lock, as claimed in the threading documentation.
The _thread.error exception is now an alias of RuntimeError.
15 years ago
Brett Cannon
b94767ff44
Issue #8914 : fix various warnings from the Clang static analyzer v254.
15 years ago
Antoine Pitrou
810023db3e
Issue #8844 : Regular and recursive lock acquisitions can now be interrupted
by signals on platforms using pthreads. Patch by Reid Kleckner.
15 years ago
Antoine Pitrou
fcd2a7960c
Merged revisions 84344 via svnmerge from
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.
........
16 years ago
Antoine Pitrou
1a9a9d5433
Issue #1868 : Eliminate subtle timing issues in thread-local objects by
getting rid of the cached copy of thread-local attribute dictionary.
16 years ago
Alexander Belopolsky
102594f7ff
Merged revisions 84106 via svnmerge from
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.
........
16 years ago
Alexander Belopolsky
977a684c94
Issue #8983 : Corrected docstrings.
16 years ago
Antoine Pitrou
87d5260362
Merged revisions 83918 via svnmerge from
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.
........
16 years ago
Antoine Pitrou
5af4f4b983
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.
16 years ago
Antoine Pitrou
7f14f0d8a0
Recorded merge of revisions 81032 via svnmerge from
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.
........
................
16 years ago
Antoine Pitrou
f95a1b3c53
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.
........
16 years ago
Antoine Pitrou
7c3e577395
Issue #7316 : the acquire() method of lock objects in the :mod:`threading`
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.
16 years ago
Victor Stinner
ef32bc8569
Merged revisions 78639 via svnmerge from
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.
........
................
16 years ago
Victor Stinner
45b9be52de
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.
........
16 years ago
Victor Stinner
5774043795
Merged revisions 78611 via svnmerge from
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.
........
................
16 years ago
Victor Stinner
8f3216a069
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.
........
16 years ago
Amaury Forgeot d'Arc
72aee3dcab
Merged revisions 78393 via svnmerge from
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.
........
16 years ago
Antoine Pitrou
434736a1a6
Issue #3001 : Add a C implementation of recursive locks which is used by
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).
17 years ago