Lines Matching defs:loop
213 PyObject *loop = ((FutureObj *)fut)->fut_loop;
214 Py_INCREF(loop);
215 return loop;
232 get_running_loop(PyObject **loop)
280 *loop = running_loop;
284 *loop = NULL;
288 *loop = NULL;
294 set_running_loop(PyObject *loop)
309 PyRunningLoopHolder *rl = new_running_loop_holder(loop);
317 Py_DECREF(rl); // will cleanup loop & current_pid
332 PyObject *loop;
335 if (get_running_loop(&loop)) {
338 if (loop != NULL) {
339 return loop;
347 loop = _PyObject_CallMethodIdNoArgs(policy, &PyId_get_event_loop);
349 return loop;
354 call_soon(PyObject *loop, PyObject *func, PyObject *arg, PyObject *ctx)
362 loop, &PyId_call_soon, func, arg, NULL);
367 PyObject *callable = _PyObject_GetAttrId(loop, &PyId_call_soon);
478 future_init(FutureObj *fut, PyObject *loop)
500 if (loop == Py_None) {
501 loop = get_event_loop(1);
502 if (loop == NULL) {
507 Py_INCREF(loop);
509 fut->fut_loop = loop;
774 loop: object = None
784 via the event loop's call_soon_threadsafe().
791 _asyncio_Future___init___impl(FutureObj *self, PyObject *loop)
795 return future_init(self, loop);
1158 Return the event loop the Future is bound to.
1939 enter_task(PyObject *loop, PyObject *task)
1943 hash = PyObject_Hash(loop);
1947 item = _PyDict_GetItem_KnownHash(current_tasks, loop, hash);
1961 return _PyDict_SetItem_KnownHash(current_tasks, loop, task, hash);
1966 leave_task(PyObject *loop, PyObject *task)
1971 hash = PyObject_Hash(loop);
1975 item = _PyDict_GetItem_KnownHash(current_tasks, loop, hash);
1987 return _PyDict_DelItem_KnownHash(current_tasks, loop, hash);
1997 loop: object = None
2005 _asyncio_Task___init___impl(TaskObj *self, PyObject *coro, PyObject *loop,
2010 if (future_init((FutureObj*)self, loop)) {
2174 wrapped coroutine on the next cycle through the event loop.
2790 /* Check if `result` future is attached to a different loop */
2840 /* Bare yield relinquishes control for one event loop iteration. */
2862 /* Check if `result` future is attached to a different loop */
2971 "Task %R got Future %R attached to a different loop",
3067 Return the running event loop or None.
3078 PyObject *loop;
3079 if (get_running_loop(&loop)) {
3082 if (loop == NULL) {
3083 /* There's no currently running event loop */
3086 return loop;
3091 loop: 'O'
3094 Set the running event loop.
3101 _asyncio__set_running_loop(PyObject *module, PyObject *loop)
3104 if (set_running_loop(loop)) {
3113 Return an asyncio event loop.
3117 running event loop.
3119 If there is no running event loop set, the function will return
3150 Return the running event loop. Raise a RuntimeError if there is none.
3159 PyObject *loop;
3160 if (get_running_loop(&loop)) {
3163 if (loop == NULL) {
3164 /* There's no currently running event loop */
3166 PyExc_RuntimeError, "no running event loop");
3168 return loop;
3176 Register a new task in asyncio as executed by loop.
3216 loop: object
3221 Task belongs to loop.
3227 _asyncio__enter_task_impl(PyObject *module, PyObject *loop, PyObject *task)
3230 if (enter_task(loop, task) < 0) {
3240 loop: object
3245 Task belongs to loop.
3251 _asyncio__leave_task_impl(PyObject *module, PyObject *loop, PyObject *task)
3254 if (leave_task(loop, task) < 0) {
3265 new_running_loop_holder(PyObject *loop)
3277 Py_INCREF(loop);
3278 rl->rl_loop = loop;