From 06fd5ca2f25728687abe0f497780cf28a56bc039 Mon Sep 17 00:00:00 2001 From: Joris Vink Date: Fri, 20 Sep 2019 09:56:21 +0200 Subject: [PATCH] Add aqcuire() and release() to pylock. This allows it to be used from code without requiring the async with context manager approach. --- include/kore/python_methods.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/kore/python_methods.h b/include/kore/python_methods.h index c13db03..cf2521d 100644 --- a/include/kore/python_methods.h +++ b/include/kore/python_methods.h @@ -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)