mirror of https://git.kore.io/kore.git
Add aqcuire() and release() to pylock.
This allows it to be used from code without requiring the async with context manager approach.
This commit is contained in:
parent
c3b2a8b2a2
commit
06fd5ca2f2
|
@ -359,6 +359,8 @@ static PyObject *pylock_aexit(struct pylock *, PyObject *);
|
|||
static PyObject *pylock_aenter(struct pylock *, PyObject *);
|
||||
|
||||
static PyMethodDef pylock_methods[] = {
|
||||
METHOD("aqcuire", pylock_aenter, METH_NOARGS),
|
||||
METHOD("release", pylock_aexit, METH_NOARGS),
|
||||
METHOD("__aexit__", pylock_aexit, METH_VARARGS),
|
||||
METHOD("__aenter__", pylock_aenter, METH_NOARGS),
|
||||
METHOD(NULL, NULL, -1)
|
||||
|
|
Loading…
Reference in New Issue