summaryrefslogtreecommitdiffstats
path: root/Python/thread_pthread.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36594: Fix incorrect use of %p in format strings (GH-12769)Zackery Spytz2019-05-061-2/+2
| | | In addition, fix some other minor violations of C99.
* bpo-36475: Make PyThread_exit_thread with _Py_NO_RETURN (GH-13068)Victor Stinner2019-05-041-1/+1
|
* bpo-12822: use monotonic clock for condvar if possible (GH-11723)Inada Naoki2019-02-201-19/+62
|
* bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008)Siddhesh Poyarekar2018-11-301-4/+36
| | | | | | | Fix an undefined behaviour in the pthread implementation of PyThread_start_new_thread(): add a function wrapper to always return NULL. Add pythread_callback struct and pythread_wrapper() to thread_pthread.h.
* bpo-35081: Add _PyThreadState_GET() internal macro (GH-10266)Victor Stinner2018-11-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | If Py_BUILD_CORE is defined, the PyThreadState_GET() macro access _PyRuntime which comes from the internal pycore_state.h header. Public headers must not require internal headers. Move PyThreadState_GET() and _PyInterpreterState_GET_UNSAFE() from Include/pystate.h to Include/internal/pycore_state.h, and rename PyThreadState_GET() to _PyThreadState_GET() there. The PyThreadState_GET() macro of pystate.h is now redefined when pycore_state.h is included, to use the fast _PyThreadState_GET(). Changes: * Add _PyThreadState_GET() macro * Replace "PyThreadState_GET()->interp" with _PyInterpreterState_GET_UNSAFE() * Replace PyThreadState_GET() with _PyThreadState_GET() in internal C files (compiled with Py_BUILD_CORE defined), but keep PyThreadState_GET() in the public header files. * _testcapimodule.c: replace PyThreadState_GET() with PyThreadState_Get(); the module is not compiled with Py_BUILD_CORE defined. * pycore_state.h now requires Py_BUILD_CORE to be defined.
* bpo-32593: Drop FreeBSD 9 and older support (#5232)Victor Stinner2018-01-221-10/+0
| | | Drop support of FreeBSD 9 and older.
* Replace KB unit with KiB (#4293)Victor Stinner2017-11-081-1/+1
| | | | | | | | | | | kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte") means 1024 bytes. KB was misused: replace kB or KB with KiB when appropriate. Same change for MB and GB which become MiB and GiB. Change the output of Tools/iobench/iobench.py. Round also the size of the documentation from 5.5 MB to 5 MiB.
* bpo-30768: Recompute timeout on interrupted lock (GH-4103)Victor Stinner2017-10-241-6/+49
| | | | | | | | | | | | | | | | Fix the pthread+semaphore implementation of PyThread_acquire_lock_timed() when called with timeout > 0 and intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a signal (EINTR). See also the PEP 475. The pthread implementation of PyThread_acquire_lock() now fails with a fatal error if the timeout is larger than PY_TIMEOUT_MAX, as done in the Windows implementation. The check prevents any risk of overflow in PyThread_acquire_lock(). Add also PY_DWORD_MAX constant.
* bpo-25658: Implement PEP 539 for Thread Specific Storage (TSS) API (GH-1362)Masayuki Yamamoto2017-10-061-3/+87
| | | | | | | | | See PEP 539 for details. Highlights of changes: - Add Thread Specific Storage (TSS) API - Document the Thread Local Storage (TLS) API as deprecated - Update code that used TLS API to use TSS API
* remove support for BSD/OS (closes bpo-31624) (#3812)Benjamin Peterson2017-09-291-21/+0
|
* bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow2017-09-081-4/+5
| | | | | | | * 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).
* Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)Eric Snow2017-09-061-5/+4
| | | Windows buildbots started failing due to include-related errors.
* bpo-30860: Consolidate stateful runtime globals. (#2594)Eric Snow2017-09-061-4/+5
| | | | | | | | | * 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).
* bpo-30832: Remove own implementation for thread-local storage (#2537)Masayuki Yamamoto2017-07-031-1/+0
| | | | | | | | | | | | | | | | * bpo-30832: Remove own implementation for thread-local storage CPython has provided the own implementation for thread-local storage (TLS) on Python/thread.c, it's used in the case which a platform has not supplied native TLS. However, currently all supported platforms (NT and pthreads) have provided native TLS and defined the Py_HAVE_NATIVE_TLS macro with unconditional in any case. * bpo-30832: replace NT with Windows * bpo-30832: change to directive chain * bpo-30832: remove comemnt which making no sense
* bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (#2403)Antoine Pitrou2017-06-261-45/+50
| | | | | | | | | | | * bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to lock This is especially important if PyThread_acquire_lock() is called reentrantly (for example from a signal handler). * Update 2017-06-26-14-29-50.bpo-30765.Q5iBmf.rst * Avoid core logic when taking the mutex failed
* bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka2017-03-231-9/+9
| | | | | | | | | | | * 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().
* bpo-29859: Fix error messages from return codes for pthread_* calls (GH-741)Daniel Birnstiel2017-03-211-11/+13
|
* Issue #22206: Using pthread, PyThread_create_key() now sets errno to ENOMEM andVictor Stinner2014-08-171-1/+9
| | | | returns -1 (error) on integer overflow.
* Issue #19787: PyThread_set_key_value() now always set the valueVictor Stinner2013-12-131-3/+0
| | | | | | | | | | In Python 3.3, PyThread_set_key_value() did nothing if the key already exists (if the current value is a non-NULL pointer). When _PyGILState_NoteThreadState() is called twice on the same thread with a different Python thread state, it still keeps the old Python thread state to keep the old behaviour. Replacing the Python thread state with the new state introduces new bugs: see issues #10915 and #15751.
* Backout changeset 46393019b650Victor Stinner2013-12-131-0/+3
| | | | test_capi is failing and the fix is not trivial, I prefer to revert
* Close #19787: PyThread_set_key_value() now always set the value. In Python 3.3,Victor Stinner2013-12-131-3/+0
| | | | | | | | the function did nothing if the key already exists (if the current value is a non-NULL pointer). _testcapi.run_in_subinterp() now correctly sets the new Python thread state of the current thread when a subinterpreter is created.
* Issue #18203: Replace malloc() with PyMem_RawMalloc() to allocate thread locksVictor Stinner2013-07-071-6/+6
|
* Issue #18256: Compilation fix for recent AIX releases. Patch by David Edelsohn.Antoine Pitrou2013-06-181-0/+3
|
* Issue #16588: Silence unused-but-set warnings in Python/thread_pthread.hChristian Heimes2012-12-021-0/+3
|\
| * Issue #16588: Silence unused-but-set warnings in Python/thread_pthread.hChristian Heimes2012-12-021-0/+3
| |
* | Signal condition variables with the mutex held. Destroy condition variablesKristján Valur Jónsson2012-06-051-6/+9
| | | | | | | | before their mutexes.
* | Issue #14184: mergeNed Deily2012-03-131-8/+12
|\ \ | |/
| * Issue #14184: Increase the default stack size for secondary threads onNed Deily2012-03-131-8/+12
| | | | | | | | Mac OS X to prevent interpreter crashes when compiled on 10.7.
* | Issue #12469: partial revert of 024827a9db64, freebsd6 thread initializationVictor Stinner2011-07-041-4/+1
| | | | | | | | | | | | | | * Don't create a thread at startup anymore to initialize the pthread library: it changes the behaviour of many functions related to signal handling like sigwait() * Reenable test_sigtimedwait_poll() on FreeBSD 6
* | Issue #12392: fix thread initialization on FreeBSD 6Victor Stinner2011-06-241-1/+4
| | | | | | | | | | | | | | | | On FreeBSD6, pthread_kill() doesn't work on the main thread before the creation of the first thread. Create therefore a dummy thread (no-op) a startup to initialize the pthread library. Add also a test for this use case, test written by Charles-François Natali.
* | Issue #9670: Increase the default stack size for secondary threads onNed Deily2011-05-281-0/+12
|\ \ | |/ | | | | | | | | Mac OS X and FreeBSD to reduce the chances of a crash instead of a "maximum recursion depth" RuntimeError exception. (patch by Ronald Oussoren)
| * Issue #9670: Increase the default stack size for secondary threads onNed Deily2011-05-281-0/+12
| |\ | | | | | | | | | | | | | | | Mac OS X and FreeBSD to reduce the chances of a crash instead of a "maximum recursion depth" RuntimeError exception. (patch by Ronald Oussoren)
| | * Issue #9670: Increase the default stack size for secondary threads onNed Deily2011-05-281-0/+12
| | | | | | | | | | | | | | | | | | Mac OS X and FreeBSD to reduce the chances of a crash instead of a "maximum recursion depth" RuntimeError exception. (patch by Ronald Oussoren)
* | | Issue #1856: Avoid crashes and lockups when daemon threads run while theAntoine Pitrou2011-05-041-2/+2
|\ \ \ | |/ / | | | | | | | | | interpreter is shutting down; instead, these threads are now killed when they try to take the GIL.
| * | Issue #1856: Avoid crashes and lockups when daemon threads run while theAntoine Pitrou2011-05-041-2/+2
| | | | | | | | | | | | | | | interpreter is shutting down; instead, these threads are now killed when they try to take the GIL.
* | | Issue9670: Merge backout from 3.2.Ned Deily2011-04-091-12/+0
|\ \ \ | |/ /
| * | Issue9670: Merge backout to 3.2.Ned Deily2011-04-091-12/+0
| |\ \ | | |/
| | * Issue9670: Back out changeset 378b40d71175; test fails on other platformsNed Deily2011-04-091-12/+0
| | | | | | | | | | | | and on OS X with pydebug.
* | | Issue #9670: merge with currentNed Deily2011-04-091-0/+12
|\ \ \ | |/ /
| * | Issue #9670: merge with 3.2Ned Deily2011-04-091-0/+12
| |\ \ | | |/
| | * Issue #9670: Increase the default stack size for secondary threads onNed Deily2011-04-091-0/+12
| | | | | | | | | | | | | | | | | | Mac OS X and FreeBSD to reduce the chances of a crash instead of a "maximum recursion depth" RuntimeError exception. (Patch by Ronald Oussoren)
| | * Recorded merge of revisions 81032 via svnmerge fromAntoine Pitrou2010-05-091-237/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........ ................
* | | Issue #11495: OSF support is eliminated. It was deprecated in Python 3.2Jesus Cea2011-03-141-7/+1
|/ /
* | Issue #8844: Regular and recursive lock acquisitions can now be interruptedAntoine Pitrou2010-12-151-45/+67
| | | | | | | | by signals on platforms using pthreads. Patch by Reid Kleckner.
* | Issue #10062: Allow building on platforms which do not have sem_timedwait.Antoine Pitrou2010-10-101-1/+2
| |
* | issue 9786 Native TLS support for pthreadsKristján Valur Jónsson2010-09-201-0/+43
| | | | | | | | PyThread_create_key now has a failure mode that the applicatino can detect.
* | Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-264/+264
| | | | | | | | | | | | | | | | | | | | 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. ........
* | Make (most of) Python's tests pass under Thread Sanitizer.Jeffrey Yasskin2010-05-031-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://code.google.com/p/data-race-test/wiki/ThreadSanitizer is a dynamic data race detector that runs on top of valgrind. With this patch, the binaries at http://code.google.com/p/data-race-test/wiki/ThreadSanitizer#Binaries pass many but not all of the Python tests. All of regrtest still passes outside of tsan. I've implemented part of the C1x atomic types so that we can explicitly mark variables that are used across threads, and get defined behavior as compilers advance. I've added tsan's client header and implementation to the codebase in dynamic_annotations.{h,c} (docs at http://code.google.com/p/data-race-test/wiki/DynamicAnnotations). Unfortunately, I haven't been able to get helgrind and drd to give sensible error messages, even when I use their client annotations, so I'm not supporting them.
* | Issue #7316: the acquire() method of lock objects in the :mod:`threading`Antoine Pitrou2010-04-141-20/+81
| | | | | | | | | | | | 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.
* | Merged revisions 78393 via svnmerge fromAmaury Forgeot d'Arc2010-02-241-43/+3
|/ | | | | | | | | | 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. ........