| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Introduce a configure check for strsignal(3) which defines HAVE_STRSIGNAL for
signalmodule.c. Add some common signals on HP-UX. This change applies for
Windows and HP-UX.
|
| |
|
|
|
|
|
|
|
|
|
| |
* Expose the sigset_t converter via private API _Py_Sigset_Converter().
* Use Argument Clinic for parsing sigset_t in signalmodule.c.
* Raise ValueError instead OverflowError for integers out of
the C long range.
Based on patch by Pablo Galindo Salgado.
|
| |
|
|
|
|
|
|
|
| |
Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some
reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom
is commonly used to select all signals for blocking with `pthread_sigmask`.
So we ignore the sigaddset() return value until we expose sigfillset()
to provide a better idiom.
|
|
|
| |
Co-authored-by: Vajrasky Kok <sky.kok@speaklikeaking.com>
|
| |
|
|
|
| |
Bug report and patch by Jeroen Demeyer.
|
|
|
|
|
|
| |
The _PyTime API handles detects overflow and is well tested.
Document that the signal will only be sent once if internal is equal
to zero.
|
|
|
|
|
|
| |
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Improve signal delivery
Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions.
* Remove unused function
* Improve comments
* Use _Py_atomic API for concurrency-sensitive signal state
* Add blurb
|
|
|
|
|
|
| |
* bpo-30807: signal.setitimer() may disable the timer by mistake
* Add NEWS blurb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Improve signal delivery
Avoid using Py_AddPendingCall from signal handler, to avoid calling signal-unsafe functions.
* Remove unused function
* Improve comments
* Add stress test
* Adapt for --without-threads
* Add second stress test
* Add NEWS blurb
* Address comments @haypo
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-16500: Allow registering at-fork handlers
* Address Serhiy's comments
* Add doc for new C API
* Add doc for new Python-facing function
* Add NEWS entry + doc nit
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before, it was possible to get the following sequence of
events (especially on Windows, where the C-level signal handler for
SIGINT is run in a separate thread):
- SIGINT arrives
- trip_signal is called
- trip_signal writes to the wakeup fd
- the main thread wakes up from select()-or-equivalent
- the main thread checks for pending signals, but doesn't see any
- the main thread drains the wakeup fd
- the main thread goes back to sleep
- trip_signal sets is_tripped=1 and calls Py_AddPendingCall to notify
the main thread the it should run the Python-level signal handler
- the main thread doesn't notice because it's asleep
This has been causing repeated failures in the Trio test suite:
https://github.com/python-trio/trio/issues/119
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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().
|
|
|
|
|
|
|
| |
Patch by Masayuki Yamamoto, reviewed and rebased by Erik Bray.
This is a first step on the long road toward resupporting Cygwin, which does
not provide siginfo_t.si_band.
|
|\ |
|
| |
| |
| |
| |
| | |
Also update the classmethod and staticmethod doc strings and comments to
match the RST documentation.
|
| |
| |
| |
| |
| |
| |
| | |
The signal module was using old-style module initialization with
potential NULL dereferencing.
CID 1295026
|
| | |
|
|/ |
|
|
|
|
| |
generated by Argument Clinic. Patch by Petr Viktorin.
|
|
|
|
| |
in places where Py_DECREF was used.
|
| |
|
|
|
|
| |
macro Py_SETREF.
|
| |
|
| |
|
|
|
|
| |
signalmodule.c
|
|
|
|
|
|
|
|
|
| |
Retry:
* signal.sigtimedwait()
* threading.Lock.acquire()
* threading.RLock.acquire()
* time.sleep()
|
|
|
|
| |
Add _Py_fstat_noraise() function when a Python exception is not welcome.
|
|
|
|
|
| |
All these functions only accept positive timeouts, so this change has no effect
in practice.
|
|
|
|
|
| |
* Add _PyTime_AsTimespec()
* Add unit tests for _PyTime_AsTimespec()
|
|
|
|
|
|
|
|
|
|
| |
when interrupted by a signal not in the *sigset* parameter, if the signal
handler does not raise an exception. signal.sigtimedwait() recomputes the
timeout with a monotonic clock when it is retried.
Remove test_signal.test_sigwaitinfo_interrupted() because sigwaitinfo() doesn't
raise InterruptedError anymore if it is interrupted by a signal not in its
sigset parameter.
|
|
|
|
| |
the errno shim.
|
|
|
|
|
|
| |
Windows.
fstat() may fail with EOVERFLOW on files larger than 2 GB because the file size type is an signed 32-bit integer.
|
|
|
|
| |
Detect integer overflow on the file descriptor of the socket on 64-bit Python.
|
|
|
|
|
|
|
| |
- interpreter startup and shutdown code moved to a new
pylifecycle.c module
- Py_OptimizeFlag moved into the new module with the other
global flags
|
|
|
|
| |
descriptor is in blocking mode.
|
|
|
|
| |
A side effect is that Python depends to the WinSock library.
|
| |
|
| |
|
|
|
|
| |
ValueError on fstat() failure.
|
|\ |
|
|/ |
|
|
|
|
|
|
| |
aways from zero, instead of rounding towards zero.
It should make test_asyncio more reliable, especially test_timeout_rounding() test.
|
|\ |
|
| | |
|
| | |
|