summaryrefslogtreecommitdiff
path: root/Python/thread_pthread.h
AgeCommit message (Collapse)AuthorLines
2020-07-15Fix -Wstrict-prototypes warning in thread_pthread.h. (GH-21477)Miss Islington (bot)-1/+1
(cherry picked from commit ea62a4bd54421693ed6b24a1bbd18ebed3bdb8f8) Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-08-28bpo-18049: Define THREAD_STACK_SIZE for AIX to pass default recursion limit ↵Miss Islington (bot)-0/+4
test (GH-15081) * Define THREAD_STACK_SIZE for AIX to pass default recursion limit test (cherry picked from commit 9670ce76b83bde950020f8d89c4d27168aaaf912) Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2019-08-01bpo-18049: Sync thread stack size to main thread size on macOS (GH-14748)Miss Islington (bot)-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. (cherry picked from commit 1a057bab0f18d6ad843ce321d1d77a4819497ae4) Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2019-06-13bpo-37077: Add native thread ID (TID) for AIX (GH-13624)Miss Islington (bot)-2/+7
This is the followup for issue36084 https://bugs.python.org/issue37077 (cherry picked from commit d0eeb936d8daf05d7d89f6935e3f4c0dee49c5be) Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
2019-06-12bpo-37160: Thread native ID NetBSD support (GH-13835)Miss Islington (bot)-0/+5
(cherry picked from commit 5287022eeeb3c017d49fc8580b52e18377bf23f3) Co-authored-by: David Carlier <dcarlier@afilias.info>
2019-06-03bpo-37087: Adding native ID support for OpenBSD (GH-13654)David Carlier-0/+5
2019-05-22bpo-36084: Add native thread ID (TID) to threading.Thread (GH-13463)Jake Tesler-0/+26
Add native thread ID (TID) to threading.Thread objects (supported platforms: Windows, FreeBSD, Linux, macOS).
2019-05-21Revert "bpo-36084: Add native thread ID to threading.Thread objects ↵Victor Stinner-27/+0
(GH-11993)" (GH-13458) This reverts commit 4959c33d2555b89b494c678d99be81a65ee864b0.
2019-05-12bpo-36084: Add native thread ID to threading.Thread objects (GH-11993)Jake Tesler-0/+27
2019-05-06bpo-36594: Fix incorrect use of %p in format strings (GH-12769)Zackery Spytz-2/+2
In addition, fix some other minor violations of C99.
2019-05-04bpo-36475: Make PyThread_exit_thread with _Py_NO_RETURN (GH-13068)Victor Stinner-1/+1
2019-02-20bpo-12822: use monotonic clock for condvar if possible (GH-11723)Inada Naoki-19/+62
2018-11-30bpo-33015: Fix UB in pthread PyThread_start_new_thread (GH-6008)Siddhesh Poyarekar-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.
2018-11-01bpo-35081: Add _PyThreadState_GET() internal macro (GH-10266)Victor Stinner-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.
2018-01-22bpo-32593: Drop FreeBSD 9 and older support (#5232)Victor Stinner-10/+0
Drop support of FreeBSD 9 and older.
2017-11-08Replace KB unit with KiB (#4293)Victor Stinner-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.
2017-10-24bpo-30768: Recompute timeout on interrupted lock (GH-4103)Victor Stinner-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.
2017-10-06bpo-25658: Implement PEP 539 for Thread Specific Storage (TSS) API (GH-1362)Masayuki Yamamoto-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
2017-09-28remove support for BSD/OS (closes bpo-31624) (#3812)Benjamin Peterson-21/+0
2017-09-07bpo-30860: Consolidate stateful runtime globals. (#3397)Eric Snow-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).
2017-09-05Revert "bpo-30860: Consolidate stateful runtime globals." (#3379)Eric Snow-5/+4
Windows buildbots started failing due to include-related errors.
2017-09-05bpo-30860: Consolidate stateful runtime globals. (#2594)Eric Snow-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).
2017-07-03bpo-30832: Remove own implementation for thread-local storage (#2537)Masayuki Yamamoto-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
2017-06-26bpo-30765: Avoid blocking when PyThread_acquire_lock() is asked not to (#2403)Antoine Pitrou-43/+48
* 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
2017-03-23bpo-6532: Make the thread id an unsigned integer. (#781)Serhiy Storchaka-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().
2017-03-21bpo-29859: Fix error messages from return codes for pthread_* calls (GH-741)Daniel Birnstiel-11/+13
2014-08-17Issue #22206: Using pthread, PyThread_create_key() now sets errno to ENOMEM andVictor Stinner-1/+9
returns -1 (error) on integer overflow.
2013-12-13Issue #19787: PyThread_set_key_value() now always set the valueVictor Stinner-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.
2013-12-13Backout changeset 46393019b650Victor Stinner-0/+3
test_capi is failing and the fix is not trivial, I prefer to revert
2013-12-13Close #19787: PyThread_set_key_value() now always set the value. In Python 3.3,Victor Stinner-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.
2013-07-07Issue #18203: Replace malloc() with PyMem_RawMalloc() to allocate thread locksVictor Stinner-6/+6
2013-06-18Issue #18256: Compilation fix for recent AIX releases. Patch by David Edelsohn.Antoine Pitrou-0/+3
2012-12-02Issue #16588: Silence unused-but-set warnings in Python/thread_pthread.hChristian Heimes-0/+3
2012-12-02Issue #16588: Silence unused-but-set warnings in Python/thread_pthread.hChristian Heimes-0/+3
2012-06-05Signal condition variables with the mutex held. Destroy condition variablesKristján Valur Jónsson-6/+9
before their mutexes.
2012-03-13Issue #14184: mergeNed Deily-8/+12
2012-03-13Issue #14184: Increase the default stack size for secondary threads onNed Deily-8/+12
Mac OS X to prevent interpreter crashes when compiled on 10.7.
2011-07-04Issue #12469: partial revert of 024827a9db64, freebsd6 thread initializationVictor Stinner-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
2011-06-24Issue #12392: fix thread initialization on FreeBSD 6Victor Stinner-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.
2011-05-28Issue #9670: Increase the default stack size for secondary threads onNed Deily-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)
2011-05-28Issue #9670: Increase the default stack size for secondary threads onNed Deily-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)
2011-05-28Issue #9670: Increase the default stack size for secondary threads onNed Deily-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)
2011-05-04Issue #1856: Avoid crashes and lockups when daemon threads run while theAntoine Pitrou-2/+2
interpreter is shutting down; instead, these threads are now killed when they try to take the GIL.
2011-05-04Issue #1856: Avoid crashes and lockups when daemon threads run while theAntoine Pitrou-2/+2
interpreter is shutting down; instead, these threads are now killed when they try to take the GIL.
2011-04-09Issue9670: Merge backout from 3.2.Ned Deily-12/+0
2011-04-09Issue9670: Merge backout to 3.2.Ned Deily-12/+0
2011-04-09Issue9670: Back out changeset 378b40d71175; test fails on other platformsNed Deily-12/+0
and on OS X with pydebug.
2011-04-09Issue #9670: merge with currentNed Deily-0/+12
2011-04-09Issue #9670: merge with 3.2Ned Deily-0/+12
2011-04-09Issue #9670: Increase the default stack size for secondary threads onNed Deily-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)