Message413162
> Wrap everything needed in a custom C function.
Maybe add an `acquire_and_release()` method:
static PyObject *
lock_PyThread_acquire_and_release_lock(
lockobject *self, PyObject *args, PyObject *kwds)
{
_PyTime_t timeout;
if (lock_acquire_parse_args(args, kwds, &timeout) < 0)
return NULL;
PyLockStatus r = acquire_timed(self->lock_lock, timeout);
if (r == PY_LOCK_INTR) {
return NULL;
}
if (r == PY_LOCK_ACQUIRED) {
PyThread_release_lock(self->lock_lock);
self->locked = 0;
}
return PyBool_FromLong(r == PY_LOCK_ACQUIRED);
} |
|
| Date |
User |
Action |
Args |
| 2022-02-13 03:10:06 | eryksun | set | recipients:
+ eryksun, tim.peters, pitrou, vstinner, serhiy.storchaka, Kevin Shweh, bjs, SnoopJeDi |
| 2022-02-13 03:10:06 | eryksun | set | messageid: <[email protected]> |
| 2022-02-13 03:10:06 | eryksun | link | issue46726 messages |
| 2022-02-13 03:10:06 | eryksun | create | |
|