summaryrefslogtreecommitdiffstats
path: root/Python/thread_pthread.h
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38852: Set thread stack size to 8 Mb for debug builds on android ↵xdegaye2019-12-081-0/+10
| | | | platforms (GH-17337)
* bpo-38068: Clean up gettimeofday configure logic. (GH-15775)Benjamin Peterson2019-09-101-8/+1
| | | Assume gettimeofday exists and takes two arguments.
* bpo-18049: Define THREAD_STACK_SIZE for AIX to pass default recursion limit ↵Michael Felt2019-08-031-0/+4
| | | | | | test (GH-15081) * Define THREAD_STACK_SIZE for AIX to pass default recursion limit test
* bpo-18049: Sync thread stack size to main thread size on macOS (GH-14748)Ronald Oussoren2019-08-011-1/+2
| | | | | | This changeset increases the default size of the stack for threads on macOS to the size of the stack of the main thread and reenables the relevant recursion test.
* bpo-37077: Add native thread ID (TID) for AIX (GH-13624)Michael Felt2019-06-131-2/+7
| | | | | | | This is the followup for issue36084 https://bugs.python.org/issue37077
* bpo-37160: Thread native ID NetBSD support (GH-13835)David Carlier2019-06-121-0/+5
|
* bpo-37087: Adding native ID support for OpenBSD (GH-13654)David Carlier2019-06-031-0/+5
|
* bpo-36084: Add native thread ID (TID) to threading.Thread (GH-13463)Jake Tesler2019-05-221-0/+26
| | | | Add native thread ID (TID) to threading.Thread objects (supported platforms: Windows, FreeBSD, Linux, macOS).
* Revert "bpo-36084: Add native thread ID to threading.Thread objects ↵Victor Stinner2019-05-211-27/+0
| | | | | (GH-11993)" (GH-13458) This reverts commit 4959c33d2555b89b494c678d99be81a65ee864b0.
* bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)Jake Tesler2019-05-121-0/+27
|
* 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
| |\ \ | | |/