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:
Joris Vink 2019-09-20 09:56:21 +02:00
parent c3b2a8b2a2
commit 06fd5ca2f2
1 changed files with 2 additions and 0 deletions

View File

@ -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)