* @brief Wrapper to decrement the counter of queueing event-loop jobs after the job finishes */
| 17 | * @brief Wrapper to decrement the counter of queueing event-loop jobs after the job finishes |
| 18 | */ |
| 19 | static PyObject *eventLoopJobWrapper(PyObject *jobFn, PyObject *Py_UNUSED(_)) { |
| 20 | PyObject *ret = PyObject_CallObject(jobFn, NULL); |
| 21 | Py_XDECREF(ret); // don't care about its return value |
| 22 | |
| 23 | PyObject *type, *value, *traceback; |
| 24 | PyErr_Fetch(&type, &value, &traceback); // Protects `decCounter()`. If the error indicator is set, Python cannot make further function calls. |
| 25 | PyEventLoop::_locker->decCounter(); |
| 26 | PyErr_Restore(type, value, traceback); |
| 27 | |
| 28 | if (PyErr_Occurred()) { |
| 29 | return NULL; |
| 30 | } else { |
| 31 | Py_RETURN_NONE; |
| 32 | } |
| 33 | } |
| 34 | static PyMethodDef loopJobWrapperDef = {"eventLoopJobWrapper", eventLoopJobWrapper, METH_NOARGS, NULL}; |
| 35 | |
| 36 | static PyObject *_enqueueWithDelay(PyObject *_loop, PyEventLoop::AsyncHandle::id_t handleId, PyObject *jobFn, double delaySeconds, bool repeat); |
nothing calls this directly
no test coverage detected