| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
platforms (GH-17337)
|
|
|
| |
Assume gettimeofday exists and takes two arguments.
|
|
|
|
|
|
| |
test (GH-15081)
* Define THREAD_STACK_SIZE for AIX to pass default recursion limit test
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
This is the followup for issue36084
https://bugs.python.org/issue37077
|
| |
|
| |
|
|
|
|
| |
Add native thread ID (TID) to threading.Thread objects
(supported platforms: Windows, FreeBSD, Linux, macOS).
|
|
|
|
|
| |
(GH-11993)" (GH-13458)
This reverts commit 4959c33d2555b89b494c678d99be81a65ee864b0.
|
| |
|
|
|
| |
In addition, fix some other minor violations of C99.
|
| |
|
| |
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
| |
Drop support of FreeBSD 9 and older.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
* 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).
|
|
|
| |
Windows buildbots started failing due to include-related errors.
|
|
|
|
|
|
|
|
|
| |
* 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
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 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.
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().
|
| |
|
|
|
|
| |
returns -1 (error) on integer overflow.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
test_capi is failing and the fix is not trivial, I prefer to revert
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| | |
before their mutexes.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Mac OS X to prevent interpreter crashes when compiled on 10.7.
|
| |
| |
| |
| |
| |
| |
| | |
* 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
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
|\ \
| |/
| |
| |
| |
| | |
Mac OS X and FreeBSD to reduce the chances of a crash instead of a
"maximum recursion depth" RuntimeError exception.
(patch by Ronald Oussoren)
|
| |\
| | |
| | |
| | |
| | |
| | | |
Mac OS X and FreeBSD to reduce the chances of a crash instead of a
"maximum recursion depth" RuntimeError exception.
(patch by Ronald Oussoren)
|
| | |
| | |
| | |
| | |
| | |
| | | |
Mac OS X and FreeBSD to reduce the chances of a crash instead of a
"maximum recursion depth" RuntimeError exception.
(patch by Ronald Oussoren)
|
|\ \ \
| |/ /
| | |
| | |
| | | |
interpreter is shutting down; instead, these threads are now killed when
they try to take the GIL.
|
| | |
| | |
| | |
| | |
| | | |
interpreter is shutting down; instead, these threads are now killed when
they try to take the GIL.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|
| | |
| | |
| | |
| | | |
and on OS X with pydebug.
|
|\ \ \
| |/ / |
|
| |\ \
| | |/ |
|