MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / Lock

Method Lock

include/PyEventLoop.hh:266–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

264 struct Lock {
265 public:
266 explicit Lock() {
267 PyObject *asyncio = PyImport_ImportModule("asyncio");
268 _queueIsEmpty = PyObject_CallMethod(asyncio, "Event", NULL); // _queueIsEmpty = asyncio.Event()
269 Py_DECREF(asyncio);
270
271 // The flag should initially be set as the queue is initially empty
272 Py_XDECREF(PyObject_CallMethod(_queueIsEmpty, "set", NULL)); // _queueIsEmpty.set()
273 };
274 ~Lock() {
275 Py_DECREF(_queueIsEmpty);
276 }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected