mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-84570: Send-Wait Fixes for _xxinterpchannels (gh-111006)
There were a few things I did in gh-110565 that need to be fixed. I also forgot to add tests in that PR. (Note that this PR exposes a refleak introduced by gh-110246. I'll take care of that separately.)
This commit is contained in:
parent
e37620edfd
commit
a53d7cb672
5 changed files with 576 additions and 153 deletions
|
@ -86,6 +86,21 @@ extern int _PyThread_at_fork_reinit(PyThread_type_lock *lock);
|
|||
#endif /* HAVE_FORK */
|
||||
|
||||
|
||||
// unset: -1 seconds, in nanoseconds
|
||||
#define PyThread_UNSET_TIMEOUT ((_PyTime_t)(-1 * 1000 * 1000 * 1000))
|
||||
|
||||
/* Helper to acquire an interruptible lock with a timeout. If the lock acquire
|
||||
* is interrupted, signal handlers are run, and if they raise an exception,
|
||||
* PY_LOCK_INTR is returned. Otherwise, PY_LOCK_ACQUIRED or PY_LOCK_FAILURE
|
||||
* are returned, depending on whether the lock can be acquired within the
|
||||
* timeout.
|
||||
*/
|
||||
// Exported for the _xxinterpchannels module.
|
||||
PyAPI_FUNC(PyLockStatus) PyThread_acquire_lock_timed_with_retries(
|
||||
PyThread_type_lock,
|
||||
PY_TIMEOUT_T microseconds);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue