1 /* Generated by Cython 3.0.0a9 */
2
3 /* BEGIN: Cython Metadata
4 {
5 "distutils": {
6 "depends": [
7 "src/gevent/_gevent_c_abstract_linkable.pxd"
8 ],
9 "include_dirs": [
10 "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9",
11 "/opt/local/Library/Frameworks/Python.framework/Versions/3.9/include/python3.9",
12 "/private/var/folders/y5/x7pvzk651c3dqkllbxd1jd280000gn/T/gevent-21.8.0-5hzqr1v9/gitclone/deps"
13 ],
14 "name": "gevent._gevent_c_abstract_linkable",
15 "sources": [
16 "src/gevent/_abstract_linkable.py"
17 ]
18 },
19 "module_name": "gevent._gevent_c_abstract_linkable"
20 }
21 END: Cython Metadata */
22
23 #ifndef PY_SSIZE_T_CLEAN
24 #define PY_SSIZE_T_CLEAN
25 #endif /* PY_SSIZE_T_CLEAN */
26 #if defined(CYTHON_LIMITED_API) && 0
27 #ifndef Py_LIMITED_API
28 #if CYTHON_LIMITED_API+0 > 0x03030000
29 #define Py_LIMITED_API CYTHON_LIMITED_API
30 #else
31 #define Py_LIMITED_API 0x03030000
32 #endif
33 #endif
34 #endif
35
36 #include "Python.h"
37 #ifndef Py_PYTHON_H
38 #error Python headers needed to compile C extensions, please install development version of Python.
39 #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
40 #error Cython requires Python 2.7+ or Python 3.3+.
41 #else
42 #define CYTHON_ABI "3_0_0a9"
43 #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
44 #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
45 #define CYTHON_HEX_VERSION 0x030000A9
46 #define CYTHON_FUTURE_DIVISION 1
47 #include <stddef.h>
48 #ifndef offsetof
49 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
50 #endif
51 #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
52 #ifndef __stdcall
53 #define __stdcall
54 #endif
55 #ifndef __cdecl
56 #define __cdecl
57 #endif
58 #ifndef __fastcall
59 #define __fastcall
60 #endif
61 #endif
62 #ifndef DL_IMPORT
63 #define DL_IMPORT(t) t
64 #endif
65 #ifndef DL_EXPORT
66 #define DL_EXPORT(t) t
67 #endif
68 #define __PYX_COMMA ,
69 #ifndef HAVE_LONG_LONG
70 #define HAVE_LONG_LONG
71 #endif
72 #ifndef PY_LONG_LONG
73 #define PY_LONG_LONG LONG_LONG
74 #endif
75 #ifndef Py_HUGE_VAL
76 #define Py_HUGE_VAL HUGE_VAL
77 #endif
78 #ifdef PYPY_VERSION
79 #define CYTHON_COMPILING_IN_PYPY 1
80 #define CYTHON_COMPILING_IN_CPYTHON 0
81 #define CYTHON_COMPILING_IN_LIMITED_API 0
82 #undef CYTHON_USE_TYPE_SLOTS
83 #define CYTHON_USE_TYPE_SLOTS 0
84 #undef CYTHON_USE_TYPE_SPECS
85 #define CYTHON_USE_TYPE_SPECS 0
86 #undef CYTHON_USE_PYTYPE_LOOKUP
87 #define CYTHON_USE_PYTYPE_LOOKUP 0
88 #if PY_VERSION_HEX < 0x03050000
89 #undef CYTHON_USE_ASYNC_SLOTS
90 #define CYTHON_USE_ASYNC_SLOTS 0
91 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
92 #define CYTHON_USE_ASYNC_SLOTS 1
93 #endif
94 #undef CYTHON_USE_PYLIST_INTERNALS
95 #define CYTHON_USE_PYLIST_INTERNALS 0
96 #undef CYTHON_USE_UNICODE_INTERNALS
97 #define CYTHON_USE_UNICODE_INTERNALS 0
98 #undef CYTHON_USE_UNICODE_WRITER
99 #define CYTHON_USE_UNICODE_WRITER 0
100 #undef CYTHON_USE_PYLONG_INTERNALS
101 #define CYTHON_USE_PYLONG_INTERNALS 0
102 #undef CYTHON_AVOID_BORROWED_REFS
103 #define CYTHON_AVOID_BORROWED_REFS 1
104 #undef CYTHON_ASSUME_SAFE_MACROS
105 #define CYTHON_ASSUME_SAFE_MACROS 0
106 #undef CYTHON_UNPACK_METHODS
107 #define CYTHON_UNPACK_METHODS 0
108 #undef CYTHON_FAST_THREAD_STATE
109 #define CYTHON_FAST_THREAD_STATE 0
110 #undef CYTHON_FAST_GIL
111 #define CYTHON_FAST_GIL 0
112 #undef CYTHON_METH_FASTCALL
113 #define CYTHON_METH_FASTCALL 0
114 #undef CYTHON_FAST_PYCALL
115 #define CYTHON_FAST_PYCALL 0
116 #ifndef CYTHON_PEP487_INIT_SUBCLASS
117 #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
118 #endif
119 #undef CYTHON_PEP489_MULTI_PHASE_INIT
120 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
121 #undef CYTHON_USE_MODULE_STATE
122 #define CYTHON_USE_MODULE_STATE 0
123 #undef CYTHON_USE_TP_FINALIZE
124 #define CYTHON_USE_TP_FINALIZE 0
125 #undef CYTHON_USE_DICT_VERSIONS
126 #define CYTHON_USE_DICT_VERSIONS 0
127 #undef CYTHON_USE_EXC_INFO_STACK
128 #define CYTHON_USE_EXC_INFO_STACK 0
129 #elif defined(CYTHON_LIMITED_API)
130 #define CYTHON_COMPILING_IN_PYPY 0
131 #define CYTHON_COMPILING_IN_CPYTHON 0
132 #define CYTHON_COMPILING_IN_LIMITED_API 1
133 #undef CYTHON_USE_TYPE_SLOTS
134 #define CYTHON_USE_TYPE_SLOTS 0
135 #undef CYTHON_USE_TYPE_SPECS
136 #define CYTHON_USE_TYPE_SPECS 1
137 #undef CYTHON_USE_PYTYPE_LOOKUP
138 #define CYTHON_USE_PYTYPE_LOOKUP 0
139 #undef CYTHON_USE_ASYNC_SLOTS
140 #define CYTHON_USE_ASYNC_SLOTS 0
141 #undef CYTHON_USE_PYLIST_INTERNALS
142 #define CYTHON_USE_PYLIST_INTERNALS 0
143 #undef CYTHON_USE_UNICODE_INTERNALS
144 #define CYTHON_USE_UNICODE_INTERNALS 0
145 #ifndef CYTHON_USE_UNICODE_WRITER
146 #define CYTHON_USE_UNICODE_WRITER 1
147 #endif
148 #undef CYTHON_USE_PYLONG_INTERNALS
149 #define CYTHON_USE_PYLONG_INTERNALS 0
150 #ifndef CYTHON_AVOID_BORROWED_REFS
151 #define CYTHON_AVOID_BORROWED_REFS 0
152 #endif
153 #undef CYTHON_ASSUME_SAFE_MACROS
154 #define CYTHON_ASSUME_SAFE_MACROS 0
155 #undef CYTHON_UNPACK_METHODS
156 #define CYTHON_UNPACK_METHODS 0
157 #undef CYTHON_FAST_THREAD_STATE
158 #define CYTHON_FAST_THREAD_STATE 0
159 #undef CYTHON_FAST_GIL
160 #define CYTHON_FAST_GIL 0
161 #undef CYTHON_METH_FASTCALL
162 #define CYTHON_METH_FASTCALL 0
163 #undef CYTHON_FAST_PYCALL
164 #define CYTHON_FAST_PYCALL 0
165 #ifndef CYTHON_PEP487_INIT_SUBCLASS
166 #define CYTHON_PEP487_INIT_SUBCLASS 1
167 #endif
168 #undef CYTHON_PEP489_MULTI_PHASE_INIT
169 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
170 #undef CYTHON_USE_MODULE_STATE
171 #define CYTHON_USE_MODULE_STATE 1
172 #ifndef CYTHON_USE_TP_FINALIZE
173 #define CYTHON_USE_TP_FINALIZE 1
174 #endif
175 #undef CYTHON_USE_DICT_VERSIONS
176 #define CYTHON_USE_DICT_VERSIONS 0
177 #undef CYTHON_USE_EXC_INFO_STACK
178 #define CYTHON_USE_EXC_INFO_STACK 0
179 #else
180 #define CYTHON_COMPILING_IN_PYPY 0
181 #define CYTHON_COMPILING_IN_CPYTHON 1
182 #define CYTHON_COMPILING_IN_LIMITED_API 0
183 #ifndef CYTHON_USE_TYPE_SLOTS
184 #define CYTHON_USE_TYPE_SLOTS 1
185 #endif
186 #ifndef CYTHON_USE_TYPE_SPECS
187 #define CYTHON_USE_TYPE_SPECS 0
188 #endif
189 #ifndef CYTHON_USE_PYTYPE_LOOKUP
190 #define CYTHON_USE_PYTYPE_LOOKUP 1
191 #endif
192 #if PY_MAJOR_VERSION < 3
193 #undef CYTHON_USE_ASYNC_SLOTS
194 #define CYTHON_USE_ASYNC_SLOTS 0
195 #elif !defined(CYTHON_USE_ASYNC_SLOTS)
196 #define CYTHON_USE_ASYNC_SLOTS 1
197 #endif
198 #ifndef CYTHON_USE_PYLONG_INTERNALS
199 #define CYTHON_USE_PYLONG_INTERNALS 1
200 #endif
201 #ifndef CYTHON_USE_PYLIST_INTERNALS
202 #define CYTHON_USE_PYLIST_INTERNALS 1
203 #endif
204 #ifndef CYTHON_USE_UNICODE_INTERNALS
205 #define CYTHON_USE_UNICODE_INTERNALS 1
206 #endif
207 #if PY_VERSION_HEX < 0x030300F0
208 #undef CYTHON_USE_UNICODE_WRITER
209 #define CYTHON_USE_UNICODE_WRITER 0
210 #elif !defined(CYTHON_USE_UNICODE_WRITER)
211 #define CYTHON_USE_UNICODE_WRITER 1
212 #endif
213 #ifndef CYTHON_AVOID_BORROWED_REFS
214 #define CYTHON_AVOID_BORROWED_REFS 0
215 #endif
216 #ifndef CYTHON_ASSUME_SAFE_MACROS
217 #define CYTHON_ASSUME_SAFE_MACROS 1
218 #endif
219 #ifndef CYTHON_UNPACK_METHODS
220 #define CYTHON_UNPACK_METHODS 1
221 #endif
222 #ifndef CYTHON_FAST_THREAD_STATE
223 #define CYTHON_FAST_THREAD_STATE 1
224 #endif
225 #ifndef CYTHON_FAST_GIL
226 #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000)
227 #endif
228 #ifndef CYTHON_METH_FASTCALL
229 #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
230 #endif
231 #ifndef CYTHON_FAST_PYCALL
232 #define CYTHON_FAST_PYCALL 1
233 #endif
234 #ifndef CYTHON_PEP487_INIT_SUBCLASS
235 #define CYTHON_PEP487_INIT_SUBCLASS 1
236 #endif
237 #if PY_VERSION_HEX < 0x03050000
238 #undef CYTHON_PEP489_MULTI_PHASE_INIT
239 #define CYTHON_PEP489_MULTI_PHASE_INIT 0
240 #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
241 #define CYTHON_PEP489_MULTI_PHASE_INIT 1
242 #endif
243 #ifndef CYTHON_USE_MODULE_STATE
244 #define CYTHON_USE_MODULE_STATE 0
245 #endif
246 #if PY_VERSION_HEX < 0x030400a1
247 #undef CYTHON_USE_TP_FINALIZE
248 #define CYTHON_USE_TP_FINALIZE 0
249 #elif !defined(CYTHON_USE_TP_FINALIZE)
250 #define CYTHON_USE_TP_FINALIZE 1
251 #endif
252 #if PY_VERSION_HEX < 0x030600B1
253 #undef CYTHON_USE_DICT_VERSIONS
254 #define CYTHON_USE_DICT_VERSIONS 0
255 #elif !defined(CYTHON_USE_DICT_VERSIONS)
256 #define CYTHON_USE_DICT_VERSIONS 1
257 #endif
258 #if PY_VERSION_HEX < 0x030700A3
259 #undef CYTHON_USE_EXC_INFO_STACK
260 #define CYTHON_USE_EXC_INFO_STACK 0
261 #elif !defined(CYTHON_USE_EXC_INFO_STACK)
262 #define CYTHON_USE_EXC_INFO_STACK 1
263 #endif
264 #endif
265 #if !defined(CYTHON_FAST_PYCCALL)
266 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
267 #endif
268 #if !defined(CYTHON_VECTORCALL)
269 #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
270 #endif
271 #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
272 #if CYTHON_USE_PYLONG_INTERNALS
273 #include "longintrepr.h"
274 #undef SHIFT
275 #undef BASE
276 #undef MASK
277 #ifdef SIZEOF_VOID_P
278 enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
279 #endif
280 #endif
281 #ifndef __has_attribute
282 #define __has_attribute(x) 0
283 #endif
284 #ifndef __has_cpp_attribute
285 #define __has_cpp_attribute(x) 0
286 #endif
287 #ifndef CYTHON_RESTRICT
288 #if defined(__GNUC__)
289 #define CYTHON_RESTRICT __restrict__
290 #elif defined(_MSC_VER) && _MSC_VER >= 1400
291 #define CYTHON_RESTRICT __restrict
292 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
293 #define CYTHON_RESTRICT restrict
294 #else
295 #define CYTHON_RESTRICT
296 #endif
297 #endif
298 #ifndef CYTHON_UNUSED
299 # if defined(__GNUC__)
300 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
301 # define CYTHON_UNUSED __attribute__ ((__unused__))
302 # else
303 # define CYTHON_UNUSED
304 # endif
305 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
306 # define CYTHON_UNUSED __attribute__ ((__unused__))
307 # else
308 # define CYTHON_UNUSED
309 # endif
310 #endif
311 #ifndef CYTHON_UNUSED_VAR
312 # if defined(__cplusplus)
CYTHON_UNUSED_VAR(const T &)313 template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
314 # else
315 # define CYTHON_UNUSED_VAR(x) (void)(x)
316 # endif
317 #endif
318 #ifndef CYTHON_MAYBE_UNUSED_VAR
319 #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
320 #endif
321 #ifndef CYTHON_NCP_UNUSED
322 # if CYTHON_COMPILING_IN_CPYTHON
323 # define CYTHON_NCP_UNUSED
324 # else
325 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
326 # endif
327 #endif
328 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
329 #ifdef _MSC_VER
330 #ifndef _MSC_STDINT_H_
331 #if _MSC_VER < 1300
332 typedef unsigned char uint8_t;
333 typedef unsigned short uint16_t;
334 typedef unsigned int uint32_t;
335 #else
336 typedef unsigned __int8 uint8_t;
337 typedef unsigned __int16 uint16_t;
338 typedef unsigned __int32 uint32_t;
339 #endif
340 #endif
341 #if _MSC_VER < 1300
342 #ifdef _WIN64
343 typedef unsigned long long __pyx_uintptr_t;
344 #else
345 typedef unsigned int __pyx_uintptr_t;
346 #endif
347 #else
348 #ifdef _WIN64
349 typedef unsigned __int64 __pyx_uintptr_t;
350 #else
351 typedef unsigned __int32 __pyx_uintptr_t;
352 #endif
353 #endif
354 #else
355 #include <stdint.h>
356 typedef uintptr_t __pyx_uintptr_t;
357 #endif
358 #ifndef CYTHON_FALLTHROUGH
359 #if defined(__cplusplus) && __cplusplus >= 201103L
360 #if __has_cpp_attribute(fallthrough)
361 #define CYTHON_FALLTHROUGH [[fallthrough]]
362 #elif __has_cpp_attribute(clang::fallthrough)
363 #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
364 #elif __has_cpp_attribute(gnu::fallthrough)
365 #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
366 #endif
367 #endif
368 #ifndef CYTHON_FALLTHROUGH
369 #if __has_attribute(fallthrough)
370 #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
371 #else
372 #define CYTHON_FALLTHROUGH
373 #endif
374 #endif
375 #if defined(__clang__ ) && defined(__apple_build_version__)
376 #if __apple_build_version__ < 7000000
377 #undef CYTHON_FALLTHROUGH
378 #define CYTHON_FALLTHROUGH
379 #endif
380 #endif
381 #endif
382
383 #ifndef CYTHON_INLINE
384 #if defined(__clang__)
385 #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
386 #elif defined(__GNUC__)
387 #define CYTHON_INLINE __inline__
388 #elif defined(_MSC_VER)
389 #define CYTHON_INLINE __inline
390 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
391 #define CYTHON_INLINE inline
392 #else
393 #define CYTHON_INLINE
394 #endif
395 #endif
396
397 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
398 #define Py_OptimizeFlag 0
399 #endif
400 #define __PYX_BUILD_PY_SSIZE_T "n"
401 #define CYTHON_FORMAT_SSIZE_T "z"
402 #if PY_MAJOR_VERSION < 3
403 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
404 #define __Pyx_DefaultClassType PyClass_Type
405 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
406 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
407 #else
408 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
409 #define __Pyx_DefaultClassType PyType_Type
410 #if PY_VERSION_HEX >= 0x030800B2
411 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
412 PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
413 #elif PY_VERSION_HEX >= 0x030800A4
414 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
415 PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
416 #else
417 #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
418 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
419 #endif
420 #endif
421 #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
422 #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
423 #else
424 #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
425 #endif
426 #ifndef Py_TPFLAGS_CHECKTYPES
427 #define Py_TPFLAGS_CHECKTYPES 0
428 #endif
429 #ifndef Py_TPFLAGS_HAVE_INDEX
430 #define Py_TPFLAGS_HAVE_INDEX 0
431 #endif
432 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
433 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
434 #endif
435 #ifndef Py_TPFLAGS_HAVE_FINALIZE
436 #define Py_TPFLAGS_HAVE_FINALIZE 0
437 #endif
438 #ifndef METH_STACKLESS
439 #define METH_STACKLESS 0
440 #endif
441 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
442 #ifndef METH_FASTCALL
443 #define METH_FASTCALL 0x80
444 #endif
445 typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
446 typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
447 Py_ssize_t nargs, PyObject *kwnames);
448 #else
449 #define __Pyx_PyCFunctionFast _PyCFunctionFast
450 #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
451 #endif
452 #if CYTHON_METH_FASTCALL
453 #define __Pyx_METH_FASTCALL METH_FASTCALL
454 #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
455 #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
456 #else
457 #define __Pyx_METH_FASTCALL METH_VARARGS
458 #define __Pyx_PyCFunction_FastCall PyCFunction
459 #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
460 #endif
461 #if CYTHON_VECTORCALL
462 #define __pyx_vectorcallfunc vectorcallfunc
463 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
464 #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
465 #elif CYTHON_BACKPORT_VECTORCALL
466 typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
467 size_t nargsf, PyObject *kwnames);
468 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
469 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
470 #else
471 #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
472 #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
473 #endif
474 #if PY_VERSION_HEX < 0x030900B1
475 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
476 typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
477 #else
478 #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
479 #define __Pyx_PyCMethod PyCMethod
480 #endif
481 #ifndef METH_METHOD
482 #define METH_METHOD 0x200
483 #endif
484 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
485 #define PyObject_Malloc(s) PyMem_Malloc(s)
486 #define PyObject_Free(p) PyMem_Free(p)
487 #define PyObject_Realloc(p) PyMem_Realloc(p)
488 #endif
489 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
490 #define PyMem_RawMalloc(n) PyMem_Malloc(n)
491 #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
492 #define PyMem_RawFree(p) PyMem_Free(p)
493 #endif
494 #if CYTHON_COMPILING_IN_LIMITED_API
495 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
496 #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
497 #else
498 #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
499 #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
500 #endif
501 #if CYTHON_COMPILING_IN_LIMITED_API
502 #define __Pyx_PyThreadState_Current PyThreadState_Get()
503 #elif !CYTHON_FAST_THREAD_STATE
504 #define __Pyx_PyThreadState_Current PyThreadState_GET()
505 #elif PY_VERSION_HEX >= 0x03060000
506 #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
507 #elif PY_VERSION_HEX >= 0x03000000
508 #define __Pyx_PyThreadState_Current PyThreadState_GET()
509 #else
510 #define __Pyx_PyThreadState_Current _PyThreadState_Current
511 #endif
512 #if CYTHON_COMPILING_IN_LIMITED_API
__Pyx_PyModule_GetState(PyObject * op)513 static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
514 {
515 void *result;
516 result = PyModule_GetState(op);
517 if (!result)
518 Py_FatalError("Couldn't find the module state");
519 return result;
520 }
521 #endif
522 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
523 #include "pythread.h"
524 #define Py_tss_NEEDS_INIT 0
525 typedef int Py_tss_t;
PyThread_tss_create(Py_tss_t * key)526 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
527 *key = PyThread_create_key();
528 return 0;
529 }
PyThread_tss_alloc(void)530 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
531 Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
532 *key = Py_tss_NEEDS_INIT;
533 return key;
534 }
PyThread_tss_free(Py_tss_t * key)535 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
536 PyObject_Free(key);
537 }
PyThread_tss_is_created(Py_tss_t * key)538 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
539 return *key != Py_tss_NEEDS_INIT;
540 }
PyThread_tss_delete(Py_tss_t * key)541 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
542 PyThread_delete_key(*key);
543 *key = Py_tss_NEEDS_INIT;
544 }
PyThread_tss_set(Py_tss_t * key,void * value)545 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
546 return PyThread_set_key_value(*key, value);
547 }
PyThread_tss_get(Py_tss_t * key)548 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
549 return PyThread_get_key_value(*key);
550 }
551 #endif
552 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
553 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
554 #else
555 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
556 #endif
557 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
558 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
559 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
560 #else
561 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
562 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
563 #endif
564 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS
565 #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
__Pyx_PyDict_GetItemStr(PyObject * dict,PyObject * name)566 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
567 PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
568 if (res == NULL) PyErr_Clear();
569 return res;
570 }
571 #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
572 #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
573 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
574 #else
__Pyx_PyDict_GetItemStrWithError(PyObject * dict,PyObject * name)575 static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
576 #if CYTHON_COMPILING_IN_PYPY
577 return PyDict_GetItem(dict, name);
578 #else
579 PyDictEntry *ep;
580 PyDictObject *mp = (PyDictObject*) dict;
581 long hash = ((PyStringObject *) name)->ob_shash;
582 assert(hash != -1);
583 ep = (mp->ma_lookup)(mp, name, hash);
584 if (ep == NULL) {
585 return NULL;
586 }
587 return ep->me_value;
588 #endif
589 }
590 #define __Pyx_PyDict_GetItemStr PyDict_GetItem
591 #endif
592 #if CYTHON_USE_TYPE_SLOTS
593 #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
594 #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
595 #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
596 #else
597 #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
598 #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
599 #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
600 #endif
601 #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
602 #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
603 PyTypeObject *type = Py_TYPE(obj);\
604 assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
605 PyObject_GC_Del(obj);\
606 Py_DECREF(type);\
607 }
608 #else
609 #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
610 #endif
611 #if CYTHON_COMPILING_IN_LIMITED_API
612 #define CYTHON_PEP393_ENABLED 1
613 #define __Pyx_PyUnicode_READY(op) (0)
614 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
615 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
616 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111)
617 #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
618 #define __Pyx_PyUnicode_DATA(u) ((void*)u)
619 #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
620 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
621 #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
622 #define CYTHON_PEP393_ENABLED 1
623 #if defined(PyUnicode_IS_READY)
624 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
625 0 : _PyUnicode_Ready((PyObject *)(op)))
626 #else
627 #define __Pyx_PyUnicode_READY(op) (0)
628 #endif
629 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
630 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
631 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
632 #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
633 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
634 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
635 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
636 #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
637 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
638 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
639 #else
640 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
641 #endif
642 #else
643 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
644 #endif
645 #else
646 #define CYTHON_PEP393_ENABLED 0
647 #define PyUnicode_1BYTE_KIND 1
648 #define PyUnicode_2BYTE_KIND 2
649 #define PyUnicode_4BYTE_KIND 4
650 #define __Pyx_PyUnicode_READY(op) (0)
651 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
652 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
653 #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
654 #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
655 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
656 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
657 #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
658 #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
659 #endif
660 #if CYTHON_COMPILING_IN_PYPY
661 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
662 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
663 #else
664 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
665 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
666 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
667 #endif
668 #if CYTHON_COMPILING_IN_PYPY
669 #if !defined(PyUnicode_DecodeUnicodeEscape)
670 #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
671 #endif
672 #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
673 #undef PyUnicode_Contains
674 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
675 #endif
676 #if !defined(PyByteArray_Check)
677 #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
678 #endif
679 #if !defined(PyObject_Format)
680 #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
681 #endif
682 #endif
683 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
684 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
685 #if PY_MAJOR_VERSION >= 3
686 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
687 #else
688 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
689 #endif
690 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
691 #define PyObject_ASCII(o) PyObject_Repr(o)
692 #endif
693 #if PY_MAJOR_VERSION >= 3
694 #define PyBaseString_Type PyUnicode_Type
695 #define PyStringObject PyUnicodeObject
696 #define PyString_Type PyUnicode_Type
697 #define PyString_Check PyUnicode_Check
698 #define PyString_CheckExact PyUnicode_CheckExact
699 #ifndef PyObject_Unicode
700 #define PyObject_Unicode PyObject_Str
701 #endif
702 #endif
703 #if PY_MAJOR_VERSION >= 3
704 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
705 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
706 #else
707 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
708 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
709 #endif
710 #if CYTHON_COMPILING_IN_CPYTHON
711 #define __Pyx_PySequence_ListKeepNew(obj)\
712 (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
713 #else
714 #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
715 #endif
716 #ifndef PySet_CheckExact
717 #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
718 #endif
719 #if PY_VERSION_HEX >= 0x030900A4
720 #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
721 #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
722 #else
723 #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
724 #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
725 #endif
726 #if CYTHON_ASSUME_SAFE_MACROS
727 #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
728 #else
729 #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
730 #endif
731 #if PY_MAJOR_VERSION >= 3
732 #define PyIntObject PyLongObject
733 #define PyInt_Type PyLong_Type
734 #define PyInt_Check(op) PyLong_Check(op)
735 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
736 #define PyInt_FromString PyLong_FromString
737 #define PyInt_FromUnicode PyLong_FromUnicode
738 #define PyInt_FromLong PyLong_FromLong
739 #define PyInt_FromSize_t PyLong_FromSize_t
740 #define PyInt_FromSsize_t PyLong_FromSsize_t
741 #define PyInt_AsLong PyLong_AsLong
742 #define PyInt_AS_LONG PyLong_AS_LONG
743 #define PyInt_AsSsize_t PyLong_AsSsize_t
744 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
745 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
746 #define PyNumber_Int PyNumber_Long
747 #endif
748 #if PY_MAJOR_VERSION >= 3
749 #define PyBoolObject PyLongObject
750 #endif
751 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
752 #ifndef PyUnicode_InternFromString
753 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
754 #endif
755 #endif
756 #if PY_VERSION_HEX < 0x030200A4
757 typedef long Py_hash_t;
758 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
759 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
760 #else
761 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
762 #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
763 #endif
764 #if CYTHON_USE_ASYNC_SLOTS
765 #if PY_VERSION_HEX >= 0x030500B1
766 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
767 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
768 #else
769 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
770 #endif
771 #else
772 #define __Pyx_PyType_AsAsync(obj) NULL
773 #endif
774 #ifndef __Pyx_PyAsyncMethodsStruct
775 typedef struct {
776 unaryfunc am_await;
777 unaryfunc am_aiter;
778 unaryfunc am_anext;
779 } __Pyx_PyAsyncMethodsStruct;
780 #endif
781
782 #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
783 #define _USE_MATH_DEFINES
784 #endif
785 #include <math.h>
786 #ifdef NAN
787 #define __PYX_NAN() ((float) NAN)
788 #else
__PYX_NAN()789 static CYTHON_INLINE float __PYX_NAN() {
790 float value;
791 memset(&value, 0xFF, sizeof(value));
792 return value;
793 }
794 #endif
795 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
796 #define __Pyx_truncl trunc
797 #else
798 #define __Pyx_truncl truncl
799 #endif
800
801 #define __PYX_MARK_ERR_POS(f_index, lineno) \
802 { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
803 #define __PYX_ERR(f_index, lineno, Ln_error) \
804 { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
805
806 #ifndef __PYX_EXTERN_C
807 #ifdef __cplusplus
808 #define __PYX_EXTERN_C extern "C"
809 #else
810 #define __PYX_EXTERN_C extern
811 #endif
812 #endif
813
814 #define __PYX_HAVE__gevent___gevent_c_abstract_linkable
815 #define __PYX_HAVE_API__gevent___gevent_c_abstract_linkable
816 /* Early includes */
817 #include "greenlet/greenlet.h"
818 #ifdef _OPENMP
819 #include <omp.h>
820 #endif /* _OPENMP */
821
822 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
823 #define CYTHON_WITHOUT_ASSERTIONS
824 #endif
825
826 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
827 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
828
829 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
830 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
831 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
832 #define __PYX_DEFAULT_STRING_ENCODING ""
833 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
834 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
835 #define __Pyx_uchar_cast(c) ((unsigned char)c)
836 #define __Pyx_long_cast(x) ((long)x)
837 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
838 (sizeof(type) < sizeof(Py_ssize_t)) ||\
839 (sizeof(type) > sizeof(Py_ssize_t) &&\
840 likely(v < (type)PY_SSIZE_T_MAX ||\
841 v == (type)PY_SSIZE_T_MAX) &&\
842 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
843 v == (type)PY_SSIZE_T_MIN))) ||\
844 (sizeof(type) == sizeof(Py_ssize_t) &&\
845 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
846 v == (type)PY_SSIZE_T_MAX))) )
__Pyx_is_valid_index(Py_ssize_t i,Py_ssize_t limit)847 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
848 return (size_t) i < (size_t) limit;
849 }
850 #if defined (__cplusplus) && __cplusplus >= 201103L
851 #include <cstdlib>
852 #define __Pyx_sst_abs(value) std::abs(value)
853 #elif SIZEOF_INT >= SIZEOF_SIZE_T
854 #define __Pyx_sst_abs(value) abs(value)
855 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
856 #define __Pyx_sst_abs(value) labs(value)
857 #elif defined (_MSC_VER)
858 #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
859 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
860 #define __Pyx_sst_abs(value) llabs(value)
861 #elif defined (__GNUC__)
862 #define __Pyx_sst_abs(value) __builtin_llabs(value)
863 #else
864 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
865 #endif
866 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
867 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
868 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
869 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
870 #define __Pyx_PyBytes_FromString PyBytes_FromString
871 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
872 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
873 #if PY_MAJOR_VERSION < 3
874 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
875 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
876 #else
877 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
878 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
879 #endif
880 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
881 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
882 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
883 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
884 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
885 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
886 #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
887 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
888 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
889 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
890 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
891 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
892 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
893 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
894 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
895 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
896 #if CYTHON_COMPILING_IN_LIMITED_API
__Pyx_Py_UNICODE_strlen(const wchar_t * u)897 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
898 {
899 const wchar_t *u_end = u;
900 while (*u_end++) ;
901 return (size_t)(u_end - u - 1);
902 }
903 #else
__Pyx_Py_UNICODE_strlen(const Py_UNICODE * u)904 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
905 {
906 const Py_UNICODE *u_end = u;
907 while (*u_end++) ;
908 return (size_t)(u_end - u - 1);
909 }
910 #endif
911 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
912 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
913 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
914 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
915 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
916 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
917 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
918 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
919 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
920 #define __Pyx_PySequence_Tuple(obj)\
921 (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
922 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
923 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
924 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
925 #if CYTHON_ASSUME_SAFE_MACROS
926 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
927 #else
928 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
929 #endif
930 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
931 #if PY_MAJOR_VERSION >= 3
932 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
933 #else
934 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
935 #endif
936 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
937 static int __Pyx_sys_getdefaultencoding_not_ascii;
__Pyx_init_sys_getdefaultencoding_params(void)938 static int __Pyx_init_sys_getdefaultencoding_params(void) {
939 PyObject* sys;
940 PyObject* default_encoding = NULL;
941 PyObject* ascii_chars_u = NULL;
942 PyObject* ascii_chars_b = NULL;
943 const char* default_encoding_c;
944 sys = PyImport_ImportModule("sys");
945 if (!sys) goto bad;
946 default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
947 Py_DECREF(sys);
948 if (!default_encoding) goto bad;
949 default_encoding_c = PyBytes_AsString(default_encoding);
950 if (!default_encoding_c) goto bad;
951 if (strcmp(default_encoding_c, "ascii") == 0) {
952 __Pyx_sys_getdefaultencoding_not_ascii = 0;
953 } else {
954 char ascii_chars[128];
955 int c;
956 for (c = 0; c < 128; c++) {
957 ascii_chars[c] = c;
958 }
959 __Pyx_sys_getdefaultencoding_not_ascii = 1;
960 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
961 if (!ascii_chars_u) goto bad;
962 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
963 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
964 PyErr_Format(
965 PyExc_ValueError,
966 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
967 default_encoding_c);
968 goto bad;
969 }
970 Py_DECREF(ascii_chars_u);
971 Py_DECREF(ascii_chars_b);
972 }
973 Py_DECREF(default_encoding);
974 return 0;
975 bad:
976 Py_XDECREF(default_encoding);
977 Py_XDECREF(ascii_chars_u);
978 Py_XDECREF(ascii_chars_b);
979 return -1;
980 }
981 #endif
982 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
983 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
984 #else
985 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
986 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
987 static char* __PYX_DEFAULT_STRING_ENCODING;
__Pyx_init_sys_getdefaultencoding_params(void)988 static int __Pyx_init_sys_getdefaultencoding_params(void) {
989 PyObject* sys;
990 PyObject* default_encoding = NULL;
991 char* default_encoding_c;
992 sys = PyImport_ImportModule("sys");
993 if (!sys) goto bad;
994 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
995 Py_DECREF(sys);
996 if (!default_encoding) goto bad;
997 default_encoding_c = PyBytes_AsString(default_encoding);
998 if (!default_encoding_c) goto bad;
999 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
1000 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
1001 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
1002 Py_DECREF(default_encoding);
1003 return 0;
1004 bad:
1005 Py_XDECREF(default_encoding);
1006 return -1;
1007 }
1008 #endif
1009 #endif
1010
1011
1012 /* Test for GCC > 2.95 */
1013 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
1014 #define likely(x) __builtin_expect(!!(x), 1)
1015 #define unlikely(x) __builtin_expect(!!(x), 0)
1016 #else /* !__GNUC__ or GCC < 2.95 */
1017 #define likely(x) (x)
1018 #define unlikely(x) (x)
1019 #endif /* __GNUC__ */
__Pyx_pretend_to_initialize(void * ptr)1020 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
1021
1022 #if !CYTHON_USE_MODULE_STATE
1023 static PyObject *__pyx_m = NULL;
1024 static PyObject *__pyx_d;
1025 static PyObject *__pyx_b;
1026 static PyObject *__pyx_cython_runtime = NULL;
1027 static PyObject *__pyx_empty_tuple;
1028 static PyObject *__pyx_empty_bytes;
1029 static PyObject *__pyx_empty_unicode;
1030 #endif
1031 static int __pyx_lineno;
1032 static int __pyx_clineno = 0;
1033 static const char * __pyx_cfilenm = __FILE__;
1034 static const char *__pyx_filename;
1035
1036 /* #### Code section: filename_table ### */
1037
1038 static const char *__pyx_f[] = {
1039 "src/gevent/_abstract_linkable.py",
1040 "src/gevent/_gevent_c_greenlet_primitives.pxd",
1041 "src/gevent/_gevent_c_abstract_linkable.pxd",
1042 };
1043 /* #### Code section: utility_code_proto_before_types ### */
1044 /* #### Code section: numeric_typedefs ### */
1045 /* #### Code section: complex_type_declarations ### */
1046 /* #### Code section: type_declarations ### */
1047
1048 /*--- Type declarations ---*/
1049 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet;
1050 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop;
1051 struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier;
1052 struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;
1053 struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core;
1054 struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait;
1055
1056 /* "gevent/_gevent_c_abstract_linkable.pxd":79
1057 * cpdef _acquire_lock_for_switch_in(self)
1058 *
1059 * cdef _wait_core(self, timeout, catch=*) # <<<<<<<<<<<<<<
1060 * cdef _wait_return_value(self, bint waited, bint wait_success)
1061 * cdef _wait(self, timeout=*)
1062 */
1063 struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core {
1064 int __pyx_n;
1065 PyObject *catch;
1066 };
1067
1068 /* "gevent/_gevent_c_abstract_linkable.pxd":81
1069 * cdef _wait_core(self, timeout, catch=*)
1070 * cdef _wait_return_value(self, bint waited, bint wait_success)
1071 * cdef _wait(self, timeout=*) # <<<<<<<<<<<<<<
1072 *
1073 * # Unreleated utilities
1074 */
1075 struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait {
1076 int __pyx_n;
1077 PyObject *timeout;
1078 };
1079
1080 /* "gevent/_gevent_c_greenlet_primitives.pxd":37
1081 * return PyGreenlet_Switch(self, NULL, NULL)
1082 *
1083 * cdef class TrackedRawGreenlet(greenlet): # <<<<<<<<<<<<<<
1084 * pass
1085 *
1086 */
1087 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet {
1088 PyGreenlet __pyx_base;
1089 };
1090
1091
1092 /* "gevent/_gevent_c_greenlet_primitives.pxd":40
1093 * pass
1094 *
1095 * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<<
1096 * cdef public loop
1097 *
1098 */
1099 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop {
1100 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet __pyx_base;
1101 struct __pyx_vtabstruct_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab;
1102 PyObject *loop;
1103 };
1104
1105
1106 /* "gevent/_gevent_c_abstract_linkable.pxd":38
1107 * cdef dict get_roots_and_hubs()
1108 *
1109 * cdef class _FakeNotifier(object): # <<<<<<<<<<<<<<
1110 * cdef bint pending
1111 *
1112 */
1113 struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier {
1114 PyObject_HEAD
1115 int pending;
1116 };
1117
1118
1119 /* "gevent/_gevent_c_abstract_linkable.pxd":41
1120 * cdef bint pending
1121 *
1122 * cdef class AbstractLinkable(object): # <<<<<<<<<<<<<<
1123 * # We declare the __weakref__ here in the base (even though
1124 * # that's not really what we want) as a workaround for a Cython
1125 */
1126 struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable {
1127 PyObject_HEAD
1128 struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_vtab;
1129 PyObject *__weakref__;
1130 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *hub;
1131 PyObject *_notifier;
1132 PyObject *_links;
1133 int _notify_all;
1134 };
1135
1136
1137
1138 /* "gevent/_gevent_c_greenlet_primitives.pxd":40
1139 * pass
1140 *
1141 * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet): # <<<<<<<<<<<<<<
1142 * cdef public loop
1143 *
1144 */
1145
1146 struct __pyx_vtabstruct_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop {
1147 PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch);
1148 PyObject *(*switch_out)(struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch);
1149 };
1150 static struct __pyx_vtabstruct_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop;
1151
1152
1153 /* "src/gevent/_abstract_linkable.py":58
1154 *
1155 *
1156 * class AbstractLinkable(object): # <<<<<<<<<<<<<<
1157 * # Encapsulates the standard parts of the linking and notifying
1158 * # protocol common to both repeatable events (Event, Semaphore) and
1159 */
1160
1161 struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable {
1162 PyObject *(*linkcount)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
1163 PyObject *(*rawlink)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
1164 int (*ready)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
1165 PyObject *(*unlink)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
1166 PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *);
1167 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *(*_capture_hub)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int);
1168 PyObject *(*_AbstractLinkable__wait_to_be_notified)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int);
1169 void (*_quiet_unlink_all)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *);
1170 int (*_switch_to_hub)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *);
1171 PyObject *(*_notify_link_list)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *);
1172 PyObject *(*_notify_links)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
1173 PyObject *(*_handle_unswitched_notifications)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *);
1174 PyObject *(*_AbstractLinkable__print_unswitched_warning)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int);
1175 PyObject *(*_drop_lock_for_switch_out)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
1176 PyObject *(*_acquire_lock_for_switch_in)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
1177 PyObject *(*_wait_core)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args);
1178 PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int, int);
1179 PyObject *(*_wait)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args);
1180 PyObject *(*_allocate_lock)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *);
1181 PyGreenlet *(*_getcurrent)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *);
1182 PyObject *(*_get_thread_ident)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *);
1183 };
1184 static struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;
1185 /* #### Code section: utility_code_proto ### */
1186
1187 /* --- Runtime support code (head) --- */
1188 /* Refnanny.proto */
1189 #include "src/gevent/_generated_include/Refnanny_proto_251246e7dae1dc172351bab7073efbf5de224e2b.h"
1190 /* PyErrExceptionMatches.proto */
1191 #if CYTHON_FAST_THREAD_STATE
1192 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1193 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1194 #else
1195 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1196 #endif
1197
1198 /* PyThreadStateGet.proto */
1199 #if CYTHON_FAST_THREAD_STATE
1200 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1201 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1202 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1203 #else
1204 #define __Pyx_PyThreadState_declare
1205 #define __Pyx_PyThreadState_assign
1206 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1207 #endif
1208
1209 /* PyErrFetchRestore.proto */
1210 #include "src/gevent/_generated_include/PyErrFetchRestore_proto_e557b335a89c5f3673718071940bbfa92fc27c44.h"
1211 /* PyObjectGetAttrStr.proto */
1212 #if CYTHON_USE_TYPE_SLOTS
1213 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1214 #else
1215 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1216 #endif
1217
1218 /* PyObjectGetAttrStrNoError.proto */
1219 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
1220
1221 /* GetBuiltinName.proto */
1222 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1223
1224 /* TupleAndListFromArray.proto */
1225 #if CYTHON_COMPILING_IN_CPYTHON
1226 static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
1227 static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
1228 #endif
1229
1230 /* IncludeStringH.proto */
1231 #include <string.h>
1232
1233 /* BytesEquals.proto */
1234 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1235
1236 /* UnicodeEquals.proto */
1237 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1238
1239 /* fastcall.proto */
1240 #include "src/gevent/_generated_include/fastcall_proto_d252a45912f48b700e5b6607903f91d7133d67b9.h"
1241 /* RaiseArgTupleInvalid.proto */
1242 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1243 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1244
1245 /* KeywordStringCheck.proto */
1246 static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);
1247
1248 /* Import.proto */
1249 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1250
1251 /* ImportFrom.proto */
1252 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1253
1254 /* PyFunctionFastCall.proto */
1255 #include "src/gevent/_generated_include/PyFunctionFastCall_proto_4c4e96d47d0316f69e98693e61d1412a9fd8ed24.h"
1256 /* PyObjectCall.proto */
1257 #if CYTHON_COMPILING_IN_CPYTHON
1258 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1259 #else
1260 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1261 #endif
1262
1263 /* PyObjectCallMethO.proto */
1264 #if CYTHON_COMPILING_IN_CPYTHON
1265 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1266 #endif
1267
1268 /* PyObjectFastCall.proto */
1269 #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
1270 static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
1271
1272 /* RaiseDoubleKeywords.proto */
1273 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1274
1275 /* ParseKeywords.proto */
1276 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
1277 PyObject **argnames[],
1278 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
1279 const char* function_name);
1280
1281 /* ExtTypeTest.proto */
1282 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1283
1284 /* PyDictVersioning.proto */
1285 #include "src/gevent/_generated_include/PyDictVersioning_proto_36f095b0bd887fb7db7a2fb45d0f46d110d1777f.h"
1286 /* RaiseException.proto */
1287 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1288
1289 /* WriteUnraisableException.proto */
1290 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1291 int lineno, const char *filename,
1292 int full_traceback, int nogil);
1293
1294 /* CallableCheck.proto */
1295 #if CYTHON_USE_TYPE_SLOTS && PY_MAJOR_VERSION >= 3
1296 #define __Pyx_PyCallable_Check(obj) (Py_TYPE(obj)->tp_call != NULL)
1297 #else
1298 #define __Pyx_PyCallable_Check(obj) PyCallable_Check(obj)
1299 #endif
1300
1301 /* PyObjectCallOneArg.proto */
1302 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1303
1304 /* ListAppend.proto */
1305 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx_PyList_Append(PyObject * list,PyObject * x)1306 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1307 PyListObject* L = (PyListObject*) list;
1308 Py_ssize_t len = Py_SIZE(list);
1309 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1310 Py_INCREF(x);
1311 PyList_SET_ITEM(list, len, x);
1312 __Pyx_SET_SIZE(list, len + 1);
1313 return 0;
1314 }
1315 return PyList_Append(list, x);
1316 }
1317 #else
1318 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1319 #endif
1320
1321 /* GetTopmostException.proto */
1322 #if CYTHON_USE_EXC_INFO_STACK
1323 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1324 #endif
1325
1326 /* SaveResetException.proto */
1327 #if CYTHON_FAST_THREAD_STATE
1328 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1329 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1330 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1331 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1332 #else
1333 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1334 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1335 #endif
1336
1337 /* GetModuleGlobalName.proto */
1338 #include "src/gevent/_generated_include/GetModuleGlobalName_proto_a47fb7942110f1db16ee3605036c98ce86aed25d.h"
1339 /* GetException.proto */
1340 #if CYTHON_FAST_THREAD_STATE
1341 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1342 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1343 #else
1344 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1345 #endif
1346
1347 /* SwapException.proto */
1348 #if CYTHON_FAST_THREAD_STATE
1349 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1350 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1351 #else
1352 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1353 #endif
1354
1355 /* GetItemInt.proto */
1356 #include "src/gevent/_generated_include/GetItemInt_proto_2a72bfd08caa1e62d7b31cb875031b18cc21dd9d.h"
1357 /* PyObjectCall2Args.proto */
1358 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1359
1360 /* PyObjectGetMethod.proto */
1361 static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
1362
1363 /* PyObjectCallMethod1.proto */
1364 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);
1365
1366 /* pop_index.proto */
1367 #include "src/gevent/_generated_include/pop_index_proto_8687e287936da6a76b27789296b942c64a42f319.h"
1368 /* pyfrozenset_new.proto */
1369 static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it);
1370
1371 /* PySetContains.proto */
1372 static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq);
1373
1374 /* FastTypeChecks.proto */
1375 #include "src/gevent/_generated_include/FastTypeChecks_proto_977ac220797f8459b01658cd93725eee6f3bfbd9.h"
1376 /* ImportDottedModule.proto */
1377 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple);
1378
1379 /* ListExtend.proto */
__Pyx_PyList_Extend(PyObject * L,PyObject * v)1380 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1381 #if CYTHON_COMPILING_IN_CPYTHON
1382 PyObject* none = _PyList_Extend((PyListObject*)L, v);
1383 if (unlikely(!none))
1384 return -1;
1385 Py_DECREF(none);
1386 return 0;
1387 #else
1388 return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1389 #endif
1390 }
1391
1392 /* ArgTypeTest.proto */
1393 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1394 ((likely(__Pyx_IS_TYPE(obj, type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1395 __Pyx__ArgTypeTest(obj, type, name, exact))
1396 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1397
1398 /* GetAttr3.proto */
1399 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1400
1401 /* StrEquals.proto */
1402 #if PY_MAJOR_VERSION >= 3
1403 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1404 #else
1405 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1406 #endif
1407
1408 /* GetAttr.proto */
1409 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1410
1411 /* HasAttr.proto */
1412 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1413
1414 /* dict_getitem_default.proto */
1415 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);
1416
1417 /* UnpackUnboundCMethod.proto */
1418 typedef struct {
1419 PyObject *type;
1420 PyObject **method_name;
1421 PyCFunction func;
1422 PyObject *method;
1423 int flag;
1424 } __Pyx_CachedCFunction;
1425
1426 /* CallUnboundCMethod1.proto */
1427 static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1428 #if CYTHON_COMPILING_IN_CPYTHON
1429 static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
1430 #else
1431 #define __Pyx_CallUnboundCMethod1(cfunc, self, arg) __Pyx__CallUnboundCMethod1(cfunc, self, arg)
1432 #endif
1433
1434 /* CallUnboundCMethod2.proto */
1435 static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
1436 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
1437 static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
1438 #else
1439 #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
1440 #endif
1441
1442 /* append.proto */
1443 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);
1444
1445 /* PyObjectLookupSpecial.proto */
1446 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
1447 #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
1448 #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
1449 static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
1450 #else
1451 #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
1452 #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
1453 #endif
1454
1455 /* TypeImport.proto */
1456 #ifndef __PYX_HAVE_RT_ImportType_proto
1457 #define __PYX_HAVE_RT_ImportType_proto
1458 enum __Pyx_ImportType_CheckSize {
1459 __Pyx_ImportType_CheckSize_Error = 0,
1460 __Pyx_ImportType_CheckSize_Warn = 1,
1461 __Pyx_ImportType_CheckSize_Ignore = 2
1462 };
1463 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
1464 #endif
1465
1466 /* IncludeStructmemberH.proto */
1467 #include <structmember.h>
1468
1469 /* FixUpExtensionType.proto */
1470 #if CYTHON_USE_TYPE_SPECS
1471 static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
1472 #endif
1473
1474 /* PyObjectCallNoArg.proto */
1475 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1476
1477 /* PyObjectCallMethod0.proto */
1478 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
1479
1480 /* ValidateBasesTuple.proto */
1481 #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_USE_TYPE_SPECS
1482 static int __Pyx_validate_bases_tuple(const char *type_name, Py_ssize_t dictoffset, PyObject *bases);
1483 #endif
1484
1485 /* PyType_Ready.proto */
1486 static int __Pyx_PyType_Ready(PyTypeObject *t);
1487
1488 /* PyObject_GenericGetAttrNoDict.proto */
1489 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1490 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1491 #else
1492 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1493 #endif
1494
1495 /* PyObject_GenericGetAttr.proto */
1496 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1497 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1498 #else
1499 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1500 #endif
1501
1502 /* SetVTable.proto */
1503 static int __Pyx_SetVtable(PyTypeObject* typeptr , void* vtable);
1504
1505 /* GetVTable.proto */
1506 static void* __Pyx_GetVtable(PyTypeObject *type);
1507
1508 /* MergeVTables.proto */
1509 #if !CYTHON_COMPILING_IN_LIMITED_API
1510 static int __Pyx_MergeVtables(PyTypeObject *type);
1511 #endif
1512
1513 /* FetchCommonType.proto */
1514 #if !CYTHON_USE_TYPE_SPECS
1515 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1516 #else
1517 static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
1518 #endif
1519
1520 /* PyMethodNew.proto */
1521 #if PY_MAJOR_VERSION >= 3
__Pyx_PyMethod_New(PyObject * func,PyObject * self,PyObject * typ)1522 static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
1523 CYTHON_UNUSED_VAR(typ);
1524 if (!self)
1525 return __Pyx_NewRef(func);
1526 return PyMethod_New(func, self);
1527 }
1528 #else
1529 #define __Pyx_PyMethod_New PyMethod_New
1530 #endif
1531
1532 /* PyVectorcallFastCallDict.proto */
1533 #if CYTHON_METH_FASTCALL
1534 static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
1535 #endif
1536
1537 /* CythonFunctionShared.proto */
1538 #include "src/gevent/_generated_include/CythonFunctionShared_proto_4ebc9843e45f26aba8eae1b948cd62a00d838de4.h"
1539 /* CythonFunction.proto */
1540 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
1541 int flags, PyObject* qualname,
1542 PyObject *closure,
1543 PyObject *module, PyObject *globals,
1544 PyObject* code);
1545
1546 /* Globals.proto */
1547 static PyObject* __Pyx_Globals(void);
1548
1549 /* CLineInTraceback.proto */
1550 #ifdef CYTHON_CLINE_IN_TRACEBACK
1551 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1552 #else
1553 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1554 #endif
1555
1556 /* CodeObjectCache.proto */
1557 #if !CYTHON_COMPILING_IN_LIMITED_API
1558 typedef struct {
1559 PyCodeObject* code_object;
1560 int code_line;
1561 } __Pyx_CodeObjectCacheEntry;
1562 struct __Pyx_CodeObjectCache {
1563 int count;
1564 int max_count;
1565 __Pyx_CodeObjectCacheEntry* entries;
1566 };
1567 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1568 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1569 static PyCodeObject *__pyx_find_code_object(int code_line);
1570 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1571 #endif
1572
1573 /* AddTraceback.proto */
1574 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1575 int py_line, const char *filename);
1576
1577 /* GCCDiagnostics.proto */
1578 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
1579 #define __Pyx_HAS_GCC_DIAGNOSTIC
1580 #endif
1581
1582 /* CIntToPy.proto */
1583 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1584
1585 /* FormatTypeName.proto */
1586 #if CYTHON_COMPILING_IN_LIMITED_API
1587 typedef PyObject *__Pyx_TypeName;
1588 #define __Pyx_FMT_TYPENAME "%U"
1589 static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
1590 #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
1591 #else
1592 typedef const char *__Pyx_TypeName;
1593 #define __Pyx_FMT_TYPENAME "%.200s"
1594 #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
1595 #define __Pyx_DECREF_TypeName(obj)
1596 #endif
1597
1598 /* CIntFromPy.proto */
1599 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
1600
1601 /* CIntFromPy.proto */
1602 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
1603
1604 /* CheckBinaryVersion.proto */
1605 static int __Pyx_check_binary_version(void);
1606
1607 /* PyObjectSetAttrStr.proto */
1608 #if CYTHON_USE_TYPE_SLOTS
1609 #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
1610 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
1611 #else
1612 #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
1613 #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
1614 #endif
1615
1616 /* VoidPtrExport.proto */
1617 static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);
1618
1619 /* FunctionExport.proto */
1620 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig);
1621
1622 /* VoidPtrImport.proto */
1623 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig);
1624
1625 /* FunctionImport.proto */
1626 static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);
1627
1628 /* InitStrings.proto */
1629 #if CYTHON_COMPILING_IN_LIMITED_API
1630 static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str);
1631 #else
1632 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1633 #endif
1634
1635 /* #### Code section: module_declarations ### */
1636 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_linkcount(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
1637 static int __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
1638 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch); /* proto*/
1639 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch); /* proto*/
1640 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__allocate_lock(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto*/
1641 static PyGreenlet *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__getcurrent(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto*/
1642 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__get_thread_ident(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto*/
1643 static struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__capture_hub(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_v_create); /* proto*/
1644 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto*/
1645 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_link_list(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_links); /* proto*/
1646 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting, int __pyx_skip_dispatch); /* proto*/
1647 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__handle_unswitched_notifications(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_unswitched); /* proto*/
1648 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__print_unswitched_warning(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_link, int __pyx_v_printed_tb); /* proto*/
1649 static void __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__quiet_unlink_all(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
1650 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__wait_to_be_notified(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_v_rawlink); /* proto*/
1651 static int __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__switch_to_hub(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_the_hub); /* proto*/
1652 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__acquire_lock_for_switch_in(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
1653 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__drop_lock_for_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
1654 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args); /* proto*/
1655 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED int __pyx_v_waited, CYTHON_UNUSED int __pyx_v_wait_success); /* proto*/
1656 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args); /* proto*/
1657
1658 /* Module declarations from "cython" */
1659 #if !CYTHON_USE_MODULE_STATE
1660 #endif
1661
1662 /* Module declarations from "greenlet" */
1663 #if !CYTHON_USE_MODULE_STATE
1664 #endif
1665
1666 /* Module declarations from "gevent._gevent_c_greenlet_primitives" */
1667 #if !CYTHON_USE_MODULE_STATE
1668 static PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet = 0;
1669 static PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet = 0;
1670 static PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop = 0;
1671 #endif
1672 static PyObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_get_objects = 0;
1673 #define __pyx_v_6gevent_29_gevent_c_greenlet_primitives_get_objects (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_get_objects)
1674 static PyObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_wref = 0;
1675 #define __pyx_v_6gevent_29_gevent_c_greenlet_primitives_wref (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_wref)
1676 static PyObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_BlockingSwitchOutError = 0;
1677 #define __pyx_v_6gevent_29_gevent_c_greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_BlockingSwitchOutError)
1678 static int *__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported = 0;
1679 #define __pyx_v_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported)
1680 static PyTypeObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__memoryview = 0;
1681 #define __pyx_v_6gevent_29_gevent_c_greenlet_primitives__memoryview (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__memoryview)
1682 static PyTypeObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__buffer = 0;
1683 #define __pyx_v_6gevent_29_gevent_c_greenlet_primitives__buffer (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__buffer)
1684
1685 /* Module declarations from "gevent._gevent_c_hub_local" */
1686 #if !CYTHON_USE_MODULE_STATE
1687 #endif
1688 static PyObject **__pyx_vp_6gevent_19_gevent_c_hub_local__threadlocal = 0;
1689 #define __pyx_v_6gevent_19_gevent_c_hub_local__threadlocal (*__pyx_vp_6gevent_19_gevent_c_hub_local__threadlocal)
1690 static struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_if_exists)(int __pyx_skip_dispatch); /*proto*/
1691 static struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *(*__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_noargs)(int __pyx_skip_dispatch); /*proto*/
1692
1693 /* Module declarations from "gevent._gevent_c_abstract_linkable" */
1694 #if !CYTHON_USE_MODULE_STATE
1695 static PyTypeObject *__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet = 0;
1696 static PyTypeObject *__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier = 0;
1697 static PyTypeObject *__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable = 0;
1698 #endif
1699 static PyObject *__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError = 0;
1700 static PyObject *__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError = 0;
1701 static PyObject *__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout = 0;
1702 static PyObject *__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident = 0;
1703 static int __pyx_v_6gevent_27_gevent_c_abstract_linkable__greenlet_imported;
1704 static PyObject *__pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects = 0;
1705 static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent(void); /*proto*/
1706 static CYTHON_INLINE void __pyx_f_6gevent_27_gevent_c_abstract_linkable_greenlet_init(void); /*proto*/
1707 static void __pyx_f_6gevent_27_gevent_c_abstract_linkable__init(void); /*proto*/
1708 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_get_roots_and_hubs(void); /*proto*/
1709 /* #### Code section: typeinfo ### */
1710 /* #### Code section: before_global_var ### */
1711 #define __Pyx_MODULE_NAME "gevent._gevent_c_abstract_linkable"
1712 extern int __pyx_module_is_main_gevent___gevent_c_abstract_linkable;
1713 int __pyx_module_is_main_gevent___gevent_c_abstract_linkable = 0;
1714
1715 /* Implementation of "gevent._gevent_c_abstract_linkable" */
1716 /* #### Code section: global_var ### */
1717 static PyObject *__pyx_builtin___import__;
1718 static PyObject *__pyx_builtin_NotImplementedError;
1719 static PyObject *__pyx_builtin_TypeError;
1720 static PyObject *__pyx_builtin_ValueError;
1721 static PyObject *__pyx_builtin_id;
1722 static PyObject *__pyx_builtin_AssertionError;
1723 static PyObject *__pyx_builtin_print;
1724 /* #### Code section: string_decls ### */
1725 static const char __pyx_k_[] = "*";
1726 static const char __pyx_k_gc[] = "gc";
1727 static const char __pyx_k_id[] = "id";
1728 static const char __pyx_k_Hub[] = "Hub";
1729 static const char __pyx_k__24[] = "?";
1730 static const char __pyx_k_all[] = "__all__";
1731 static const char __pyx_k_get[] = "get";
1732 static const char __pyx_k_hub[] = "hub";
1733 static const char __pyx_k_pop[] = "pop";
1734 static const char __pyx_k_sys[] = "sys";
1735 static const char __pyx_k_args[] = "args";
1736 static const char __pyx_k_dead[] = "dead";
1737 static const char __pyx_k_exit[] = "__exit__";
1738 static const char __pyx_k_file[] = "file";
1739 static const char __pyx_k_from[] = "from";
1740 static const char __pyx_k_loop[] = "loop";
1741 static const char __pyx_k_main[] = "__main__";
1742 static const char __pyx_k_name[] = "__name__";
1743 static const char __pyx_k_self[] = "__self__";
1744 static const char __pyx_k_spec[] = "__spec__";
1745 static const char __pyx_k_stop[] = "stop";
1746 static const char __pyx_k_test[] = "__test__";
1747 static const char __pyx_k_class[] = "__class__";
1748 static const char __pyx_k_enter[] = "__enter__";
1749 static const char __pyx_k_error[] = "error";
1750 static const char __pyx_k_links[] = "_links";
1751 static const char __pyx_k_print[] = "print";
1752 static const char __pyx_k_ready[] = "ready";
1753 static const char __pyx_k_slots[] = "__slots__";
1754 static const char __pyx_k_append[] = "append";
1755 static const char __pyx_k_enable[] = "enable";
1756 static const char __pyx_k_import[] = "__import__";
1757 static const char __pyx_k_lambda[] = "<lambda>";
1758 static const char __pyx_k_parent[] = "parent";
1759 static const char __pyx_k_remove[] = "remove";
1760 static const char __pyx_k_self_2[] = "self";
1761 static const char __pyx_k_stderr[] = "stderr";
1762 static const char __pyx_k_switch[] = "switch";
1763 static const char __pyx_k_unlink[] = "unlink";
1764 static const char __pyx_k_Timeout[] = "Timeout";
1765 static const char __pyx_k_disable[] = "disable";
1766 static const char __pyx_k_pending[] = "pending";
1767 static const char __pyx_k_rawlink[] = "rawlink";
1768 static const char __pyx_k_weakref[] = "__weakref__";
1769 static const char __pyx_k_callback[] = "callback";
1770 static const char __pyx_k_exc_info[] = "exc_info";
1771 static const char __pyx_k_greenlet[] = "greenlet";
1772 static const char __pyx_k_notifier[] = "_notifier";
1773 static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
1774 static const char __pyx_k_TypeError[] = "TypeError";
1775 static const char __pyx_k_get_ident[] = "get_ident";
1776 static const char __pyx_k_isenabled[] = "isenabled";
1777 static const char __pyx_k_linkcount[] = "linkcount";
1778 static const char __pyx_k_print_exc[] = "print_exc";
1779 static const char __pyx_k_traceback[] = "traceback";
1780 static const char __pyx_k_ValueError[] = "ValueError";
1781 static const char __pyx_k_getcurrent[] = "getcurrent";
1782 static const char __pyx_k_gevent_hub[] = "gevent.hub";
1783 static const char __pyx_k_notify_all[] = "_notify_all";
1784 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
1785 static const char __pyx_k_get_objects[] = "get_objects";
1786 static const char __pyx_k_print_stack[] = "print_stack";
1787 static const char __pyx_k_FakeNotifier[] = "_FakeNotifier";
1788 static const char __pyx_k_gevent__util[] = "gevent._util";
1789 static const char __pyx_k_handle_error[] = "handle_error";
1790 static const char __pyx_k_initializing[] = "_initializing";
1791 static const char __pyx_k_is_coroutine[] = "_is_coroutine";
1792 static const char __pyx_k_notify_links[] = "_notify_links";
1793 static const char __pyx_k_run_callback[] = "run_callback";
1794 static const char __pyx_k_thread_ident[] = "thread_ident";
1795 static const char __pyx_k_allocate_lock[] = "allocate_lock";
1796 static const char __pyx_k_greenlet_init[] = "greenlet_init";
1797 static const char __pyx_k_AssertionError[] = "AssertionError";
1798 static const char __pyx_k_at_fork_reinit[] = "_at_fork_reinit";
1799 static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs";
1800 static const char __pyx_k_gevent__compat[] = "gevent._compat";
1801 static const char __pyx_k_gevent_timeout[] = "gevent.timeout";
1802 static const char __pyx_k_greenlet_error[] = "greenlet_error";
1803 static const char __pyx_k_import_c_accel[] = "import_c_accel";
1804 static const char __pyx_k_thread_mod_name[] = "thread_mod_name";
1805 static const char __pyx_k_AbstractLinkable[] = "AbstractLinkable";
1806 static const char __pyx_k_get_thread_ident[] = "_get_thread_ident";
1807 static const char __pyx_k_get_hub_if_exists[] = "get_hub_if_exists";
1808 static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local";
1809 static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions";
1810 static const char __pyx_k_greenlet_imported[] = "_greenlet_imported";
1811 static const char __pyx_k_InvalidSwitchError[] = "InvalidSwitchError";
1812 static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
1813 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
1814 static const char __pyx_k_start_new_or_dummy[] = "_start_new_or_dummy";
1815 static const char __pyx_k_Expected_callable_r[] = "Expected callable: %r";
1816 static const char __pyx_k_NotImplementedError[] = "NotImplementedError";
1817 static const char __pyx_k_allocate_thread_lock[] = "_allocate_thread_lock";
1818 static const char __pyx_k_InvalidThreadUseError[] = "InvalidThreadUseError";
1819 static const char __pyx_k_arrived_while_waiting[] = "arrived_while_waiting";
1820 static const char __pyx_k_AbstractLinkable_ready[] = "AbstractLinkable.ready";
1821 static const char __pyx_k_AbstractLinkable_unlink[] = "AbstractLinkable.unlink";
1822 static const char __pyx_k_run_callback_threadsafe[] = "run_callback_threadsafe";
1823 static const char __pyx_k_AbstractLinkable_rawlink[] = "AbstractLinkable.rawlink";
1824 static const char __pyx_k_drop_lock_for_switch_out[] = "_drop_lock_for_switch_out";
1825 static const char __pyx_k_AbstractLinkable_linkcount[] = "AbstractLinkable.linkcount";
1826 static const char __pyx_k_acquire_lock_for_switch_in[] = "_acquire_lock_for_switch_in";
1827 static const char __pyx_k_gevent___abstract_linkable[] = "gevent.__abstract_linkable";
1828 static const char __pyx_k_Invalid_switch_into_s_wait_r[] = "Invalid switch into %s.wait(): %r";
1829 static const char __pyx_k_AbstractLinkable__notify_links[] = "AbstractLinkable._notify_links";
1830 static const char __pyx_k_AbstractLinkable__drop_lock_for[] = "AbstractLinkable._drop_lock_for_switch_out";
1831 static const char __pyx_k_Internal_module_support_for_the[] = "\nInternal module, support for the linkable protocol for \"event\" like objects.\n\n";
1832 static const char __pyx_k_crossing_thread_boundaries_is_n[] = "; crossing thread boundaries is not allowed.";
1833 static const char __pyx_k_AbstractLinkable__acquire_lock_f[] = "AbstractLinkable._acquire_lock_for_switch_in";
1834 static const char __pyx_k_AbstractLinkable__at_fork_reinit[] = "AbstractLinkable._at_fork_reinit";
1835 static const char __pyx_k_and_is_a_bug_in_the_calling_code[] = "and is a bug in the calling code.";
1836 static const char __pyx_k_gevent__gevent_c_abstract_linkab[] = "gevent._gevent_c_abstract_linkable";
1837 static const char __pyx_k_gevent_error_This_is_a_result_of[] = "gevent: error: This is a result of using gevent objects from multiple threads,";
1838 static const char __pyx_k_gevent_error_Unable_to_switch_to[] = "gevent: error: Unable to switch to greenlet";
1839 static const char __pyx_k_src_gevent__abstract_linkable_py[] = "src/gevent/_abstract_linkable.py";
1840 #if !CYTHON_USE_MODULE_STATE
1841 static PyObject *__pyx_n_s_;
1842 static PyObject *__pyx_n_s_AbstractLinkable;
1843 static PyObject *__pyx_n_s_AbstractLinkable__acquire_lock_f;
1844 static PyObject *__pyx_n_s_AbstractLinkable__at_fork_reinit;
1845 static PyObject *__pyx_n_s_AbstractLinkable__drop_lock_for;
1846 static PyObject *__pyx_n_s_AbstractLinkable__notify_links;
1847 static PyObject *__pyx_n_s_AbstractLinkable_linkcount;
1848 static PyObject *__pyx_n_s_AbstractLinkable_rawlink;
1849 static PyObject *__pyx_n_s_AbstractLinkable_ready;
1850 static PyObject *__pyx_n_s_AbstractLinkable_unlink;
1851 static PyObject *__pyx_n_s_AssertionError;
1852 static PyObject *__pyx_kp_s_Expected_callable_r;
1853 static PyObject *__pyx_n_s_FakeNotifier;
1854 static PyObject *__pyx_n_s_Hub;
1855 static PyObject *__pyx_n_s_InvalidSwitchError;
1856 static PyObject *__pyx_n_s_InvalidThreadUseError;
1857 static PyObject *__pyx_kp_s_Invalid_switch_into_s_wait_r;
1858 static PyObject *__pyx_n_s_NotImplementedError;
1859 static PyObject *__pyx_n_s_Timeout;
1860 static PyObject *__pyx_n_s_TypeError;
1861 static PyObject *__pyx_n_s_ValueError;
1862 static PyObject *__pyx_n_s__24;
1863 static PyObject *__pyx_n_s_acquire_lock_for_switch_in;
1864 static PyObject *__pyx_n_s_all;
1865 static PyObject *__pyx_n_s_allocate_lock;
1866 static PyObject *__pyx_n_s_allocate_thread_lock;
1867 static PyObject *__pyx_kp_s_and_is_a_bug_in_the_calling_code;
1868 static PyObject *__pyx_n_s_append;
1869 static PyObject *__pyx_n_s_args;
1870 static PyObject *__pyx_n_s_arrived_while_waiting;
1871 static PyObject *__pyx_n_s_asyncio_coroutines;
1872 static PyObject *__pyx_n_s_at_fork_reinit;
1873 static PyObject *__pyx_n_s_callback;
1874 static PyObject *__pyx_n_s_class;
1875 static PyObject *__pyx_n_s_cline_in_traceback;
1876 static PyObject *__pyx_kp_s_crossing_thread_boundaries_is_n;
1877 static PyObject *__pyx_n_s_dead;
1878 static PyObject *__pyx_kp_u_disable;
1879 static PyObject *__pyx_n_s_drop_lock_for_switch_out;
1880 static PyObject *__pyx_kp_u_enable;
1881 static PyObject *__pyx_n_s_enter;
1882 static PyObject *__pyx_n_s_error;
1883 static PyObject *__pyx_n_s_exc_info;
1884 static PyObject *__pyx_n_s_exit;
1885 static PyObject *__pyx_n_s_file;
1886 static PyObject *__pyx_n_s_from;
1887 static PyObject *__pyx_n_s_gc;
1888 static PyObject *__pyx_kp_u_gc;
1889 static PyObject *__pyx_n_s_get;
1890 static PyObject *__pyx_n_s_get_hub_if_exists;
1891 static PyObject *__pyx_n_s_get_hub_noargs;
1892 static PyObject *__pyx_n_s_get_ident;
1893 static PyObject *__pyx_n_s_get_objects;
1894 static PyObject *__pyx_n_s_get_thread_ident;
1895 static PyObject *__pyx_n_s_getcurrent;
1896 static PyObject *__pyx_kp_s_gevent___abstract_linkable;
1897 static PyObject *__pyx_n_s_gevent__compat;
1898 static PyObject *__pyx_n_s_gevent__gevent_c_abstract_linkab;
1899 static PyObject *__pyx_n_s_gevent__hub_local;
1900 static PyObject *__pyx_n_s_gevent__util;
1901 static PyObject *__pyx_kp_s_gevent_error_This_is_a_result_of;
1902 static PyObject *__pyx_kp_s_gevent_error_Unable_to_switch_to;
1903 static PyObject *__pyx_n_s_gevent_exceptions;
1904 static PyObject *__pyx_n_s_gevent_hub;
1905 static PyObject *__pyx_n_s_gevent_timeout;
1906 static PyObject *__pyx_n_s_greenlet;
1907 static PyObject *__pyx_n_s_greenlet_error;
1908 static PyObject *__pyx_n_s_greenlet_imported;
1909 static PyObject *__pyx_n_s_greenlet_init;
1910 static PyObject *__pyx_n_s_handle_error;
1911 static PyObject *__pyx_n_s_hub;
1912 static PyObject *__pyx_n_s_id;
1913 static PyObject *__pyx_n_s_import;
1914 static PyObject *__pyx_n_s_import_c_accel;
1915 static PyObject *__pyx_n_s_initializing;
1916 static PyObject *__pyx_n_s_is_coroutine;
1917 static PyObject *__pyx_kp_u_isenabled;
1918 static PyObject *__pyx_n_s_lambda;
1919 static PyObject *__pyx_n_s_linkcount;
1920 static PyObject *__pyx_n_s_links;
1921 static PyObject *__pyx_n_s_loop;
1922 static PyObject *__pyx_n_s_main;
1923 static PyObject *__pyx_n_s_name;
1924 static PyObject *__pyx_n_s_notifier;
1925 static PyObject *__pyx_n_s_notify_all;
1926 static PyObject *__pyx_n_s_notify_links;
1927 static PyObject *__pyx_n_s_parent;
1928 static PyObject *__pyx_n_s_pending;
1929 static PyObject *__pyx_n_s_pop;
1930 static PyObject *__pyx_n_s_print;
1931 static PyObject *__pyx_n_s_print_exc;
1932 static PyObject *__pyx_n_s_print_stack;
1933 static PyObject *__pyx_n_s_pyx_capi;
1934 static PyObject *__pyx_n_s_pyx_vtable;
1935 static PyObject *__pyx_n_s_rawlink;
1936 static PyObject *__pyx_n_s_ready;
1937 static PyObject *__pyx_n_s_remove;
1938 static PyObject *__pyx_n_s_run_callback;
1939 static PyObject *__pyx_n_s_run_callback_threadsafe;
1940 static PyObject *__pyx_n_s_self;
1941 static PyObject *__pyx_n_s_self_2;
1942 static PyObject *__pyx_n_s_slots;
1943 static PyObject *__pyx_n_s_spec;
1944 static PyObject *__pyx_kp_s_src_gevent__abstract_linkable_py;
1945 static PyObject *__pyx_n_s_start_new_or_dummy;
1946 static PyObject *__pyx_n_s_stderr;
1947 static PyObject *__pyx_n_s_stop;
1948 static PyObject *__pyx_n_s_switch;
1949 static PyObject *__pyx_n_s_sys;
1950 static PyObject *__pyx_n_s_test;
1951 static PyObject *__pyx_n_s_thread_ident;
1952 static PyObject *__pyx_n_s_thread_mod_name;
1953 static PyObject *__pyx_n_s_traceback;
1954 static PyObject *__pyx_n_s_unlink;
1955 static PyObject *__pyx_n_s_weakref;
1956 #endif
1957 /* #### Code section: decls ### */
1958 static PyObject *__pyx_lambda_funcdef_6gevent_27_gevent_c_abstract_linkable_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
1959 static int __pyx_pf_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier___init__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier *__pyx_v_self); /* proto */
1960 static int __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */
1961 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */
1962 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */
1963 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
1964 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
1965 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting); /* proto */
1966 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */
1967 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */
1968 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */
1969 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3hub___get__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self); /* proto */
1970 static PyObject *__pyx_tp_new_6gevent_27_gevent_c_abstract_linkable__FakeNotifier(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1971 static PyObject *__pyx_tp_new_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
1972 static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
1973 #if !CYTHON_USE_MODULE_STATE
1974 static PyObject *__pyx_int_0;
1975 static PyObject *__pyx_int_1;
1976 #endif
1977 #if !CYTHON_USE_MODULE_STATE
1978 static PyObject *__pyx_k__3;
1979 static PyObject *__pyx_tuple__2;
1980 static PyObject *__pyx_tuple__4;
1981 static PyObject *__pyx_tuple__5;
1982 static PyObject *__pyx_tuple__6;
1983 static PyObject *__pyx_tuple__7;
1984 static PyObject *__pyx_tuple__8;
1985 static PyObject *__pyx_tuple__10;
1986 static PyObject *__pyx_tuple__12;
1987 static PyObject *__pyx_tuple__14;
1988 static PyObject *__pyx_tuple__16;
1989 static PyObject *__pyx_tuple__18;
1990 static PyObject *__pyx_tuple__20;
1991 static PyObject *__pyx_tuple__22;
1992 static PyObject *__pyx_codeobj__9;
1993 static PyObject *__pyx_codeobj__11;
1994 static PyObject *__pyx_codeobj__13;
1995 static PyObject *__pyx_codeobj__15;
1996 static PyObject *__pyx_codeobj__17;
1997 static PyObject *__pyx_codeobj__19;
1998 static PyObject *__pyx_codeobj__21;
1999 static PyObject *__pyx_codeobj__23;
2000 #endif
2001 /* #### Code section: late_includes ### */
2002 /* #### Code section: module_state ### */
2003 #if CYTHON_USE_MODULE_STATE
2004 typedef struct {
2005 PyObject *__pyx_d;
2006 PyObject *__pyx_b;
2007 PyObject *__pyx_cython_runtime;
2008 PyObject *__pyx_empty_tuple;
2009 PyObject *__pyx_empty_bytes;
2010 PyObject *__pyx_empty_unicode;
2011 #ifdef __Pyx_CyFunction_USED
2012 PyTypeObject *__pyx_CyFunctionType;
2013 #endif
2014 #ifdef __Pyx_FusedFunction_USED
2015 PyTypeObject *__pyx_FusedFunctionType;
2016 #endif
2017 PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet;
2018 PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet;
2019 PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop;
2020 PyTypeObject *__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet;
2021 PyTypeObject *__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier;
2022 PyObject *__pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier;
2023 PyTypeObject *__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;
2024 PyObject *__pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;
2025 PyObject *__pyx_n_s_;
2026 PyObject *__pyx_n_s_AbstractLinkable;
2027 PyObject *__pyx_n_s_AbstractLinkable__acquire_lock_f;
2028 PyObject *__pyx_n_s_AbstractLinkable__at_fork_reinit;
2029 PyObject *__pyx_n_s_AbstractLinkable__drop_lock_for;
2030 PyObject *__pyx_n_s_AbstractLinkable__notify_links;
2031 PyObject *__pyx_n_s_AbstractLinkable_linkcount;
2032 PyObject *__pyx_n_s_AbstractLinkable_rawlink;
2033 PyObject *__pyx_n_s_AbstractLinkable_ready;
2034 PyObject *__pyx_n_s_AbstractLinkable_unlink;
2035 PyObject *__pyx_n_s_AssertionError;
2036 PyObject *__pyx_kp_s_Expected_callable_r;
2037 PyObject *__pyx_n_s_FakeNotifier;
2038 PyObject *__pyx_n_s_Hub;
2039 PyObject *__pyx_n_s_InvalidSwitchError;
2040 PyObject *__pyx_n_s_InvalidThreadUseError;
2041 PyObject *__pyx_kp_s_Invalid_switch_into_s_wait_r;
2042 PyObject *__pyx_n_s_NotImplementedError;
2043 PyObject *__pyx_n_s_Timeout;
2044 PyObject *__pyx_n_s_TypeError;
2045 PyObject *__pyx_n_s_ValueError;
2046 PyObject *__pyx_n_s__24;
2047 PyObject *__pyx_n_s_acquire_lock_for_switch_in;
2048 PyObject *__pyx_n_s_all;
2049 PyObject *__pyx_n_s_allocate_lock;
2050 PyObject *__pyx_n_s_allocate_thread_lock;
2051 PyObject *__pyx_kp_s_and_is_a_bug_in_the_calling_code;
2052 PyObject *__pyx_n_s_append;
2053 PyObject *__pyx_n_s_args;
2054 PyObject *__pyx_n_s_arrived_while_waiting;
2055 PyObject *__pyx_n_s_asyncio_coroutines;
2056 PyObject *__pyx_n_s_at_fork_reinit;
2057 PyObject *__pyx_n_s_callback;
2058 PyObject *__pyx_n_s_class;
2059 PyObject *__pyx_n_s_cline_in_traceback;
2060 PyObject *__pyx_kp_s_crossing_thread_boundaries_is_n;
2061 PyObject *__pyx_n_s_dead;
2062 PyObject *__pyx_kp_u_disable;
2063 PyObject *__pyx_n_s_drop_lock_for_switch_out;
2064 PyObject *__pyx_kp_u_enable;
2065 PyObject *__pyx_n_s_enter;
2066 PyObject *__pyx_n_s_error;
2067 PyObject *__pyx_n_s_exc_info;
2068 PyObject *__pyx_n_s_exit;
2069 PyObject *__pyx_n_s_file;
2070 PyObject *__pyx_n_s_from;
2071 PyObject *__pyx_n_s_gc;
2072 PyObject *__pyx_kp_u_gc;
2073 PyObject *__pyx_n_s_get;
2074 PyObject *__pyx_n_s_get_hub_if_exists;
2075 PyObject *__pyx_n_s_get_hub_noargs;
2076 PyObject *__pyx_n_s_get_ident;
2077 PyObject *__pyx_n_s_get_objects;
2078 PyObject *__pyx_n_s_get_thread_ident;
2079 PyObject *__pyx_n_s_getcurrent;
2080 PyObject *__pyx_kp_s_gevent___abstract_linkable;
2081 PyObject *__pyx_n_s_gevent__compat;
2082 PyObject *__pyx_n_s_gevent__gevent_c_abstract_linkab;
2083 PyObject *__pyx_n_s_gevent__hub_local;
2084 PyObject *__pyx_n_s_gevent__util;
2085 PyObject *__pyx_kp_s_gevent_error_This_is_a_result_of;
2086 PyObject *__pyx_kp_s_gevent_error_Unable_to_switch_to;
2087 PyObject *__pyx_n_s_gevent_exceptions;
2088 PyObject *__pyx_n_s_gevent_hub;
2089 PyObject *__pyx_n_s_gevent_timeout;
2090 PyObject *__pyx_n_s_greenlet;
2091 PyObject *__pyx_n_s_greenlet_error;
2092 PyObject *__pyx_n_s_greenlet_imported;
2093 PyObject *__pyx_n_s_greenlet_init;
2094 PyObject *__pyx_n_s_handle_error;
2095 PyObject *__pyx_n_s_hub;
2096 PyObject *__pyx_n_s_id;
2097 PyObject *__pyx_n_s_import;
2098 PyObject *__pyx_n_s_import_c_accel;
2099 PyObject *__pyx_n_s_initializing;
2100 PyObject *__pyx_n_s_is_coroutine;
2101 PyObject *__pyx_kp_u_isenabled;
2102 PyObject *__pyx_n_s_lambda;
2103 PyObject *__pyx_n_s_linkcount;
2104 PyObject *__pyx_n_s_links;
2105 PyObject *__pyx_n_s_loop;
2106 PyObject *__pyx_n_s_main;
2107 PyObject *__pyx_n_s_name;
2108 PyObject *__pyx_n_s_notifier;
2109 PyObject *__pyx_n_s_notify_all;
2110 PyObject *__pyx_n_s_notify_links;
2111 PyObject *__pyx_n_s_parent;
2112 PyObject *__pyx_n_s_pending;
2113 PyObject *__pyx_n_s_pop;
2114 PyObject *__pyx_n_s_print;
2115 PyObject *__pyx_n_s_print_exc;
2116 PyObject *__pyx_n_s_print_stack;
2117 PyObject *__pyx_n_s_pyx_capi;
2118 PyObject *__pyx_n_s_pyx_vtable;
2119 PyObject *__pyx_n_s_rawlink;
2120 PyObject *__pyx_n_s_ready;
2121 PyObject *__pyx_n_s_remove;
2122 PyObject *__pyx_n_s_run_callback;
2123 PyObject *__pyx_n_s_run_callback_threadsafe;
2124 PyObject *__pyx_n_s_self;
2125 PyObject *__pyx_n_s_self_2;
2126 PyObject *__pyx_n_s_slots;
2127 PyObject *__pyx_n_s_spec;
2128 PyObject *__pyx_kp_s_src_gevent__abstract_linkable_py;
2129 PyObject *__pyx_n_s_start_new_or_dummy;
2130 PyObject *__pyx_n_s_stderr;
2131 PyObject *__pyx_n_s_stop;
2132 PyObject *__pyx_n_s_switch;
2133 PyObject *__pyx_n_s_sys;
2134 PyObject *__pyx_n_s_test;
2135 PyObject *__pyx_n_s_thread_ident;
2136 PyObject *__pyx_n_s_thread_mod_name;
2137 PyObject *__pyx_n_s_traceback;
2138 PyObject *__pyx_n_s_unlink;
2139 PyObject *__pyx_n_s_weakref;
2140 PyObject *__pyx_int_0;
2141 PyObject *__pyx_int_1;
2142 PyObject *__pyx_k__3;
2143 PyObject *__pyx_tuple__2;
2144 PyObject *__pyx_tuple__4;
2145 PyObject *__pyx_tuple__5;
2146 PyObject *__pyx_tuple__6;
2147 PyObject *__pyx_tuple__7;
2148 PyObject *__pyx_tuple__8;
2149 PyObject *__pyx_tuple__10;
2150 PyObject *__pyx_tuple__12;
2151 PyObject *__pyx_tuple__14;
2152 PyObject *__pyx_tuple__16;
2153 PyObject *__pyx_tuple__18;
2154 PyObject *__pyx_tuple__20;
2155 PyObject *__pyx_tuple__22;
2156 PyObject *__pyx_codeobj__9;
2157 PyObject *__pyx_codeobj__11;
2158 PyObject *__pyx_codeobj__13;
2159 PyObject *__pyx_codeobj__15;
2160 PyObject *__pyx_codeobj__17;
2161 PyObject *__pyx_codeobj__19;
2162 PyObject *__pyx_codeobj__21;
2163 PyObject *__pyx_codeobj__23;
2164 } __pyx_mstate;
2165
2166 #ifdef __cplusplus
2167 namespace {
2168 extern struct PyModuleDef __pyx_moduledef;
2169 } /* anonymous namespace */
2170 #else
2171 static struct PyModuleDef __pyx_moduledef;
2172 #endif
2173
2174 #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
2175
2176 #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
2177
2178 #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
2179 #endif
2180 /* #### Code section: module_state_clear ### */
2181 #if CYTHON_USE_MODULE_STATE
__pyx_m_clear(PyObject * m)2182 static int __pyx_m_clear(PyObject *m) {
2183 __pyx_mstate *clear_module_state = __pyx_mstate(m);
2184 if (!clear_module_state) return 0;
2185 Py_CLEAR(clear_module_state->__pyx_d);
2186 Py_CLEAR(clear_module_state->__pyx_b);
2187 Py_CLEAR(clear_module_state->__pyx_cython_runtime);
2188 Py_CLEAR(clear_module_state->__pyx_empty_tuple);
2189 Py_CLEAR(clear_module_state->__pyx_empty_bytes);
2190 Py_CLEAR(clear_module_state->__pyx_empty_unicode);
2191 #ifdef __Pyx_CyFunction_USED
2192 Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
2193 #endif
2194 #ifdef __Pyx_FusedFunction_USED
2195 Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
2196 #endif
2197 Py_CLEAR(clear_module_state->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet);
2198 Py_CLEAR(clear_module_state->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet);
2199 Py_CLEAR(clear_module_state->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop);
2200 Py_CLEAR(clear_module_state->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet);
2201 Py_CLEAR(clear_module_state->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier);
2202 Py_CLEAR(clear_module_state->__pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier);
2203 Py_CLEAR(clear_module_state->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
2204 Py_CLEAR(clear_module_state->__pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
2205 Py_CLEAR(clear_module_state->__pyx_n_s_);
2206 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable);
2207 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable__acquire_lock_f);
2208 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable__at_fork_reinit);
2209 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable__drop_lock_for);
2210 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable__notify_links);
2211 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable_linkcount);
2212 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable_rawlink);
2213 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable_ready);
2214 Py_CLEAR(clear_module_state->__pyx_n_s_AbstractLinkable_unlink);
2215 Py_CLEAR(clear_module_state->__pyx_n_s_AssertionError);
2216 Py_CLEAR(clear_module_state->__pyx_kp_s_Expected_callable_r);
2217 Py_CLEAR(clear_module_state->__pyx_n_s_FakeNotifier);
2218 Py_CLEAR(clear_module_state->__pyx_n_s_Hub);
2219 Py_CLEAR(clear_module_state->__pyx_n_s_InvalidSwitchError);
2220 Py_CLEAR(clear_module_state->__pyx_n_s_InvalidThreadUseError);
2221 Py_CLEAR(clear_module_state->__pyx_kp_s_Invalid_switch_into_s_wait_r);
2222 Py_CLEAR(clear_module_state->__pyx_n_s_NotImplementedError);
2223 Py_CLEAR(clear_module_state->__pyx_n_s_Timeout);
2224 Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
2225 Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
2226 Py_CLEAR(clear_module_state->__pyx_n_s__24);
2227 Py_CLEAR(clear_module_state->__pyx_n_s_acquire_lock_for_switch_in);
2228 Py_CLEAR(clear_module_state->__pyx_n_s_all);
2229 Py_CLEAR(clear_module_state->__pyx_n_s_allocate_lock);
2230 Py_CLEAR(clear_module_state->__pyx_n_s_allocate_thread_lock);
2231 Py_CLEAR(clear_module_state->__pyx_kp_s_and_is_a_bug_in_the_calling_code);
2232 Py_CLEAR(clear_module_state->__pyx_n_s_append);
2233 Py_CLEAR(clear_module_state->__pyx_n_s_args);
2234 Py_CLEAR(clear_module_state->__pyx_n_s_arrived_while_waiting);
2235 Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
2236 Py_CLEAR(clear_module_state->__pyx_n_s_at_fork_reinit);
2237 Py_CLEAR(clear_module_state->__pyx_n_s_callback);
2238 Py_CLEAR(clear_module_state->__pyx_n_s_class);
2239 Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
2240 Py_CLEAR(clear_module_state->__pyx_kp_s_crossing_thread_boundaries_is_n);
2241 Py_CLEAR(clear_module_state->__pyx_n_s_dead);
2242 Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
2243 Py_CLEAR(clear_module_state->__pyx_n_s_drop_lock_for_switch_out);
2244 Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
2245 Py_CLEAR(clear_module_state->__pyx_n_s_enter);
2246 Py_CLEAR(clear_module_state->__pyx_n_s_error);
2247 Py_CLEAR(clear_module_state->__pyx_n_s_exc_info);
2248 Py_CLEAR(clear_module_state->__pyx_n_s_exit);
2249 Py_CLEAR(clear_module_state->__pyx_n_s_file);
2250 Py_CLEAR(clear_module_state->__pyx_n_s_from);
2251 Py_CLEAR(clear_module_state->__pyx_n_s_gc);
2252 Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
2253 Py_CLEAR(clear_module_state->__pyx_n_s_get);
2254 Py_CLEAR(clear_module_state->__pyx_n_s_get_hub_if_exists);
2255 Py_CLEAR(clear_module_state->__pyx_n_s_get_hub_noargs);
2256 Py_CLEAR(clear_module_state->__pyx_n_s_get_ident);
2257 Py_CLEAR(clear_module_state->__pyx_n_s_get_objects);
2258 Py_CLEAR(clear_module_state->__pyx_n_s_get_thread_ident);
2259 Py_CLEAR(clear_module_state->__pyx_n_s_getcurrent);
2260 Py_CLEAR(clear_module_state->__pyx_kp_s_gevent___abstract_linkable);
2261 Py_CLEAR(clear_module_state->__pyx_n_s_gevent__compat);
2262 Py_CLEAR(clear_module_state->__pyx_n_s_gevent__gevent_c_abstract_linkab);
2263 Py_CLEAR(clear_module_state->__pyx_n_s_gevent__hub_local);
2264 Py_CLEAR(clear_module_state->__pyx_n_s_gevent__util);
2265 Py_CLEAR(clear_module_state->__pyx_kp_s_gevent_error_This_is_a_result_of);
2266 Py_CLEAR(clear_module_state->__pyx_kp_s_gevent_error_Unable_to_switch_to);
2267 Py_CLEAR(clear_module_state->__pyx_n_s_gevent_exceptions);
2268 Py_CLEAR(clear_module_state->__pyx_n_s_gevent_hub);
2269 Py_CLEAR(clear_module_state->__pyx_n_s_gevent_timeout);
2270 Py_CLEAR(clear_module_state->__pyx_n_s_greenlet);
2271 Py_CLEAR(clear_module_state->__pyx_n_s_greenlet_error);
2272 Py_CLEAR(clear_module_state->__pyx_n_s_greenlet_imported);
2273 Py_CLEAR(clear_module_state->__pyx_n_s_greenlet_init);
2274 Py_CLEAR(clear_module_state->__pyx_n_s_handle_error);
2275 Py_CLEAR(clear_module_state->__pyx_n_s_hub);
2276 Py_CLEAR(clear_module_state->__pyx_n_s_id);
2277 Py_CLEAR(clear_module_state->__pyx_n_s_import);
2278 Py_CLEAR(clear_module_state->__pyx_n_s_import_c_accel);
2279 Py_CLEAR(clear_module_state->__pyx_n_s_initializing);
2280 Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
2281 Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
2282 Py_CLEAR(clear_module_state->__pyx_n_s_lambda);
2283 Py_CLEAR(clear_module_state->__pyx_n_s_linkcount);
2284 Py_CLEAR(clear_module_state->__pyx_n_s_links);
2285 Py_CLEAR(clear_module_state->__pyx_n_s_loop);
2286 Py_CLEAR(clear_module_state->__pyx_n_s_main);
2287 Py_CLEAR(clear_module_state->__pyx_n_s_name);
2288 Py_CLEAR(clear_module_state->__pyx_n_s_notifier);
2289 Py_CLEAR(clear_module_state->__pyx_n_s_notify_all);
2290 Py_CLEAR(clear_module_state->__pyx_n_s_notify_links);
2291 Py_CLEAR(clear_module_state->__pyx_n_s_parent);
2292 Py_CLEAR(clear_module_state->__pyx_n_s_pending);
2293 Py_CLEAR(clear_module_state->__pyx_n_s_pop);
2294 Py_CLEAR(clear_module_state->__pyx_n_s_print);
2295 Py_CLEAR(clear_module_state->__pyx_n_s_print_exc);
2296 Py_CLEAR(clear_module_state->__pyx_n_s_print_stack);
2297 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_capi);
2298 Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
2299 Py_CLEAR(clear_module_state->__pyx_n_s_rawlink);
2300 Py_CLEAR(clear_module_state->__pyx_n_s_ready);
2301 Py_CLEAR(clear_module_state->__pyx_n_s_remove);
2302 Py_CLEAR(clear_module_state->__pyx_n_s_run_callback);
2303 Py_CLEAR(clear_module_state->__pyx_n_s_run_callback_threadsafe);
2304 Py_CLEAR(clear_module_state->__pyx_n_s_self);
2305 Py_CLEAR(clear_module_state->__pyx_n_s_self_2);
2306 Py_CLEAR(clear_module_state->__pyx_n_s_slots);
2307 Py_CLEAR(clear_module_state->__pyx_n_s_spec);
2308 Py_CLEAR(clear_module_state->__pyx_kp_s_src_gevent__abstract_linkable_py);
2309 Py_CLEAR(clear_module_state->__pyx_n_s_start_new_or_dummy);
2310 Py_CLEAR(clear_module_state->__pyx_n_s_stderr);
2311 Py_CLEAR(clear_module_state->__pyx_n_s_stop);
2312 Py_CLEAR(clear_module_state->__pyx_n_s_switch);
2313 Py_CLEAR(clear_module_state->__pyx_n_s_sys);
2314 Py_CLEAR(clear_module_state->__pyx_n_s_test);
2315 Py_CLEAR(clear_module_state->__pyx_n_s_thread_ident);
2316 Py_CLEAR(clear_module_state->__pyx_n_s_thread_mod_name);
2317 Py_CLEAR(clear_module_state->__pyx_n_s_traceback);
2318 Py_CLEAR(clear_module_state->__pyx_n_s_unlink);
2319 Py_CLEAR(clear_module_state->__pyx_n_s_weakref);
2320 Py_CLEAR(clear_module_state->__pyx_int_0);
2321 Py_CLEAR(clear_module_state->__pyx_int_1);
2322 Py_CLEAR(clear_module_state->__pyx_k__3);
2323 Py_CLEAR(clear_module_state->__pyx_tuple__2);
2324 Py_CLEAR(clear_module_state->__pyx_tuple__4);
2325 Py_CLEAR(clear_module_state->__pyx_tuple__5);
2326 Py_CLEAR(clear_module_state->__pyx_tuple__6);
2327 Py_CLEAR(clear_module_state->__pyx_tuple__7);
2328 Py_CLEAR(clear_module_state->__pyx_tuple__8);
2329 Py_CLEAR(clear_module_state->__pyx_tuple__10);
2330 Py_CLEAR(clear_module_state->__pyx_tuple__12);
2331 Py_CLEAR(clear_module_state->__pyx_tuple__14);
2332 Py_CLEAR(clear_module_state->__pyx_tuple__16);
2333 Py_CLEAR(clear_module_state->__pyx_tuple__18);
2334 Py_CLEAR(clear_module_state->__pyx_tuple__20);
2335 Py_CLEAR(clear_module_state->__pyx_tuple__22);
2336 Py_CLEAR(clear_module_state->__pyx_codeobj__9);
2337 Py_CLEAR(clear_module_state->__pyx_codeobj__11);
2338 Py_CLEAR(clear_module_state->__pyx_codeobj__13);
2339 Py_CLEAR(clear_module_state->__pyx_codeobj__15);
2340 Py_CLEAR(clear_module_state->__pyx_codeobj__17);
2341 Py_CLEAR(clear_module_state->__pyx_codeobj__19);
2342 Py_CLEAR(clear_module_state->__pyx_codeobj__21);
2343 Py_CLEAR(clear_module_state->__pyx_codeobj__23);
2344 return 0;
2345 }
2346 #endif
2347 /* #### Code section: module_state_traverse ### */
2348 #if CYTHON_USE_MODULE_STATE
__pyx_m_traverse(PyObject * m,visitproc visit,void * arg)2349 static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2350 __pyx_mstate *traverse_module_state = __pyx_mstate(m);
2351 if (!traverse_module_state) return 0;
2352 Py_VISIT(traverse_module_state->__pyx_d);
2353 Py_VISIT(traverse_module_state->__pyx_b);
2354 Py_VISIT(traverse_module_state->__pyx_cython_runtime);
2355 Py_VISIT(traverse_module_state->__pyx_empty_tuple);
2356 Py_VISIT(traverse_module_state->__pyx_empty_bytes);
2357 Py_VISIT(traverse_module_state->__pyx_empty_unicode);
2358 #ifdef __Pyx_CyFunction_USED
2359 Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
2360 #endif
2361 #ifdef __Pyx_FusedFunction_USED
2362 Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
2363 #endif
2364 Py_VISIT(traverse_module_state->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet);
2365 Py_VISIT(traverse_module_state->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet);
2366 Py_VISIT(traverse_module_state->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop);
2367 Py_VISIT(traverse_module_state->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet);
2368 Py_VISIT(traverse_module_state->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier);
2369 Py_VISIT(traverse_module_state->__pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier);
2370 Py_VISIT(traverse_module_state->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
2371 Py_VISIT(traverse_module_state->__pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
2372 Py_VISIT(traverse_module_state->__pyx_n_s_);
2373 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable);
2374 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable__acquire_lock_f);
2375 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable__at_fork_reinit);
2376 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable__drop_lock_for);
2377 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable__notify_links);
2378 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable_linkcount);
2379 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable_rawlink);
2380 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable_ready);
2381 Py_VISIT(traverse_module_state->__pyx_n_s_AbstractLinkable_unlink);
2382 Py_VISIT(traverse_module_state->__pyx_n_s_AssertionError);
2383 Py_VISIT(traverse_module_state->__pyx_kp_s_Expected_callable_r);
2384 Py_VISIT(traverse_module_state->__pyx_n_s_FakeNotifier);
2385 Py_VISIT(traverse_module_state->__pyx_n_s_Hub);
2386 Py_VISIT(traverse_module_state->__pyx_n_s_InvalidSwitchError);
2387 Py_VISIT(traverse_module_state->__pyx_n_s_InvalidThreadUseError);
2388 Py_VISIT(traverse_module_state->__pyx_kp_s_Invalid_switch_into_s_wait_r);
2389 Py_VISIT(traverse_module_state->__pyx_n_s_NotImplementedError);
2390 Py_VISIT(traverse_module_state->__pyx_n_s_Timeout);
2391 Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
2392 Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
2393 Py_VISIT(traverse_module_state->__pyx_n_s__24);
2394 Py_VISIT(traverse_module_state->__pyx_n_s_acquire_lock_for_switch_in);
2395 Py_VISIT(traverse_module_state->__pyx_n_s_all);
2396 Py_VISIT(traverse_module_state->__pyx_n_s_allocate_lock);
2397 Py_VISIT(traverse_module_state->__pyx_n_s_allocate_thread_lock);
2398 Py_VISIT(traverse_module_state->__pyx_kp_s_and_is_a_bug_in_the_calling_code);
2399 Py_VISIT(traverse_module_state->__pyx_n_s_append);
2400 Py_VISIT(traverse_module_state->__pyx_n_s_args);
2401 Py_VISIT(traverse_module_state->__pyx_n_s_arrived_while_waiting);
2402 Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
2403 Py_VISIT(traverse_module_state->__pyx_n_s_at_fork_reinit);
2404 Py_VISIT(traverse_module_state->__pyx_n_s_callback);
2405 Py_VISIT(traverse_module_state->__pyx_n_s_class);
2406 Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
2407 Py_VISIT(traverse_module_state->__pyx_kp_s_crossing_thread_boundaries_is_n);
2408 Py_VISIT(traverse_module_state->__pyx_n_s_dead);
2409 Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
2410 Py_VISIT(traverse_module_state->__pyx_n_s_drop_lock_for_switch_out);
2411 Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
2412 Py_VISIT(traverse_module_state->__pyx_n_s_enter);
2413 Py_VISIT(traverse_module_state->__pyx_n_s_error);
2414 Py_VISIT(traverse_module_state->__pyx_n_s_exc_info);
2415 Py_VISIT(traverse_module_state->__pyx_n_s_exit);
2416 Py_VISIT(traverse_module_state->__pyx_n_s_file);
2417 Py_VISIT(traverse_module_state->__pyx_n_s_from);
2418 Py_VISIT(traverse_module_state->__pyx_n_s_gc);
2419 Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
2420 Py_VISIT(traverse_module_state->__pyx_n_s_get);
2421 Py_VISIT(traverse_module_state->__pyx_n_s_get_hub_if_exists);
2422 Py_VISIT(traverse_module_state->__pyx_n_s_get_hub_noargs);
2423 Py_VISIT(traverse_module_state->__pyx_n_s_get_ident);
2424 Py_VISIT(traverse_module_state->__pyx_n_s_get_objects);
2425 Py_VISIT(traverse_module_state->__pyx_n_s_get_thread_ident);
2426 Py_VISIT(traverse_module_state->__pyx_n_s_getcurrent);
2427 Py_VISIT(traverse_module_state->__pyx_kp_s_gevent___abstract_linkable);
2428 Py_VISIT(traverse_module_state->__pyx_n_s_gevent__compat);
2429 Py_VISIT(traverse_module_state->__pyx_n_s_gevent__gevent_c_abstract_linkab);
2430 Py_VISIT(traverse_module_state->__pyx_n_s_gevent__hub_local);
2431 Py_VISIT(traverse_module_state->__pyx_n_s_gevent__util);
2432 Py_VISIT(traverse_module_state->__pyx_kp_s_gevent_error_This_is_a_result_of);
2433 Py_VISIT(traverse_module_state->__pyx_kp_s_gevent_error_Unable_to_switch_to);
2434 Py_VISIT(traverse_module_state->__pyx_n_s_gevent_exceptions);
2435 Py_VISIT(traverse_module_state->__pyx_n_s_gevent_hub);
2436 Py_VISIT(traverse_module_state->__pyx_n_s_gevent_timeout);
2437 Py_VISIT(traverse_module_state->__pyx_n_s_greenlet);
2438 Py_VISIT(traverse_module_state->__pyx_n_s_greenlet_error);
2439 Py_VISIT(traverse_module_state->__pyx_n_s_greenlet_imported);
2440 Py_VISIT(traverse_module_state->__pyx_n_s_greenlet_init);
2441 Py_VISIT(traverse_module_state->__pyx_n_s_handle_error);
2442 Py_VISIT(traverse_module_state->__pyx_n_s_hub);
2443 Py_VISIT(traverse_module_state->__pyx_n_s_id);
2444 Py_VISIT(traverse_module_state->__pyx_n_s_import);
2445 Py_VISIT(traverse_module_state->__pyx_n_s_import_c_accel);
2446 Py_VISIT(traverse_module_state->__pyx_n_s_initializing);
2447 Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
2448 Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
2449 Py_VISIT(traverse_module_state->__pyx_n_s_lambda);
2450 Py_VISIT(traverse_module_state->__pyx_n_s_linkcount);
2451 Py_VISIT(traverse_module_state->__pyx_n_s_links);
2452 Py_VISIT(traverse_module_state->__pyx_n_s_loop);
2453 Py_VISIT(traverse_module_state->__pyx_n_s_main);
2454 Py_VISIT(traverse_module_state->__pyx_n_s_name);
2455 Py_VISIT(traverse_module_state->__pyx_n_s_notifier);
2456 Py_VISIT(traverse_module_state->__pyx_n_s_notify_all);
2457 Py_VISIT(traverse_module_state->__pyx_n_s_notify_links);
2458 Py_VISIT(traverse_module_state->__pyx_n_s_parent);
2459 Py_VISIT(traverse_module_state->__pyx_n_s_pending);
2460 Py_VISIT(traverse_module_state->__pyx_n_s_pop);
2461 Py_VISIT(traverse_module_state->__pyx_n_s_print);
2462 Py_VISIT(traverse_module_state->__pyx_n_s_print_exc);
2463 Py_VISIT(traverse_module_state->__pyx_n_s_print_stack);
2464 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_capi);
2465 Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
2466 Py_VISIT(traverse_module_state->__pyx_n_s_rawlink);
2467 Py_VISIT(traverse_module_state->__pyx_n_s_ready);
2468 Py_VISIT(traverse_module_state->__pyx_n_s_remove);
2469 Py_VISIT(traverse_module_state->__pyx_n_s_run_callback);
2470 Py_VISIT(traverse_module_state->__pyx_n_s_run_callback_threadsafe);
2471 Py_VISIT(traverse_module_state->__pyx_n_s_self);
2472 Py_VISIT(traverse_module_state->__pyx_n_s_self_2);
2473 Py_VISIT(traverse_module_state->__pyx_n_s_slots);
2474 Py_VISIT(traverse_module_state->__pyx_n_s_spec);
2475 Py_VISIT(traverse_module_state->__pyx_kp_s_src_gevent__abstract_linkable_py);
2476 Py_VISIT(traverse_module_state->__pyx_n_s_start_new_or_dummy);
2477 Py_VISIT(traverse_module_state->__pyx_n_s_stderr);
2478 Py_VISIT(traverse_module_state->__pyx_n_s_stop);
2479 Py_VISIT(traverse_module_state->__pyx_n_s_switch);
2480 Py_VISIT(traverse_module_state->__pyx_n_s_sys);
2481 Py_VISIT(traverse_module_state->__pyx_n_s_test);
2482 Py_VISIT(traverse_module_state->__pyx_n_s_thread_ident);
2483 Py_VISIT(traverse_module_state->__pyx_n_s_thread_mod_name);
2484 Py_VISIT(traverse_module_state->__pyx_n_s_traceback);
2485 Py_VISIT(traverse_module_state->__pyx_n_s_unlink);
2486 Py_VISIT(traverse_module_state->__pyx_n_s_weakref);
2487 Py_VISIT(traverse_module_state->__pyx_int_0);
2488 Py_VISIT(traverse_module_state->__pyx_int_1);
2489 Py_VISIT(traverse_module_state->__pyx_k__3);
2490 Py_VISIT(traverse_module_state->__pyx_tuple__2);
2491 Py_VISIT(traverse_module_state->__pyx_tuple__4);
2492 Py_VISIT(traverse_module_state->__pyx_tuple__5);
2493 Py_VISIT(traverse_module_state->__pyx_tuple__6);
2494 Py_VISIT(traverse_module_state->__pyx_tuple__7);
2495 Py_VISIT(traverse_module_state->__pyx_tuple__8);
2496 Py_VISIT(traverse_module_state->__pyx_tuple__10);
2497 Py_VISIT(traverse_module_state->__pyx_tuple__12);
2498 Py_VISIT(traverse_module_state->__pyx_tuple__14);
2499 Py_VISIT(traverse_module_state->__pyx_tuple__16);
2500 Py_VISIT(traverse_module_state->__pyx_tuple__18);
2501 Py_VISIT(traverse_module_state->__pyx_tuple__20);
2502 Py_VISIT(traverse_module_state->__pyx_tuple__22);
2503 Py_VISIT(traverse_module_state->__pyx_codeobj__9);
2504 Py_VISIT(traverse_module_state->__pyx_codeobj__11);
2505 Py_VISIT(traverse_module_state->__pyx_codeobj__13);
2506 Py_VISIT(traverse_module_state->__pyx_codeobj__15);
2507 Py_VISIT(traverse_module_state->__pyx_codeobj__17);
2508 Py_VISIT(traverse_module_state->__pyx_codeobj__19);
2509 Py_VISIT(traverse_module_state->__pyx_codeobj__21);
2510 Py_VISIT(traverse_module_state->__pyx_codeobj__23);
2511 return 0;
2512 }
2513 #endif
2514 /* #### Code section: module_state_defines ### */
2515 #if CYTHON_USE_MODULE_STATE
2516 #define __pyx_d __pyx_mstate_global->__pyx_d
2517 #define __pyx_b __pyx_mstate_global->__pyx_b
2518 #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
2519 #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
2520 #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
2521 #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
2522 #ifdef __Pyx_CyFunction_USED
2523 #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
2524 #endif
2525 #ifdef __Pyx_FusedFunction_USED
2526 #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
2527 #endif
2528 #define __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet __pyx_mstate_global->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet
2529 #define __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet __pyx_mstate_global->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet
2530 #define __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop __pyx_mstate_global->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop
2531 #define __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet __pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet
2532 #define __pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier __pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier
2533 #define __pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier __pyx_mstate_global->__pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier
2534 #define __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable __pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable
2535 #define __pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable __pyx_mstate_global->__pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable
2536 #define __pyx_n_s_ __pyx_mstate_global->__pyx_n_s_
2537 #define __pyx_n_s_AbstractLinkable __pyx_mstate_global->__pyx_n_s_AbstractLinkable
2538 #define __pyx_n_s_AbstractLinkable__acquire_lock_f __pyx_mstate_global->__pyx_n_s_AbstractLinkable__acquire_lock_f
2539 #define __pyx_n_s_AbstractLinkable__at_fork_reinit __pyx_mstate_global->__pyx_n_s_AbstractLinkable__at_fork_reinit
2540 #define __pyx_n_s_AbstractLinkable__drop_lock_for __pyx_mstate_global->__pyx_n_s_AbstractLinkable__drop_lock_for
2541 #define __pyx_n_s_AbstractLinkable__notify_links __pyx_mstate_global->__pyx_n_s_AbstractLinkable__notify_links
2542 #define __pyx_n_s_AbstractLinkable_linkcount __pyx_mstate_global->__pyx_n_s_AbstractLinkable_linkcount
2543 #define __pyx_n_s_AbstractLinkable_rawlink __pyx_mstate_global->__pyx_n_s_AbstractLinkable_rawlink
2544 #define __pyx_n_s_AbstractLinkable_ready __pyx_mstate_global->__pyx_n_s_AbstractLinkable_ready
2545 #define __pyx_n_s_AbstractLinkable_unlink __pyx_mstate_global->__pyx_n_s_AbstractLinkable_unlink
2546 #define __pyx_n_s_AssertionError __pyx_mstate_global->__pyx_n_s_AssertionError
2547 #define __pyx_kp_s_Expected_callable_r __pyx_mstate_global->__pyx_kp_s_Expected_callable_r
2548 #define __pyx_n_s_FakeNotifier __pyx_mstate_global->__pyx_n_s_FakeNotifier
2549 #define __pyx_n_s_Hub __pyx_mstate_global->__pyx_n_s_Hub
2550 #define __pyx_n_s_InvalidSwitchError __pyx_mstate_global->__pyx_n_s_InvalidSwitchError
2551 #define __pyx_n_s_InvalidThreadUseError __pyx_mstate_global->__pyx_n_s_InvalidThreadUseError
2552 #define __pyx_kp_s_Invalid_switch_into_s_wait_r __pyx_mstate_global->__pyx_kp_s_Invalid_switch_into_s_wait_r
2553 #define __pyx_n_s_NotImplementedError __pyx_mstate_global->__pyx_n_s_NotImplementedError
2554 #define __pyx_n_s_Timeout __pyx_mstate_global->__pyx_n_s_Timeout
2555 #define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
2556 #define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
2557 #define __pyx_n_s__24 __pyx_mstate_global->__pyx_n_s__24
2558 #define __pyx_n_s_acquire_lock_for_switch_in __pyx_mstate_global->__pyx_n_s_acquire_lock_for_switch_in
2559 #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
2560 #define __pyx_n_s_allocate_lock __pyx_mstate_global->__pyx_n_s_allocate_lock
2561 #define __pyx_n_s_allocate_thread_lock __pyx_mstate_global->__pyx_n_s_allocate_thread_lock
2562 #define __pyx_kp_s_and_is_a_bug_in_the_calling_code __pyx_mstate_global->__pyx_kp_s_and_is_a_bug_in_the_calling_code
2563 #define __pyx_n_s_append __pyx_mstate_global->__pyx_n_s_append
2564 #define __pyx_n_s_args __pyx_mstate_global->__pyx_n_s_args
2565 #define __pyx_n_s_arrived_while_waiting __pyx_mstate_global->__pyx_n_s_arrived_while_waiting
2566 #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
2567 #define __pyx_n_s_at_fork_reinit __pyx_mstate_global->__pyx_n_s_at_fork_reinit
2568 #define __pyx_n_s_callback __pyx_mstate_global->__pyx_n_s_callback
2569 #define __pyx_n_s_class __pyx_mstate_global->__pyx_n_s_class
2570 #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
2571 #define __pyx_kp_s_crossing_thread_boundaries_is_n __pyx_mstate_global->__pyx_kp_s_crossing_thread_boundaries_is_n
2572 #define __pyx_n_s_dead __pyx_mstate_global->__pyx_n_s_dead
2573 #define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
2574 #define __pyx_n_s_drop_lock_for_switch_out __pyx_mstate_global->__pyx_n_s_drop_lock_for_switch_out
2575 #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
2576 #define __pyx_n_s_enter __pyx_mstate_global->__pyx_n_s_enter
2577 #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error
2578 #define __pyx_n_s_exc_info __pyx_mstate_global->__pyx_n_s_exc_info
2579 #define __pyx_n_s_exit __pyx_mstate_global->__pyx_n_s_exit
2580 #define __pyx_n_s_file __pyx_mstate_global->__pyx_n_s_file
2581 #define __pyx_n_s_from __pyx_mstate_global->__pyx_n_s_from
2582 #define __pyx_n_s_gc __pyx_mstate_global->__pyx_n_s_gc
2583 #define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
2584 #define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
2585 #define __pyx_n_s_get_hub_if_exists __pyx_mstate_global->__pyx_n_s_get_hub_if_exists
2586 #define __pyx_n_s_get_hub_noargs __pyx_mstate_global->__pyx_n_s_get_hub_noargs
2587 #define __pyx_n_s_get_ident __pyx_mstate_global->__pyx_n_s_get_ident
2588 #define __pyx_n_s_get_objects __pyx_mstate_global->__pyx_n_s_get_objects
2589 #define __pyx_n_s_get_thread_ident __pyx_mstate_global->__pyx_n_s_get_thread_ident
2590 #define __pyx_n_s_getcurrent __pyx_mstate_global->__pyx_n_s_getcurrent
2591 #define __pyx_kp_s_gevent___abstract_linkable __pyx_mstate_global->__pyx_kp_s_gevent___abstract_linkable
2592 #define __pyx_n_s_gevent__compat __pyx_mstate_global->__pyx_n_s_gevent__compat
2593 #define __pyx_n_s_gevent__gevent_c_abstract_linkab __pyx_mstate_global->__pyx_n_s_gevent__gevent_c_abstract_linkab
2594 #define __pyx_n_s_gevent__hub_local __pyx_mstate_global->__pyx_n_s_gevent__hub_local
2595 #define __pyx_n_s_gevent__util __pyx_mstate_global->__pyx_n_s_gevent__util
2596 #define __pyx_kp_s_gevent_error_This_is_a_result_of __pyx_mstate_global->__pyx_kp_s_gevent_error_This_is_a_result_of
2597 #define __pyx_kp_s_gevent_error_Unable_to_switch_to __pyx_mstate_global->__pyx_kp_s_gevent_error_Unable_to_switch_to
2598 #define __pyx_n_s_gevent_exceptions __pyx_mstate_global->__pyx_n_s_gevent_exceptions
2599 #define __pyx_n_s_gevent_hub __pyx_mstate_global->__pyx_n_s_gevent_hub
2600 #define __pyx_n_s_gevent_timeout __pyx_mstate_global->__pyx_n_s_gevent_timeout
2601 #define __pyx_n_s_greenlet __pyx_mstate_global->__pyx_n_s_greenlet
2602 #define __pyx_n_s_greenlet_error __pyx_mstate_global->__pyx_n_s_greenlet_error
2603 #define __pyx_n_s_greenlet_imported __pyx_mstate_global->__pyx_n_s_greenlet_imported
2604 #define __pyx_n_s_greenlet_init __pyx_mstate_global->__pyx_n_s_greenlet_init
2605 #define __pyx_n_s_handle_error __pyx_mstate_global->__pyx_n_s_handle_error
2606 #define __pyx_n_s_hub __pyx_mstate_global->__pyx_n_s_hub
2607 #define __pyx_n_s_id __pyx_mstate_global->__pyx_n_s_id
2608 #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
2609 #define __pyx_n_s_import_c_accel __pyx_mstate_global->__pyx_n_s_import_c_accel
2610 #define __pyx_n_s_initializing __pyx_mstate_global->__pyx_n_s_initializing
2611 #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
2612 #define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
2613 #define __pyx_n_s_lambda __pyx_mstate_global->__pyx_n_s_lambda
2614 #define __pyx_n_s_linkcount __pyx_mstate_global->__pyx_n_s_linkcount
2615 #define __pyx_n_s_links __pyx_mstate_global->__pyx_n_s_links
2616 #define __pyx_n_s_loop __pyx_mstate_global->__pyx_n_s_loop
2617 #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
2618 #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
2619 #define __pyx_n_s_notifier __pyx_mstate_global->__pyx_n_s_notifier
2620 #define __pyx_n_s_notify_all __pyx_mstate_global->__pyx_n_s_notify_all
2621 #define __pyx_n_s_notify_links __pyx_mstate_global->__pyx_n_s_notify_links
2622 #define __pyx_n_s_parent __pyx_mstate_global->__pyx_n_s_parent
2623 #define __pyx_n_s_pending __pyx_mstate_global->__pyx_n_s_pending
2624 #define __pyx_n_s_pop __pyx_mstate_global->__pyx_n_s_pop
2625 #define __pyx_n_s_print __pyx_mstate_global->__pyx_n_s_print
2626 #define __pyx_n_s_print_exc __pyx_mstate_global->__pyx_n_s_print_exc
2627 #define __pyx_n_s_print_stack __pyx_mstate_global->__pyx_n_s_print_stack
2628 #define __pyx_n_s_pyx_capi __pyx_mstate_global->__pyx_n_s_pyx_capi
2629 #define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
2630 #define __pyx_n_s_rawlink __pyx_mstate_global->__pyx_n_s_rawlink
2631 #define __pyx_n_s_ready __pyx_mstate_global->__pyx_n_s_ready
2632 #define __pyx_n_s_remove __pyx_mstate_global->__pyx_n_s_remove
2633 #define __pyx_n_s_run_callback __pyx_mstate_global->__pyx_n_s_run_callback
2634 #define __pyx_n_s_run_callback_threadsafe __pyx_mstate_global->__pyx_n_s_run_callback_threadsafe
2635 #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
2636 #define __pyx_n_s_self_2 __pyx_mstate_global->__pyx_n_s_self_2
2637 #define __pyx_n_s_slots __pyx_mstate_global->__pyx_n_s_slots
2638 #define __pyx_n_s_spec __pyx_mstate_global->__pyx_n_s_spec
2639 #define __pyx_kp_s_src_gevent__abstract_linkable_py __pyx_mstate_global->__pyx_kp_s_src_gevent__abstract_linkable_py
2640 #define __pyx_n_s_start_new_or_dummy __pyx_mstate_global->__pyx_n_s_start_new_or_dummy
2641 #define __pyx_n_s_stderr __pyx_mstate_global->__pyx_n_s_stderr
2642 #define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
2643 #define __pyx_n_s_switch __pyx_mstate_global->__pyx_n_s_switch
2644 #define __pyx_n_s_sys __pyx_mstate_global->__pyx_n_s_sys
2645 #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
2646 #define __pyx_n_s_thread_ident __pyx_mstate_global->__pyx_n_s_thread_ident
2647 #define __pyx_n_s_thread_mod_name __pyx_mstate_global->__pyx_n_s_thread_mod_name
2648 #define __pyx_n_s_traceback __pyx_mstate_global->__pyx_n_s_traceback
2649 #define __pyx_n_s_unlink __pyx_mstate_global->__pyx_n_s_unlink
2650 #define __pyx_n_s_weakref __pyx_mstate_global->__pyx_n_s_weakref
2651 #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
2652 #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
2653 #define __pyx_k__3 __pyx_mstate_global->__pyx_k__3
2654 #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
2655 #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
2656 #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
2657 #define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
2658 #define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
2659 #define __pyx_tuple__8 __pyx_mstate_global->__pyx_tuple__8
2660 #define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
2661 #define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
2662 #define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
2663 #define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
2664 #define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
2665 #define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
2666 #define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
2667 #define __pyx_codeobj__9 __pyx_mstate_global->__pyx_codeobj__9
2668 #define __pyx_codeobj__11 __pyx_mstate_global->__pyx_codeobj__11
2669 #define __pyx_codeobj__13 __pyx_mstate_global->__pyx_codeobj__13
2670 #define __pyx_codeobj__15 __pyx_mstate_global->__pyx_codeobj__15
2671 #define __pyx_codeobj__17 __pyx_mstate_global->__pyx_codeobj__17
2672 #define __pyx_codeobj__19 __pyx_mstate_global->__pyx_codeobj__19
2673 #define __pyx_codeobj__21 __pyx_mstate_global->__pyx_codeobj__21
2674 #define __pyx_codeobj__23 __pyx_mstate_global->__pyx_codeobj__23
2675 #endif
2676 /* #### Code section: module_code ### */
2677
2678 /* "src/gevent/_abstract_linkable.py":26
2679 *
2680 * locals()['getcurrent'] = __import__('greenlet').getcurrent
2681 * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<<
2682 *
2683 * __all__ = [
2684 */
2685
2686 /* Python wrapper */
2687 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
2688 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_lambda, METH_NOARGS, 0};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_lambda(PyObject * __pyx_self,CYTHON_UNUSED PyObject * unused)2689 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
2690 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2691 PyObject *__pyx_r = 0;
2692 __Pyx_RefNannyDeclarations
2693 __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
2694 __pyx_r = __pyx_lambda_funcdef_6gevent_27_gevent_c_abstract_linkable_lambda(__pyx_self);
2695
2696 /* function exit code */
2697 __Pyx_RefNannyFinishContext();
2698 return __pyx_r;
2699 }
2700
__pyx_lambda_funcdef_6gevent_27_gevent_c_abstract_linkable_lambda(CYTHON_UNUSED PyObject * __pyx_self)2701 static PyObject *__pyx_lambda_funcdef_6gevent_27_gevent_c_abstract_linkable_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
2702 PyObject *__pyx_r = NULL;
2703 __Pyx_RefNannyDeclarations
2704 __Pyx_RefNannySetupContext("lambda", 0);
2705 __Pyx_XDECREF(__pyx_r);
2706 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2707 goto __pyx_L0;
2708
2709 /* function exit code */
2710 __pyx_L0:;
2711 __Pyx_XGIVEREF(__pyx_r);
2712 __Pyx_RefNannyFinishContext();
2713 return __pyx_r;
2714 }
2715
2716 /* "src/gevent/_abstract_linkable.py":42
2717 * )
2718 *
2719 * def __init__(self): # <<<<<<<<<<<<<<
2720 * self.pending = False
2721 *
2722 */
2723
2724 /* Python wrapper */
2725 static int __pyx_pw_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)2726 static int __pyx_pw_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2727 CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
2728 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
2729 int __pyx_r;
2730 __Pyx_RefNannyDeclarations
2731 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2732 if (unlikely(__pyx_nargs > 0)) {
2733 __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1;}
2734 if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_VARARGS(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
2735 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier___init__(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier *)__pyx_v_self));
2736
2737 /* function exit code */
2738 __Pyx_RefNannyFinishContext();
2739 return __pyx_r;
2740 }
2741
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier___init__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier * __pyx_v_self)2742 static int __pyx_pf_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier___init__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier *__pyx_v_self) {
2743 int __pyx_r;
2744 __Pyx_RefNannyDeclarations
2745 __Pyx_RefNannySetupContext("__init__", 0);
2746
2747 /* "src/gevent/_abstract_linkable.py":43
2748 *
2749 * def __init__(self):
2750 * self.pending = False # <<<<<<<<<<<<<<
2751 *
2752 * def get_roots_and_hubs():
2753 */
2754 __pyx_v_self->pending = 0;
2755
2756 /* "src/gevent/_abstract_linkable.py":42
2757 * )
2758 *
2759 * def __init__(self): # <<<<<<<<<<<<<<
2760 * self.pending = False
2761 *
2762 */
2763
2764 /* function exit code */
2765 __pyx_r = 0;
2766 __Pyx_RefNannyFinishContext();
2767 return __pyx_r;
2768 }
2769
2770 /* "src/gevent/_abstract_linkable.py":45
2771 * self.pending = False
2772 *
2773 * def get_roots_and_hubs(): # <<<<<<<<<<<<<<
2774 * from gevent.hub import Hub # delay import
2775 * return {
2776 */
2777
__pyx_f_6gevent_27_gevent_c_abstract_linkable_get_roots_and_hubs(void)2778 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_get_roots_and_hubs(void) {
2779 PyObject *__pyx_v_Hub = NULL;
2780 PyObject *__pyx_7genexpr__pyx_v_x = NULL;
2781 PyObject *__pyx_r = NULL;
2782 __Pyx_RefNannyDeclarations
2783 PyObject *__pyx_t_1 = NULL;
2784 PyObject *__pyx_t_2 = NULL;
2785 PyObject *__pyx_t_3 = NULL;
2786 PyObject *__pyx_t_4 = NULL;
2787 int __pyx_t_5;
2788 Py_ssize_t __pyx_t_6;
2789 PyObject *(*__pyx_t_7)(PyObject *);
2790 int __pyx_t_8;
2791 int __pyx_t_9;
2792 int __pyx_t_10;
2793 int __pyx_lineno = 0;
2794 const char *__pyx_filename = NULL;
2795 int __pyx_clineno = 0;
2796 __Pyx_RefNannySetupContext("get_roots_and_hubs", 0);
2797
2798 /* "src/gevent/_abstract_linkable.py":46
2799 *
2800 * def get_roots_and_hubs():
2801 * from gevent.hub import Hub # delay import # <<<<<<<<<<<<<<
2802 * return {
2803 * x.parent: x
2804 */
2805 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
2806 __Pyx_GOTREF(__pyx_t_1);
2807 __Pyx_INCREF(__pyx_n_s_Hub);
2808 __Pyx_GIVEREF(__pyx_n_s_Hub);
2809 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Hub);
2810 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_hub, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 46, __pyx_L1_error)
2811 __Pyx_GOTREF(__pyx_t_2);
2812 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2813 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 46, __pyx_L1_error)
2814 __Pyx_GOTREF(__pyx_t_1);
2815 __Pyx_INCREF(__pyx_t_1);
2816 __pyx_v_Hub = __pyx_t_1;
2817 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2818 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
2819
2820 /* "src/gevent/_abstract_linkable.py":47
2821 * def get_roots_and_hubs():
2822 * from gevent.hub import Hub # delay import
2823 * return { # <<<<<<<<<<<<<<
2824 * x.parent: x
2825 * for x in get_objects()
2826 */
2827 __Pyx_XDECREF(__pyx_r);
2828 { /* enter inner scope */
2829 __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L5_error)
2830 __Pyx_GOTREF(__pyx_t_2);
2831
2832 /* "src/gevent/_abstract_linkable.py":49
2833 * return {
2834 * x.parent: x
2835 * for x in get_objects() # <<<<<<<<<<<<<<
2836 * # Make sure to only find hubs that have a loop
2837 * # and aren't destroyed. If we don't do that, we can
2838 */
2839 __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects);
2840 __pyx_t_3 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects; __pyx_t_4 = NULL;
2841 __pyx_t_5 = 0;
2842 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
2843 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
2844 if (likely(__pyx_t_4)) {
2845 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
2846 __Pyx_INCREF(__pyx_t_4);
2847 __Pyx_INCREF(function);
2848 __Pyx_DECREF_SET(__pyx_t_3, function);
2849 __pyx_t_5 = 1;
2850 }
2851 }
2852 {
2853 PyObject *__pyx_callargs[1] = {__pyx_t_4, };
2854 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
2855 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
2856 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L5_error)
2857 __Pyx_GOTREF(__pyx_t_1);
2858 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2859 }
2860 if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
2861 __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
2862 __pyx_t_7 = NULL;
2863 } else {
2864 __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L5_error)
2865 __Pyx_GOTREF(__pyx_t_3);
2866 __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 49, __pyx_L5_error)
2867 }
2868 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2869 for (;;) {
2870 if (likely(!__pyx_t_7)) {
2871 if (likely(PyList_CheckExact(__pyx_t_3))) {
2872 if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
2873 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2874 __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 49, __pyx_L5_error)
2875 #else
2876 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L5_error)
2877 __Pyx_GOTREF(__pyx_t_1);
2878 #endif
2879 } else {
2880 if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
2881 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
2882 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 49, __pyx_L5_error)
2883 #else
2884 __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L5_error)
2885 __Pyx_GOTREF(__pyx_t_1);
2886 #endif
2887 }
2888 } else {
2889 __pyx_t_1 = __pyx_t_7(__pyx_t_3);
2890 if (unlikely(!__pyx_t_1)) {
2891 PyObject* exc_type = PyErr_Occurred();
2892 if (exc_type) {
2893 if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
2894 else __PYX_ERR(0, 49, __pyx_L5_error)
2895 }
2896 break;
2897 }
2898 __Pyx_GOTREF(__pyx_t_1);
2899 }
2900 __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_1);
2901 __pyx_t_1 = 0;
2902
2903 /* "src/gevent/_abstract_linkable.py":54
2904 * # get an old hub that no longer works leading to issues in
2905 * # combined test cases.
2906 * if isinstance(x, Hub) and x.loop is not None # <<<<<<<<<<<<<<
2907 * }
2908 *
2909 */
2910 __pyx_t_9 = PyObject_IsInstance(__pyx_7genexpr__pyx_v_x, __pyx_v_Hub); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 54, __pyx_L5_error)
2911 __pyx_t_10 = (__pyx_t_9 != 0);
2912 if (__pyx_t_10) {
2913 } else {
2914 __pyx_t_8 = __pyx_t_10;
2915 goto __pyx_L9_bool_binop_done;
2916 }
2917 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_x, __pyx_n_s_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L5_error)
2918 __Pyx_GOTREF(__pyx_t_1);
2919 __pyx_t_10 = (__pyx_t_1 != Py_None);
2920 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2921 __pyx_t_9 = (__pyx_t_10 != 0);
2922 __pyx_t_8 = __pyx_t_9;
2923 __pyx_L9_bool_binop_done:;
2924 if (__pyx_t_8) {
2925
2926 /* "src/gevent/_abstract_linkable.py":48
2927 * from gevent.hub import Hub # delay import
2928 * return {
2929 * x.parent: x # <<<<<<<<<<<<<<
2930 * for x in get_objects()
2931 * # Make sure to only find hubs that have a loop
2932 */
2933 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_x, __pyx_n_s_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L5_error)
2934 __Pyx_GOTREF(__pyx_t_1);
2935 if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_x))) __PYX_ERR(0, 48, __pyx_L5_error)
2936 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2937
2938 /* "src/gevent/_abstract_linkable.py":54
2939 * # get an old hub that no longer works leading to issues in
2940 * # combined test cases.
2941 * if isinstance(x, Hub) and x.loop is not None # <<<<<<<<<<<<<<
2942 * }
2943 *
2944 */
2945 }
2946
2947 /* "src/gevent/_abstract_linkable.py":49
2948 * return {
2949 * x.parent: x
2950 * for x in get_objects() # <<<<<<<<<<<<<<
2951 * # Make sure to only find hubs that have a loop
2952 * # and aren't destroyed. If we don't do that, we can
2953 */
2954 }
2955 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2956 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
2957 goto __pyx_L11_exit_scope;
2958 __pyx_L5_error:;
2959 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
2960 goto __pyx_L1_error;
2961 __pyx_L11_exit_scope:;
2962 } /* exit inner scope */
2963 __pyx_r = ((PyObject*)__pyx_t_2);
2964 __pyx_t_2 = 0;
2965 goto __pyx_L0;
2966
2967 /* "src/gevent/_abstract_linkable.py":45
2968 * self.pending = False
2969 *
2970 * def get_roots_and_hubs(): # <<<<<<<<<<<<<<
2971 * from gevent.hub import Hub # delay import
2972 * return {
2973 */
2974
2975 /* function exit code */
2976 __pyx_L1_error:;
2977 __Pyx_XDECREF(__pyx_t_1);
2978 __Pyx_XDECREF(__pyx_t_2);
2979 __Pyx_XDECREF(__pyx_t_3);
2980 __Pyx_XDECREF(__pyx_t_4);
2981 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.get_roots_and_hubs", __pyx_clineno, __pyx_lineno, __pyx_filename);
2982 __pyx_r = 0;
2983 __pyx_L0:;
2984 __Pyx_XDECREF(__pyx_v_Hub);
2985 __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
2986 __Pyx_XGIVEREF(__pyx_r);
2987 __Pyx_RefNannyFinishContext();
2988 return __pyx_r;
2989 }
2990
2991 /* "src/gevent/_abstract_linkable.py":88
2992 * )
2993 *
2994 * def __init__(self, hub=None): # <<<<<<<<<<<<<<
2995 * # Before this implementation, AsyncResult and Semaphore
2996 * # maintained the order of notifications, but Event did not.
2997 */
2998
2999 /* Python wrapper */
3000 static int __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_1__init__(PyObject * __pyx_v_self,PyObject * __pyx_args,PyObject * __pyx_kwds)3001 static int __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3002 PyObject *__pyx_v_hub = 0;
3003 CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
3004 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
3005 int __pyx_lineno = 0;
3006 const char *__pyx_filename = NULL;
3007 int __pyx_clineno = 0;
3008 int __pyx_r;
3009 __Pyx_RefNannyDeclarations
3010 __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3011 {
3012 #if CYTHON_USE_MODULE_STATE
3013 PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0};
3014 #else
3015 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0};
3016 #endif
3017 PyObject* values[1] = {0};
3018 values[0] = ((PyObject *)Py_None);
3019 if (__pyx_kwds) {
3020 Py_ssize_t kw_args;
3021 switch (__pyx_nargs) {
3022 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
3023 CYTHON_FALLTHROUGH;
3024 case 0: break;
3025 default: goto __pyx_L5_argtuple_error;
3026 }
3027 kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
3028 switch (__pyx_nargs) {
3029 case 0:
3030 if (kw_args > 0) {
3031 PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hub);
3032 if (value) { values[0] = value; kw_args--; }
3033 else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 88, __pyx_L3_error)
3034 }
3035 }
3036 if (unlikely(kw_args > 0)) {
3037 const Py_ssize_t kwd_pos_args = __pyx_nargs;
3038 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 88, __pyx_L3_error)
3039 }
3040 } else {
3041 switch (__pyx_nargs) {
3042 case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
3043 CYTHON_FALLTHROUGH;
3044 case 0: break;
3045 default: goto __pyx_L5_argtuple_error;
3046 }
3047 }
3048 __pyx_v_hub = values[0];
3049 }
3050 goto __pyx_L4_argument_unpacking_done;
3051 __pyx_L5_argtuple_error:;
3052 __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 88, __pyx_L3_error)
3053 __pyx_L3_error:;
3054 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3055 __Pyx_RefNannyFinishContext();
3056 return -1;
3057 __pyx_L4_argument_unpacking_done:;
3058 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable___init__(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), __pyx_v_hub);
3059
3060 /* function exit code */
3061 __Pyx_RefNannyFinishContext();
3062 return __pyx_r;
3063 }
3064
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_hub)3065 static int __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_hub) {
3066 int __pyx_r;
3067 __Pyx_RefNannyDeclarations
3068 PyObject *__pyx_t_1 = NULL;
3069 int __pyx_lineno = 0;
3070 const char *__pyx_filename = NULL;
3071 int __pyx_clineno = 0;
3072 __Pyx_RefNannySetupContext("__init__", 0);
3073
3074 /* "src/gevent/_abstract_linkable.py":113
3075 * # calling it in the common case in _wait_core (even so, the number of
3076 * # waiters should usually be pretty small)
3077 * self._links = [] # <<<<<<<<<<<<<<
3078 * self._notifier = None
3079 * # This is conceptually a class attribute, defined here for ease of access in
3080 */
3081 __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 113, __pyx_L1_error)
3082 __Pyx_GOTREF(__pyx_t_1);
3083 __Pyx_GIVEREF(__pyx_t_1);
3084 __Pyx_GOTREF(__pyx_v_self->_links);
3085 __Pyx_DECREF(__pyx_v_self->_links);
3086 __pyx_v_self->_links = ((PyObject*)__pyx_t_1);
3087 __pyx_t_1 = 0;
3088
3089 /* "src/gevent/_abstract_linkable.py":114
3090 * # waiters should usually be pretty small)
3091 * self._links = []
3092 * self._notifier = None # <<<<<<<<<<<<<<
3093 * # This is conceptually a class attribute, defined here for ease of access in
3094 * # cython. If it's true, when notifiers fire, all existing callbacks are called.
3095 */
3096 __Pyx_INCREF(Py_None);
3097 __Pyx_GIVEREF(Py_None);
3098 __Pyx_GOTREF(__pyx_v_self->_notifier);
3099 __Pyx_DECREF(__pyx_v_self->_notifier);
3100 __pyx_v_self->_notifier = Py_None;
3101
3102 /* "src/gevent/_abstract_linkable.py":118
3103 * # cython. If it's true, when notifiers fire, all existing callbacks are called.
3104 * # If its false, we only call callbacks as long as ready() returns true.
3105 * self._notify_all = True # <<<<<<<<<<<<<<
3106 * # we don't want to do get_hub() here to allow defining module-level objects
3107 * # without initializing the hub. However, for multiple-thread safety, as soon
3108 */
3109 __pyx_v_self->_notify_all = 1;
3110
3111 /* "src/gevent/_abstract_linkable.py":127
3112 * # the main thread's hub, the two worker threads would have a dependency on it, meaning that
3113 * # if the main event loop is blocked, the worker threads might get blocked too.
3114 * self.hub = hub # <<<<<<<<<<<<<<
3115 *
3116 * def linkcount(self):
3117 */
3118 if (!(likely(((__pyx_v_hub) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_hub, __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 127, __pyx_L1_error)
3119 __pyx_t_1 = __pyx_v_hub;
3120 __Pyx_INCREF(__pyx_t_1);
3121 __Pyx_GIVEREF(__pyx_t_1);
3122 __Pyx_GOTREF((PyObject *)__pyx_v_self->hub);
3123 __Pyx_DECREF((PyObject *)__pyx_v_self->hub);
3124 __pyx_v_self->hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
3125 __pyx_t_1 = 0;
3126
3127 /* "src/gevent/_abstract_linkable.py":88
3128 * )
3129 *
3130 * def __init__(self, hub=None): # <<<<<<<<<<<<<<
3131 * # Before this implementation, AsyncResult and Semaphore
3132 * # maintained the order of notifications, but Event did not.
3133 */
3134
3135 /* function exit code */
3136 __pyx_r = 0;
3137 goto __pyx_L0;
3138 __pyx_L1_error:;
3139 __Pyx_XDECREF(__pyx_t_1);
3140 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3141 __pyx_r = -1;
3142 __pyx_L0:;
3143 __Pyx_RefNannyFinishContext();
3144 return __pyx_r;
3145 }
3146
3147 /* "src/gevent/_abstract_linkable.py":129
3148 * self.hub = hub
3149 *
3150 * def linkcount(self): # <<<<<<<<<<<<<<
3151 * # For testing: how many objects are linked to this one?
3152 * return len(self._links)
3153 */
3154
3155 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_linkcount(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,int __pyx_skip_dispatch)3156 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_linkcount(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
3157 PyObject *__pyx_r = NULL;
3158 __Pyx_RefNannyDeclarations
3159 PyObject *__pyx_t_1 = NULL;
3160 PyObject *__pyx_t_2 = NULL;
3161 PyObject *__pyx_t_3 = NULL;
3162 PyObject *__pyx_t_4 = NULL;
3163 int __pyx_t_5;
3164 Py_ssize_t __pyx_t_6;
3165 int __pyx_lineno = 0;
3166 const char *__pyx_filename = NULL;
3167 int __pyx_clineno = 0;
3168 __Pyx_RefNannySetupContext("linkcount", 0);
3169 /* Check if called by wrapper */
3170 if (unlikely(__pyx_skip_dispatch)) ;
3171 /* Check if overridden in Python */
3172 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3173 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3174 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3175 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3176 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3177 #endif
3178 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_linkcount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3179 __Pyx_GOTREF(__pyx_t_1);
3180 #ifdef __Pyx_CyFunction_USED
3181 if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
3182 #else
3183 if (!PyCFunction_Check(__pyx_t_1)
3184 #endif
3185 || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount)) {
3186 __Pyx_XDECREF(__pyx_r);
3187 __Pyx_INCREF(__pyx_t_1);
3188 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
3189 __pyx_t_5 = 0;
3190 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3191 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3192 if (likely(__pyx_t_4)) {
3193 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3194 __Pyx_INCREF(__pyx_t_4);
3195 __Pyx_INCREF(function);
3196 __Pyx_DECREF_SET(__pyx_t_3, function);
3197 __pyx_t_5 = 1;
3198 }
3199 }
3200 {
3201 PyObject *__pyx_callargs[1] = {__pyx_t_4, };
3202 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
3203 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3204 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
3205 __Pyx_GOTREF(__pyx_t_2);
3206 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3207 }
3208 __pyx_r = __pyx_t_2;
3209 __pyx_t_2 = 0;
3210 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3211 goto __pyx_L0;
3212 }
3213 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3214 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3215 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3216 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
3217 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3218 }
3219 #endif
3220 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3221 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3222 }
3223 #endif
3224 }
3225
3226 /* "src/gevent/_abstract_linkable.py":131
3227 * def linkcount(self):
3228 * # For testing: how many objects are linked to this one?
3229 * return len(self._links) # <<<<<<<<<<<<<<
3230 *
3231 * def ready(self):
3232 */
3233 __Pyx_XDECREF(__pyx_r);
3234 __pyx_t_1 = __pyx_v_self->_links;
3235 __Pyx_INCREF(__pyx_t_1);
3236 if (unlikely(__pyx_t_1 == Py_None)) {
3237 PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
3238 __PYX_ERR(0, 131, __pyx_L1_error)
3239 }
3240 __pyx_t_6 = PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 131, __pyx_L1_error)
3241 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3242 __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 131, __pyx_L1_error)
3243 __Pyx_GOTREF(__pyx_t_1);
3244 __pyx_r = __pyx_t_1;
3245 __pyx_t_1 = 0;
3246 goto __pyx_L0;
3247
3248 /* "src/gevent/_abstract_linkable.py":129
3249 * self.hub = hub
3250 *
3251 * def linkcount(self): # <<<<<<<<<<<<<<
3252 * # For testing: how many objects are linked to this one?
3253 * return len(self._links)
3254 */
3255
3256 /* function exit code */
3257 __pyx_L1_error:;
3258 __Pyx_XDECREF(__pyx_t_1);
3259 __Pyx_XDECREF(__pyx_t_2);
3260 __Pyx_XDECREF(__pyx_t_3);
3261 __Pyx_XDECREF(__pyx_t_4);
3262 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.linkcount", __pyx_clineno, __pyx_lineno, __pyx_filename);
3263 __pyx_r = 0;
3264 __pyx_L0:;
3265 __Pyx_XGIVEREF(__pyx_r);
3266 __Pyx_RefNannyFinishContext();
3267 return __pyx_r;
3268 }
3269
3270 /* Python wrapper */
3271 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3272 PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount, "AbstractLinkable.linkcount(self)");
3273 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount = {"linkcount", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3274 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3275 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
3276 PyObject *__pyx_r = 0;
3277 __Pyx_RefNannyDeclarations
3278 __Pyx_RefNannySetupContext("linkcount (wrapper)", 0);
3279 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));
3280
3281 /* function exit code */
3282 __Pyx_RefNannyFinishContext();
3283 return __pyx_r;
3284 }
3285
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)3286 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
3287 PyObject *__pyx_r = NULL;
3288 __Pyx_RefNannyDeclarations
3289 PyObject *__pyx_t_1 = NULL;
3290 int __pyx_lineno = 0;
3291 const char *__pyx_filename = NULL;
3292 int __pyx_clineno = 0;
3293 __Pyx_RefNannySetupContext("linkcount", 0);
3294 __Pyx_XDECREF(__pyx_r);
3295 __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_linkcount(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
3296 __Pyx_GOTREF(__pyx_t_1);
3297 __pyx_r = __pyx_t_1;
3298 __pyx_t_1 = 0;
3299 goto __pyx_L0;
3300
3301 /* function exit code */
3302 __pyx_L1_error:;
3303 __Pyx_XDECREF(__pyx_t_1);
3304 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.linkcount", __pyx_clineno, __pyx_lineno, __pyx_filename);
3305 __pyx_r = NULL;
3306 __pyx_L0:;
3307 __Pyx_XGIVEREF(__pyx_r);
3308 __Pyx_RefNannyFinishContext();
3309 return __pyx_r;
3310 }
3311
3312 /* "src/gevent/_abstract_linkable.py":133
3313 * return len(self._links)
3314 *
3315 * def ready(self): # <<<<<<<<<<<<<<
3316 * # Instances must define this
3317 * raise NotImplementedError
3318 */
3319
3320 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,int __pyx_skip_dispatch)3321 static int __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
3322 int __pyx_r;
3323 __Pyx_RefNannyDeclarations
3324 PyObject *__pyx_t_1 = NULL;
3325 PyObject *__pyx_t_2 = NULL;
3326 PyObject *__pyx_t_3 = NULL;
3327 PyObject *__pyx_t_4 = NULL;
3328 int __pyx_t_5;
3329 int __pyx_t_6;
3330 int __pyx_lineno = 0;
3331 const char *__pyx_filename = NULL;
3332 int __pyx_clineno = 0;
3333 __Pyx_RefNannySetupContext("ready", 0);
3334 /* Check if called by wrapper */
3335 if (unlikely(__pyx_skip_dispatch)) ;
3336 /* Check if overridden in Python */
3337 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3338 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3339 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3340 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3341 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3342 #endif
3343 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
3344 __Pyx_GOTREF(__pyx_t_1);
3345 #ifdef __Pyx_CyFunction_USED
3346 if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
3347 #else
3348 if (!PyCFunction_Check(__pyx_t_1)
3349 #endif
3350 || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready)) {
3351 __Pyx_INCREF(__pyx_t_1);
3352 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
3353 __pyx_t_5 = 0;
3354 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3355 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3356 if (likely(__pyx_t_4)) {
3357 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3358 __Pyx_INCREF(__pyx_t_4);
3359 __Pyx_INCREF(function);
3360 __Pyx_DECREF_SET(__pyx_t_3, function);
3361 __pyx_t_5 = 1;
3362 }
3363 }
3364 {
3365 PyObject *__pyx_callargs[1] = {__pyx_t_4, };
3366 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
3367 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3368 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
3369 __Pyx_GOTREF(__pyx_t_2);
3370 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3371 }
3372 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 133, __pyx_L1_error)
3373 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3374 __pyx_r = __pyx_t_6;
3375 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3376 goto __pyx_L0;
3377 }
3378 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3379 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3380 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3381 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
3382 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3383 }
3384 #endif
3385 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3386 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3387 }
3388 #endif
3389 }
3390
3391 /* "src/gevent/_abstract_linkable.py":135
3392 * def ready(self):
3393 * # Instances must define this
3394 * raise NotImplementedError # <<<<<<<<<<<<<<
3395 *
3396 * def rawlink(self, callback):
3397 */
3398 __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
3399 __PYX_ERR(0, 135, __pyx_L1_error)
3400
3401 /* "src/gevent/_abstract_linkable.py":133
3402 * return len(self._links)
3403 *
3404 * def ready(self): # <<<<<<<<<<<<<<
3405 * # Instances must define this
3406 * raise NotImplementedError
3407 */
3408
3409 /* function exit code */
3410 __pyx_L1_error:;
3411 __Pyx_XDECREF(__pyx_t_1);
3412 __Pyx_XDECREF(__pyx_t_2);
3413 __Pyx_XDECREF(__pyx_t_3);
3414 __Pyx_XDECREF(__pyx_t_4);
3415 __Pyx_WriteUnraisable("gevent._gevent_c_abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
3416 __pyx_r = 0;
3417 __pyx_L0:;
3418 __Pyx_RefNannyFinishContext();
3419 return __pyx_r;
3420 }
3421
3422 /* Python wrapper */
3423 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3424 PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready, "AbstractLinkable.ready(self) -> bool");
3425 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)3426 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3427 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
3428 PyObject *__pyx_r = 0;
3429 __Pyx_RefNannyDeclarations
3430 __Pyx_RefNannySetupContext("ready (wrapper)", 0);
3431 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));
3432
3433 /* function exit code */
3434 __Pyx_RefNannyFinishContext();
3435 return __pyx_r;
3436 }
3437
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)3438 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
3439 PyObject *__pyx_r = NULL;
3440 __Pyx_RefNannyDeclarations
3441 PyObject *__pyx_t_1 = NULL;
3442 int __pyx_lineno = 0;
3443 const char *__pyx_filename = NULL;
3444 int __pyx_clineno = 0;
3445 __Pyx_RefNannySetupContext("ready", 0);
3446 __Pyx_XDECREF(__pyx_r);
3447 __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_ready(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
3448 __Pyx_GOTREF(__pyx_t_1);
3449 __pyx_r = __pyx_t_1;
3450 __pyx_t_1 = 0;
3451 goto __pyx_L0;
3452
3453 /* function exit code */
3454 __pyx_L1_error:;
3455 __Pyx_XDECREF(__pyx_t_1);
3456 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
3457 __pyx_r = NULL;
3458 __pyx_L0:;
3459 __Pyx_XGIVEREF(__pyx_r);
3460 __Pyx_RefNannyFinishContext();
3461 return __pyx_r;
3462 }
3463
3464 /* "src/gevent/_abstract_linkable.py":137
3465 * raise NotImplementedError
3466 *
3467 * def rawlink(self, callback): # <<<<<<<<<<<<<<
3468 * """
3469 * Register a callback to call when this object is ready.
3470 */
3471
3472 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_callback,int __pyx_skip_dispatch)3473 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
3474 PyObject *__pyx_r = NULL;
3475 __Pyx_RefNannyDeclarations
3476 PyObject *__pyx_t_1 = NULL;
3477 PyObject *__pyx_t_2 = NULL;
3478 PyObject *__pyx_t_3 = NULL;
3479 PyObject *__pyx_t_4 = NULL;
3480 int __pyx_t_5;
3481 int __pyx_t_6;
3482 int __pyx_t_7;
3483 int __pyx_t_8;
3484 int __pyx_lineno = 0;
3485 const char *__pyx_filename = NULL;
3486 int __pyx_clineno = 0;
3487 __Pyx_RefNannySetupContext("rawlink", 0);
3488 /* Check if called by wrapper */
3489 if (unlikely(__pyx_skip_dispatch)) ;
3490 /* Check if overridden in Python */
3491 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3492 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3493 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3494 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3495 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3496 #endif
3497 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
3498 __Pyx_GOTREF(__pyx_t_1);
3499 #ifdef __Pyx_CyFunction_USED
3500 if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
3501 #else
3502 if (!PyCFunction_Check(__pyx_t_1)
3503 #endif
3504 || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink)) {
3505 __Pyx_XDECREF(__pyx_r);
3506 __Pyx_INCREF(__pyx_t_1);
3507 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
3508 __pyx_t_5 = 0;
3509 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3510 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3511 if (likely(__pyx_t_4)) {
3512 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3513 __Pyx_INCREF(__pyx_t_4);
3514 __Pyx_INCREF(function);
3515 __Pyx_DECREF_SET(__pyx_t_3, function);
3516 __pyx_t_5 = 1;
3517 }
3518 }
3519 {
3520 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_callback};
3521 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
3522 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3523 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
3524 __Pyx_GOTREF(__pyx_t_2);
3525 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3526 }
3527 __pyx_r = __pyx_t_2;
3528 __pyx_t_2 = 0;
3529 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3530 goto __pyx_L0;
3531 }
3532 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3533 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3534 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3535 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
3536 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3537 }
3538 #endif
3539 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3540 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3541 }
3542 #endif
3543 }
3544
3545 /* "src/gevent/_abstract_linkable.py":145
3546 * *callback* will be passed one argument: this instance.
3547 * """
3548 * if not callable(callback): # <<<<<<<<<<<<<<
3549 * raise TypeError('Expected callable: %r' % (callback, ))
3550 * self._links.append(callback)
3551 */
3552 __pyx_t_6 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 145, __pyx_L1_error)
3553 __pyx_t_7 = ((!(__pyx_t_6 != 0)) != 0);
3554 if (unlikely(__pyx_t_7)) {
3555
3556 /* "src/gevent/_abstract_linkable.py":146
3557 * """
3558 * if not callable(callback):
3559 * raise TypeError('Expected callable: %r' % (callback, )) # <<<<<<<<<<<<<<
3560 * self._links.append(callback)
3561 * self._check_and_notify()
3562 */
3563 __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
3564 __Pyx_GOTREF(__pyx_t_1);
3565 __Pyx_INCREF(__pyx_v_callback);
3566 __Pyx_GIVEREF(__pyx_v_callback);
3567 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_callback);
3568 __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
3569 __Pyx_GOTREF(__pyx_t_2);
3570 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3571 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
3572 __Pyx_GOTREF(__pyx_t_1);
3573 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3574 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
3575 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3576 __PYX_ERR(0, 146, __pyx_L1_error)
3577
3578 /* "src/gevent/_abstract_linkable.py":145
3579 * *callback* will be passed one argument: this instance.
3580 * """
3581 * if not callable(callback): # <<<<<<<<<<<<<<
3582 * raise TypeError('Expected callable: %r' % (callback, ))
3583 * self._links.append(callback)
3584 */
3585 }
3586
3587 /* "src/gevent/_abstract_linkable.py":147
3588 * if not callable(callback):
3589 * raise TypeError('Expected callable: %r' % (callback, ))
3590 * self._links.append(callback) # <<<<<<<<<<<<<<
3591 * self._check_and_notify()
3592 *
3593 */
3594 if (unlikely(__pyx_v_self->_links == Py_None)) {
3595 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
3596 __PYX_ERR(0, 147, __pyx_L1_error)
3597 }
3598 __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 147, __pyx_L1_error)
3599
3600 /* "src/gevent/_abstract_linkable.py":148
3601 * raise TypeError('Expected callable: %r' % (callback, ))
3602 * self._links.append(callback)
3603 * self._check_and_notify() # <<<<<<<<<<<<<<
3604 *
3605 * def unlink(self, callback):
3606 */
3607 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
3608 __Pyx_GOTREF(__pyx_t_1);
3609 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3610
3611 /* "src/gevent/_abstract_linkable.py":137
3612 * raise NotImplementedError
3613 *
3614 * def rawlink(self, callback): # <<<<<<<<<<<<<<
3615 * """
3616 * Register a callback to call when this object is ready.
3617 */
3618
3619 /* function exit code */
3620 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3621 goto __pyx_L0;
3622 __pyx_L1_error:;
3623 __Pyx_XDECREF(__pyx_t_1);
3624 __Pyx_XDECREF(__pyx_t_2);
3625 __Pyx_XDECREF(__pyx_t_3);
3626 __Pyx_XDECREF(__pyx_t_4);
3627 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
3628 __pyx_r = 0;
3629 __pyx_L0:;
3630 __Pyx_XGIVEREF(__pyx_r);
3631 __Pyx_RefNannyFinishContext();
3632 return __pyx_r;
3633 }
3634
3635 /* Python wrapper */
3636 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
3637 PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink, "AbstractLinkable.rawlink(self, callback)\n\n Register a callback to call when this object is ready.\n\n *callback* will be called in the :class:`Hub\n <gevent.hub.Hub>`, so it must not use blocking gevent API.\n *callback* will be passed one argument: this instance.\n ");
3638 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink, METH_O, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink(PyObject * __pyx_v_self,PyObject * __pyx_v_callback)3639 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
3640 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
3641 PyObject *__pyx_r = 0;
3642 __Pyx_RefNannyDeclarations
3643 __Pyx_RefNannySetupContext("rawlink (wrapper)", 0);
3644 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
3645
3646 /* function exit code */
3647 __Pyx_RefNannyFinishContext();
3648 return __pyx_r;
3649 }
3650
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_callback)3651 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) {
3652 PyObject *__pyx_r = NULL;
3653 __Pyx_RefNannyDeclarations
3654 PyObject *__pyx_t_1 = NULL;
3655 int __pyx_lineno = 0;
3656 const char *__pyx_filename = NULL;
3657 int __pyx_clineno = 0;
3658 __Pyx_RefNannySetupContext("rawlink", 0);
3659 __Pyx_XDECREF(__pyx_r);
3660 __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
3661 __Pyx_GOTREF(__pyx_t_1);
3662 __pyx_r = __pyx_t_1;
3663 __pyx_t_1 = 0;
3664 goto __pyx_L0;
3665
3666 /* function exit code */
3667 __pyx_L1_error:;
3668 __Pyx_XDECREF(__pyx_t_1);
3669 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
3670 __pyx_r = NULL;
3671 __pyx_L0:;
3672 __Pyx_XGIVEREF(__pyx_r);
3673 __Pyx_RefNannyFinishContext();
3674 return __pyx_r;
3675 }
3676
3677 /* "src/gevent/_abstract_linkable.py":150
3678 * self._check_and_notify()
3679 *
3680 * def unlink(self, callback): # <<<<<<<<<<<<<<
3681 * """Remove the callback set by :meth:`rawlink`"""
3682 * try:
3683 */
3684
3685 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_callback,int __pyx_skip_dispatch)3686 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
3687 PyObject *__pyx_r = NULL;
3688 __Pyx_RefNannyDeclarations
3689 PyObject *__pyx_t_1 = NULL;
3690 PyObject *__pyx_t_2 = NULL;
3691 PyObject *__pyx_t_3 = NULL;
3692 PyObject *__pyx_t_4 = NULL;
3693 int __pyx_t_5;
3694 PyObject *__pyx_t_6 = NULL;
3695 PyObject *__pyx_t_7 = NULL;
3696 PyObject *__pyx_t_8 = NULL;
3697 int __pyx_t_9;
3698 int __pyx_t_10;
3699 int __pyx_t_11;
3700 int __pyx_lineno = 0;
3701 const char *__pyx_filename = NULL;
3702 int __pyx_clineno = 0;
3703 __Pyx_RefNannySetupContext("unlink", 0);
3704 /* Check if called by wrapper */
3705 if (unlikely(__pyx_skip_dispatch)) ;
3706 /* Check if overridden in Python */
3707 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
3708 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3709 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3710 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
3711 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3712 #endif
3713 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
3714 __Pyx_GOTREF(__pyx_t_1);
3715 #ifdef __Pyx_CyFunction_USED
3716 if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
3717 #else
3718 if (!PyCFunction_Check(__pyx_t_1)
3719 #endif
3720 || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink)) {
3721 __Pyx_XDECREF(__pyx_r);
3722 __Pyx_INCREF(__pyx_t_1);
3723 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
3724 __pyx_t_5 = 0;
3725 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3726 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
3727 if (likely(__pyx_t_4)) {
3728 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3729 __Pyx_INCREF(__pyx_t_4);
3730 __Pyx_INCREF(function);
3731 __Pyx_DECREF_SET(__pyx_t_3, function);
3732 __pyx_t_5 = 1;
3733 }
3734 }
3735 {
3736 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_callback};
3737 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
3738 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3739 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
3740 __Pyx_GOTREF(__pyx_t_2);
3741 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3742 }
3743 __pyx_r = __pyx_t_2;
3744 __pyx_t_2 = 0;
3745 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3746 goto __pyx_L0;
3747 }
3748 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3749 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
3750 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
3751 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
3752 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
3753 }
3754 #endif
3755 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3756 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
3757 }
3758 #endif
3759 }
3760
3761 /* "src/gevent/_abstract_linkable.py":152
3762 * def unlink(self, callback):
3763 * """Remove the callback set by :meth:`rawlink`"""
3764 * try: # <<<<<<<<<<<<<<
3765 * self._links.remove(callback)
3766 * except ValueError:
3767 */
3768 {
3769 __Pyx_PyThreadState_declare
3770 __Pyx_PyThreadState_assign
3771 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
3772 __Pyx_XGOTREF(__pyx_t_6);
3773 __Pyx_XGOTREF(__pyx_t_7);
3774 __Pyx_XGOTREF(__pyx_t_8);
3775 /*try:*/ {
3776
3777 /* "src/gevent/_abstract_linkable.py":153
3778 * """Remove the callback set by :meth:`rawlink`"""
3779 * try:
3780 * self._links.remove(callback) # <<<<<<<<<<<<<<
3781 * except ValueError:
3782 * pass
3783 */
3784 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_links, __pyx_n_s_remove); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L3_error)
3785 __Pyx_GOTREF(__pyx_t_2);
3786 __pyx_t_3 = NULL;
3787 __pyx_t_5 = 0;
3788 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3789 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3790 if (likely(__pyx_t_3)) {
3791 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3792 __Pyx_INCREF(__pyx_t_3);
3793 __Pyx_INCREF(function);
3794 __Pyx_DECREF_SET(__pyx_t_2, function);
3795 __pyx_t_5 = 1;
3796 }
3797 }
3798 {
3799 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_callback};
3800 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
3801 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3802 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L3_error)
3803 __Pyx_GOTREF(__pyx_t_1);
3804 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3805 }
3806 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3807
3808 /* "src/gevent/_abstract_linkable.py":152
3809 * def unlink(self, callback):
3810 * """Remove the callback set by :meth:`rawlink`"""
3811 * try: # <<<<<<<<<<<<<<
3812 * self._links.remove(callback)
3813 * except ValueError:
3814 */
3815 }
3816 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3817 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
3818 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
3819 goto __pyx_L8_try_end;
3820 __pyx_L3_error:;
3821 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
3822 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
3823 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3824 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
3825
3826 /* "src/gevent/_abstract_linkable.py":154
3827 * try:
3828 * self._links.remove(callback)
3829 * except ValueError: # <<<<<<<<<<<<<<
3830 * pass
3831 *
3832 */
3833 __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
3834 if (__pyx_t_5) {
3835 __Pyx_ErrRestore(0,0,0);
3836 goto __pyx_L4_exception_handled;
3837 }
3838 goto __pyx_L5_except_error;
3839 __pyx_L5_except_error:;
3840
3841 /* "src/gevent/_abstract_linkable.py":152
3842 * def unlink(self, callback):
3843 * """Remove the callback set by :meth:`rawlink`"""
3844 * try: # <<<<<<<<<<<<<<
3845 * self._links.remove(callback)
3846 * except ValueError:
3847 */
3848 __Pyx_XGIVEREF(__pyx_t_6);
3849 __Pyx_XGIVEREF(__pyx_t_7);
3850 __Pyx_XGIVEREF(__pyx_t_8);
3851 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3852 goto __pyx_L1_error;
3853 __pyx_L4_exception_handled:;
3854 __Pyx_XGIVEREF(__pyx_t_6);
3855 __Pyx_XGIVEREF(__pyx_t_7);
3856 __Pyx_XGIVEREF(__pyx_t_8);
3857 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
3858 __pyx_L8_try_end:;
3859 }
3860
3861 /* "src/gevent/_abstract_linkable.py":157
3862 * pass
3863 *
3864 * if not self._links and self._notifier is not None and self._notifier.pending: # <<<<<<<<<<<<<<
3865 * # If we currently have one queued, but not running, de-queue it.
3866 * # This will break a reference cycle.
3867 */
3868 __pyx_t_10 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
3869 __pyx_t_11 = ((!__pyx_t_10) != 0);
3870 if (__pyx_t_11) {
3871 } else {
3872 __pyx_t_9 = __pyx_t_11;
3873 goto __pyx_L10_bool_binop_done;
3874 }
3875 __pyx_t_11 = (__pyx_v_self->_notifier != Py_None);
3876 __pyx_t_10 = (__pyx_t_11 != 0);
3877 if (__pyx_t_10) {
3878 } else {
3879 __pyx_t_9 = __pyx_t_10;
3880 goto __pyx_L10_bool_binop_done;
3881 }
3882 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_pending); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
3883 __Pyx_GOTREF(__pyx_t_1);
3884 __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 157, __pyx_L1_error)
3885 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3886 __pyx_t_9 = __pyx_t_10;
3887 __pyx_L10_bool_binop_done:;
3888 if (__pyx_t_9) {
3889
3890 /* "src/gevent/_abstract_linkable.py":165
3891 * # so we don't attempt to start a fresh one or swap it out from underneath the
3892 * # _notify_links method.
3893 * self._notifier.stop() # <<<<<<<<<<<<<<
3894 *
3895 * def _allocate_lock(self):
3896 */
3897 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_stop); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 165, __pyx_L1_error)
3898 __Pyx_GOTREF(__pyx_t_2);
3899 __pyx_t_3 = NULL;
3900 __pyx_t_5 = 0;
3901 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3902 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
3903 if (likely(__pyx_t_3)) {
3904 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3905 __Pyx_INCREF(__pyx_t_3);
3906 __Pyx_INCREF(function);
3907 __Pyx_DECREF_SET(__pyx_t_2, function);
3908 __pyx_t_5 = 1;
3909 }
3910 }
3911 {
3912 PyObject *__pyx_callargs[1] = {__pyx_t_3, };
3913 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
3914 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3915 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
3916 __Pyx_GOTREF(__pyx_t_1);
3917 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3918 }
3919 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3920
3921 /* "src/gevent/_abstract_linkable.py":157
3922 * pass
3923 *
3924 * if not self._links and self._notifier is not None and self._notifier.pending: # <<<<<<<<<<<<<<
3925 * # If we currently have one queued, but not running, de-queue it.
3926 * # This will break a reference cycle.
3927 */
3928 }
3929
3930 /* "src/gevent/_abstract_linkable.py":150
3931 * self._check_and_notify()
3932 *
3933 * def unlink(self, callback): # <<<<<<<<<<<<<<
3934 * """Remove the callback set by :meth:`rawlink`"""
3935 * try:
3936 */
3937
3938 /* function exit code */
3939 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3940 goto __pyx_L0;
3941 __pyx_L1_error:;
3942 __Pyx_XDECREF(__pyx_t_1);
3943 __Pyx_XDECREF(__pyx_t_2);
3944 __Pyx_XDECREF(__pyx_t_3);
3945 __Pyx_XDECREF(__pyx_t_4);
3946 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
3947 __pyx_r = 0;
3948 __pyx_L0:;
3949 __Pyx_XGIVEREF(__pyx_r);
3950 __Pyx_RefNannyFinishContext();
3951 return __pyx_r;
3952 }
3953
3954 /* Python wrapper */
3955 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
3956 PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink, "AbstractLinkable.unlink(self, callback)\nRemove the callback set by :meth:`rawlink`");
3957 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink, METH_O, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink(PyObject * __pyx_v_self,PyObject * __pyx_v_callback)3958 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
3959 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
3960 PyObject *__pyx_r = 0;
3961 __Pyx_RefNannyDeclarations
3962 __Pyx_RefNannySetupContext("unlink (wrapper)", 0);
3963 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
3964
3965 /* function exit code */
3966 __Pyx_RefNannyFinishContext();
3967 return __pyx_r;
3968 }
3969
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_callback)3970 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) {
3971 PyObject *__pyx_r = NULL;
3972 __Pyx_RefNannyDeclarations
3973 PyObject *__pyx_t_1 = NULL;
3974 int __pyx_lineno = 0;
3975 const char *__pyx_filename = NULL;
3976 int __pyx_clineno = 0;
3977 __Pyx_RefNannySetupContext("unlink", 0);
3978 __Pyx_XDECREF(__pyx_r);
3979 __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_unlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
3980 __Pyx_GOTREF(__pyx_t_1);
3981 __pyx_r = __pyx_t_1;
3982 __pyx_t_1 = 0;
3983 goto __pyx_L0;
3984
3985 /* function exit code */
3986 __pyx_L1_error:;
3987 __Pyx_XDECREF(__pyx_t_1);
3988 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
3989 __pyx_r = NULL;
3990 __pyx_L0:;
3991 __Pyx_XGIVEREF(__pyx_r);
3992 __Pyx_RefNannyFinishContext();
3993 return __pyx_r;
3994 }
3995
3996 /* "src/gevent/_abstract_linkable.py":167
3997 * self._notifier.stop()
3998 *
3999 * def _allocate_lock(self): # <<<<<<<<<<<<<<
4000 * return _allocate_thread_lock()
4001 *
4002 */
4003
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__allocate_lock(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)4004 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__allocate_lock(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
4005 PyObject *__pyx_r = NULL;
4006 __Pyx_RefNannyDeclarations
4007 PyObject *__pyx_t_1 = NULL;
4008 PyObject *__pyx_t_2 = NULL;
4009 PyObject *__pyx_t_3 = NULL;
4010 int __pyx_t_4;
4011 int __pyx_lineno = 0;
4012 const char *__pyx_filename = NULL;
4013 int __pyx_clineno = 0;
4014 __Pyx_RefNannySetupContext("_allocate_lock", 0);
4015
4016 /* "src/gevent/_abstract_linkable.py":168
4017 *
4018 * def _allocate_lock(self):
4019 * return _allocate_thread_lock() # <<<<<<<<<<<<<<
4020 *
4021 * def _getcurrent(self):
4022 */
4023 __Pyx_XDECREF(__pyx_r);
4024 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_allocate_thread_lock); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 168, __pyx_L1_error)
4025 __Pyx_GOTREF(__pyx_t_2);
4026 __pyx_t_3 = NULL;
4027 __pyx_t_4 = 0;
4028 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4029 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4030 if (likely(__pyx_t_3)) {
4031 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4032 __Pyx_INCREF(__pyx_t_3);
4033 __Pyx_INCREF(function);
4034 __Pyx_DECREF_SET(__pyx_t_2, function);
4035 __pyx_t_4 = 1;
4036 }
4037 }
4038 {
4039 PyObject *__pyx_callargs[1] = {__pyx_t_3, };
4040 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
4041 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4042 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
4043 __Pyx_GOTREF(__pyx_t_1);
4044 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4045 }
4046 __pyx_r = __pyx_t_1;
4047 __pyx_t_1 = 0;
4048 goto __pyx_L0;
4049
4050 /* "src/gevent/_abstract_linkable.py":167
4051 * self._notifier.stop()
4052 *
4053 * def _allocate_lock(self): # <<<<<<<<<<<<<<
4054 * return _allocate_thread_lock()
4055 *
4056 */
4057
4058 /* function exit code */
4059 __pyx_L1_error:;
4060 __Pyx_XDECREF(__pyx_t_1);
4061 __Pyx_XDECREF(__pyx_t_2);
4062 __Pyx_XDECREF(__pyx_t_3);
4063 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._allocate_lock", __pyx_clineno, __pyx_lineno, __pyx_filename);
4064 __pyx_r = 0;
4065 __pyx_L0:;
4066 __Pyx_XGIVEREF(__pyx_r);
4067 __Pyx_RefNannyFinishContext();
4068 return __pyx_r;
4069 }
4070
4071 /* "src/gevent/_abstract_linkable.py":170
4072 * return _allocate_thread_lock()
4073 *
4074 * def _getcurrent(self): # <<<<<<<<<<<<<<
4075 * return getcurrent() # pylint:disable=undefined-variable
4076 *
4077 */
4078
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__getcurrent(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)4079 static PyGreenlet *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__getcurrent(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
4080 PyGreenlet *__pyx_r = NULL;
4081 __Pyx_RefNannyDeclarations
4082 PyObject *__pyx_t_1 = NULL;
4083 int __pyx_lineno = 0;
4084 const char *__pyx_filename = NULL;
4085 int __pyx_clineno = 0;
4086 __Pyx_RefNannySetupContext("_getcurrent", 0);
4087
4088 /* "src/gevent/_abstract_linkable.py":171
4089 *
4090 * def _getcurrent(self):
4091 * return getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<<
4092 *
4093 * def _get_thread_ident(self):
4094 */
4095 __Pyx_XDECREF((PyObject *)__pyx_r);
4096 __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
4097 __Pyx_GOTREF(__pyx_t_1);
4098 __pyx_r = ((PyGreenlet *)__pyx_t_1);
4099 __pyx_t_1 = 0;
4100 goto __pyx_L0;
4101
4102 /* "src/gevent/_abstract_linkable.py":170
4103 * return _allocate_thread_lock()
4104 *
4105 * def _getcurrent(self): # <<<<<<<<<<<<<<
4106 * return getcurrent() # pylint:disable=undefined-variable
4107 *
4108 */
4109
4110 /* function exit code */
4111 __pyx_L1_error:;
4112 __Pyx_XDECREF(__pyx_t_1);
4113 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename);
4114 __pyx_r = 0;
4115 __pyx_L0:;
4116 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4117 __Pyx_RefNannyFinishContext();
4118 return __pyx_r;
4119 }
4120
4121 /* "src/gevent/_abstract_linkable.py":173
4122 * return getcurrent() # pylint:disable=undefined-variable
4123 *
4124 * def _get_thread_ident(self): # <<<<<<<<<<<<<<
4125 * return _get_thread_ident()
4126 *
4127 */
4128
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__get_thread_ident(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)4129 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__get_thread_ident(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
4130 PyObject *__pyx_r = NULL;
4131 __Pyx_RefNannyDeclarations
4132 PyObject *__pyx_t_1 = NULL;
4133 PyObject *__pyx_t_2 = NULL;
4134 PyObject *__pyx_t_3 = NULL;
4135 int __pyx_t_4;
4136 int __pyx_lineno = 0;
4137 const char *__pyx_filename = NULL;
4138 int __pyx_clineno = 0;
4139 __Pyx_RefNannySetupContext("_get_thread_ident", 0);
4140
4141 /* "src/gevent/_abstract_linkable.py":174
4142 *
4143 * def _get_thread_ident(self):
4144 * return _get_thread_ident() # <<<<<<<<<<<<<<
4145 *
4146 * def _capture_hub(self, create):
4147 */
4148 __Pyx_XDECREF(__pyx_r);
4149 __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident);
4150 __pyx_t_2 = __pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident; __pyx_t_3 = NULL;
4151 __pyx_t_4 = 0;
4152 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4153 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
4154 if (likely(__pyx_t_3)) {
4155 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4156 __Pyx_INCREF(__pyx_t_3);
4157 __Pyx_INCREF(function);
4158 __Pyx_DECREF_SET(__pyx_t_2, function);
4159 __pyx_t_4 = 1;
4160 }
4161 }
4162 {
4163 PyObject *__pyx_callargs[1] = {__pyx_t_3, };
4164 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
4165 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4166 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
4167 __Pyx_GOTREF(__pyx_t_1);
4168 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4169 }
4170 __pyx_r = __pyx_t_1;
4171 __pyx_t_1 = 0;
4172 goto __pyx_L0;
4173
4174 /* "src/gevent/_abstract_linkable.py":173
4175 * return getcurrent() # pylint:disable=undefined-variable
4176 *
4177 * def _get_thread_ident(self): # <<<<<<<<<<<<<<
4178 * return _get_thread_ident()
4179 *
4180 */
4181
4182 /* function exit code */
4183 __pyx_L1_error:;
4184 __Pyx_XDECREF(__pyx_t_1);
4185 __Pyx_XDECREF(__pyx_t_2);
4186 __Pyx_XDECREF(__pyx_t_3);
4187 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._get_thread_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
4188 __pyx_r = 0;
4189 __pyx_L0:;
4190 __Pyx_XGIVEREF(__pyx_r);
4191 __Pyx_RefNannyFinishContext();
4192 return __pyx_r;
4193 }
4194
4195 /* "src/gevent/_abstract_linkable.py":176
4196 * return _get_thread_ident()
4197 *
4198 * def _capture_hub(self, create): # <<<<<<<<<<<<<<
4199 * # Subclasses should call this as the first action from any
4200 * # public method that could, in theory, block and switch
4201 */
4202
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__capture_hub(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,int __pyx_v_create)4203 static struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__capture_hub(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_v_create) {
4204 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_my_hub = NULL;
4205 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_current_hub = NULL;
4206 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL;
4207 __Pyx_RefNannyDeclarations
4208 PyObject *__pyx_t_1 = NULL;
4209 int __pyx_t_2;
4210 int __pyx_t_3;
4211 PyObject *__pyx_t_4 = NULL;
4212 int __pyx_t_5;
4213 PyObject *__pyx_t_6 = NULL;
4214 PyObject *__pyx_t_7 = NULL;
4215 int __pyx_t_8;
4216 PyObject *__pyx_t_9 = NULL;
4217 int __pyx_lineno = 0;
4218 const char *__pyx_filename = NULL;
4219 int __pyx_clineno = 0;
4220 __Pyx_RefNannySetupContext("_capture_hub", 0);
4221
4222 /* "src/gevent/_abstract_linkable.py":183
4223 *
4224 * # First, detect a dead hub and drop it.
4225 * while 1: # <<<<<<<<<<<<<<
4226 * my_hub = self.hub
4227 * if my_hub is None:
4228 */
4229 while (1) {
4230
4231 /* "src/gevent/_abstract_linkable.py":184
4232 * # First, detect a dead hub and drop it.
4233 * while 1:
4234 * my_hub = self.hub # <<<<<<<<<<<<<<
4235 * if my_hub is None:
4236 * break
4237 */
4238 __pyx_t_1 = ((PyObject *)__pyx_v_self->hub);
4239 __Pyx_INCREF(__pyx_t_1);
4240 __Pyx_XDECREF_SET(__pyx_v_my_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1));
4241 __pyx_t_1 = 0;
4242
4243 /* "src/gevent/_abstract_linkable.py":185
4244 * while 1:
4245 * my_hub = self.hub
4246 * if my_hub is None: # <<<<<<<<<<<<<<
4247 * break
4248 * if my_hub.dead: # dead is a property, could release GIL
4249 */
4250 __pyx_t_2 = (((PyObject *)__pyx_v_my_hub) == Py_None);
4251 __pyx_t_3 = (__pyx_t_2 != 0);
4252 if (__pyx_t_3) {
4253
4254 /* "src/gevent/_abstract_linkable.py":186
4255 * my_hub = self.hub
4256 * if my_hub is None:
4257 * break # <<<<<<<<<<<<<<
4258 * if my_hub.dead: # dead is a property, could release GIL
4259 * # back, holding GIL
4260 */
4261 goto __pyx_L4_break;
4262
4263 /* "src/gevent/_abstract_linkable.py":185
4264 * while 1:
4265 * my_hub = self.hub
4266 * if my_hub is None: # <<<<<<<<<<<<<<
4267 * break
4268 * if my_hub.dead: # dead is a property, could release GIL
4269 */
4270 }
4271
4272 /* "src/gevent/_abstract_linkable.py":187
4273 * if my_hub is None:
4274 * break
4275 * if my_hub.dead: # dead is a property, could release GIL # <<<<<<<<<<<<<<
4276 * # back, holding GIL
4277 * if self.hub is my_hub:
4278 */
4279 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_my_hub), __pyx_n_s_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
4280 __Pyx_GOTREF(__pyx_t_1);
4281 __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 187, __pyx_L1_error)
4282 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4283 if (__pyx_t_3) {
4284
4285 /* "src/gevent/_abstract_linkable.py":189
4286 * if my_hub.dead: # dead is a property, could release GIL
4287 * # back, holding GIL
4288 * if self.hub is my_hub: # <<<<<<<<<<<<<<
4289 * self.hub = None
4290 * my_hub = None
4291 */
4292 __pyx_t_3 = (__pyx_v_self->hub == __pyx_v_my_hub);
4293 __pyx_t_2 = (__pyx_t_3 != 0);
4294 if (__pyx_t_2) {
4295
4296 /* "src/gevent/_abstract_linkable.py":190
4297 * # back, holding GIL
4298 * if self.hub is my_hub:
4299 * self.hub = None # <<<<<<<<<<<<<<
4300 * my_hub = None
4301 * break
4302 */
4303 __Pyx_INCREF(Py_None);
4304 __Pyx_GIVEREF(Py_None);
4305 __Pyx_GOTREF((PyObject *)__pyx_v_self->hub);
4306 __Pyx_DECREF((PyObject *)__pyx_v_self->hub);
4307 __pyx_v_self->hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None);
4308
4309 /* "src/gevent/_abstract_linkable.py":191
4310 * if self.hub is my_hub:
4311 * self.hub = None
4312 * my_hub = None # <<<<<<<<<<<<<<
4313 * break
4314 * else:
4315 */
4316 __Pyx_INCREF(Py_None);
4317 __Pyx_DECREF_SET(__pyx_v_my_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None));
4318
4319 /* "src/gevent/_abstract_linkable.py":192
4320 * self.hub = None
4321 * my_hub = None
4322 * break # <<<<<<<<<<<<<<
4323 * else:
4324 * break
4325 */
4326 goto __pyx_L4_break;
4327
4328 /* "src/gevent/_abstract_linkable.py":189
4329 * if my_hub.dead: # dead is a property, could release GIL
4330 * # back, holding GIL
4331 * if self.hub is my_hub: # <<<<<<<<<<<<<<
4332 * self.hub = None
4333 * my_hub = None
4334 */
4335 }
4336
4337 /* "src/gevent/_abstract_linkable.py":187
4338 * if my_hub is None:
4339 * break
4340 * if my_hub.dead: # dead is a property, could release GIL # <<<<<<<<<<<<<<
4341 * # back, holding GIL
4342 * if self.hub is my_hub:
4343 */
4344 goto __pyx_L6;
4345 }
4346
4347 /* "src/gevent/_abstract_linkable.py":194
4348 * break
4349 * else:
4350 * break # <<<<<<<<<<<<<<
4351 *
4352 * if self.hub is None:
4353 */
4354 /*else*/ {
4355 goto __pyx_L4_break;
4356 }
4357 __pyx_L6:;
4358 }
4359 __pyx_L4_break:;
4360
4361 /* "src/gevent/_abstract_linkable.py":196
4362 * break
4363 *
4364 * if self.hub is None: # <<<<<<<<<<<<<<
4365 * # This next line might release the GIL.
4366 * current_hub = get_hub() if create else get_hub_if_exists()
4367 */
4368 __pyx_t_2 = (((PyObject *)__pyx_v_self->hub) == Py_None);
4369 __pyx_t_3 = (__pyx_t_2 != 0);
4370 if (__pyx_t_3) {
4371
4372 /* "src/gevent/_abstract_linkable.py":198
4373 * if self.hub is None:
4374 * # This next line might release the GIL.
4375 * current_hub = get_hub() if create else get_hub_if_exists() # <<<<<<<<<<<<<<
4376 *
4377 * # We have the GIL again. Did anything change? If so,
4378 */
4379 if ((__pyx_v_create != 0)) {
4380 __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
4381 __Pyx_GOTREF(__pyx_t_4);
4382 __pyx_t_1 = __pyx_t_4;
4383 __pyx_t_4 = 0;
4384 } else {
4385 __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
4386 __Pyx_GOTREF(__pyx_t_4);
4387 __pyx_t_1 = __pyx_t_4;
4388 __pyx_t_4 = 0;
4389 }
4390 __pyx_v_current_hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
4391 __pyx_t_1 = 0;
4392
4393 /* "src/gevent/_abstract_linkable.py":202
4394 * # We have the GIL again. Did anything change? If so,
4395 * # we lost the race.
4396 * if self.hub is None: # <<<<<<<<<<<<<<
4397 * self.hub = current_hub
4398 *
4399 */
4400 __pyx_t_3 = (((PyObject *)__pyx_v_self->hub) == Py_None);
4401 __pyx_t_2 = (__pyx_t_3 != 0);
4402 if (__pyx_t_2) {
4403
4404 /* "src/gevent/_abstract_linkable.py":203
4405 * # we lost the race.
4406 * if self.hub is None:
4407 * self.hub = current_hub # <<<<<<<<<<<<<<
4408 *
4409 * if self.hub is not None and self.hub.thread_ident != _get_thread_ident():
4410 */
4411 __Pyx_INCREF((PyObject *)__pyx_v_current_hub);
4412 __Pyx_GIVEREF((PyObject *)__pyx_v_current_hub);
4413 __Pyx_GOTREF((PyObject *)__pyx_v_self->hub);
4414 __Pyx_DECREF((PyObject *)__pyx_v_self->hub);
4415 __pyx_v_self->hub = __pyx_v_current_hub;
4416
4417 /* "src/gevent/_abstract_linkable.py":202
4418 * # We have the GIL again. Did anything change? If so,
4419 * # we lost the race.
4420 * if self.hub is None: # <<<<<<<<<<<<<<
4421 * self.hub = current_hub
4422 *
4423 */
4424 }
4425
4426 /* "src/gevent/_abstract_linkable.py":196
4427 * break
4428 *
4429 * if self.hub is None: # <<<<<<<<<<<<<<
4430 * # This next line might release the GIL.
4431 * current_hub = get_hub() if create else get_hub_if_exists()
4432 */
4433 }
4434
4435 /* "src/gevent/_abstract_linkable.py":205
4436 * self.hub = current_hub
4437 *
4438 * if self.hub is not None and self.hub.thread_ident != _get_thread_ident(): # <<<<<<<<<<<<<<
4439 * raise InvalidThreadUseError(
4440 * self.hub,
4441 */
4442 __pyx_t_3 = (((PyObject *)__pyx_v_self->hub) != Py_None);
4443 __pyx_t_5 = (__pyx_t_3 != 0);
4444 if (__pyx_t_5) {
4445 } else {
4446 __pyx_t_2 = __pyx_t_5;
4447 goto __pyx_L11_bool_binop_done;
4448 }
4449 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_thread_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 205, __pyx_L1_error)
4450 __Pyx_GOTREF(__pyx_t_1);
4451 __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident);
4452 __pyx_t_6 = __pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident; __pyx_t_7 = NULL;
4453 __pyx_t_8 = 0;
4454 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
4455 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
4456 if (likely(__pyx_t_7)) {
4457 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4458 __Pyx_INCREF(__pyx_t_7);
4459 __Pyx_INCREF(function);
4460 __Pyx_DECREF_SET(__pyx_t_6, function);
4461 __pyx_t_8 = 1;
4462 }
4463 }
4464 {
4465 PyObject *__pyx_callargs[1] = {__pyx_t_7, };
4466 __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_8, 0+__pyx_t_8);
4467 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4468 if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error)
4469 __Pyx_GOTREF(__pyx_t_4);
4470 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4471 }
4472 __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_4, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error)
4473 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4474 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4475 __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 205, __pyx_L1_error)
4476 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4477 __pyx_t_2 = __pyx_t_5;
4478 __pyx_L11_bool_binop_done:;
4479 if (unlikely(__pyx_t_2)) {
4480
4481 /* "src/gevent/_abstract_linkable.py":208
4482 * raise InvalidThreadUseError(
4483 * self.hub,
4484 * get_hub_if_exists(), # <<<<<<<<<<<<<<
4485 * getcurrent() # pylint:disable=undefined-variable
4486 * )
4487 */
4488 __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
4489 __Pyx_GOTREF(__pyx_t_4);
4490
4491 /* "src/gevent/_abstract_linkable.py":209
4492 * self.hub,
4493 * get_hub_if_exists(),
4494 * getcurrent() # pylint:disable=undefined-variable # <<<<<<<<<<<<<<
4495 * )
4496 * return self.hub
4497 */
4498 __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
4499 __Pyx_GOTREF(__pyx_t_1);
4500 __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError);
4501 __pyx_t_7 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError; __pyx_t_9 = NULL;
4502 __pyx_t_8 = 0;
4503 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
4504 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_7);
4505 if (likely(__pyx_t_9)) {
4506 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4507 __Pyx_INCREF(__pyx_t_9);
4508 __Pyx_INCREF(function);
4509 __Pyx_DECREF_SET(__pyx_t_7, function);
4510 __pyx_t_8 = 1;
4511 }
4512 }
4513 {
4514 PyObject *__pyx_callargs[4] = {__pyx_t_9, ((PyObject *)__pyx_v_self->hub), __pyx_t_4, __pyx_t_1};
4515 __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_8, 3+__pyx_t_8);
4516 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4517 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4518 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4519 if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 206, __pyx_L1_error)
4520 __Pyx_GOTREF(__pyx_t_6);
4521 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4522 }
4523 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
4524 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4525 __PYX_ERR(0, 206, __pyx_L1_error)
4526
4527 /* "src/gevent/_abstract_linkable.py":205
4528 * self.hub = current_hub
4529 *
4530 * if self.hub is not None and self.hub.thread_ident != _get_thread_ident(): # <<<<<<<<<<<<<<
4531 * raise InvalidThreadUseError(
4532 * self.hub,
4533 */
4534 }
4535
4536 /* "src/gevent/_abstract_linkable.py":211
4537 * getcurrent() # pylint:disable=undefined-variable
4538 * )
4539 * return self.hub # <<<<<<<<<<<<<<
4540 *
4541 * def _check_and_notify(self):
4542 */
4543 __Pyx_XDECREF((PyObject *)__pyx_r);
4544 __Pyx_INCREF((PyObject *)__pyx_v_self->hub);
4545 __pyx_r = __pyx_v_self->hub;
4546 goto __pyx_L0;
4547
4548 /* "src/gevent/_abstract_linkable.py":176
4549 * return _get_thread_ident()
4550 *
4551 * def _capture_hub(self, create): # <<<<<<<<<<<<<<
4552 * # Subclasses should call this as the first action from any
4553 * # public method that could, in theory, block and switch
4554 */
4555
4556 /* function exit code */
4557 __pyx_L1_error:;
4558 __Pyx_XDECREF(__pyx_t_1);
4559 __Pyx_XDECREF(__pyx_t_4);
4560 __Pyx_XDECREF(__pyx_t_6);
4561 __Pyx_XDECREF(__pyx_t_7);
4562 __Pyx_XDECREF(__pyx_t_9);
4563 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._capture_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
4564 __pyx_r = 0;
4565 __pyx_L0:;
4566 __Pyx_XDECREF((PyObject *)__pyx_v_my_hub);
4567 __Pyx_XDECREF((PyObject *)__pyx_v_current_hub);
4568 __Pyx_XGIVEREF((PyObject *)__pyx_r);
4569 __Pyx_RefNannyFinishContext();
4570 return __pyx_r;
4571 }
4572
4573 /* "src/gevent/_abstract_linkable.py":213
4574 * return self.hub
4575 *
4576 * def _check_and_notify(self): # <<<<<<<<<<<<<<
4577 * # If this object is ready to be notified, begin the process.
4578 * if self.ready() and self._links and not self._notifier:
4579 */
4580
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)4581 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
4582 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
4583 PyObject *__pyx_r = NULL;
4584 __Pyx_RefNannyDeclarations
4585 int __pyx_t_1;
4586 int __pyx_t_2;
4587 int __pyx_t_3;
4588 PyObject *__pyx_t_4 = NULL;
4589 PyObject *__pyx_t_5 = NULL;
4590 PyObject *__pyx_t_6 = NULL;
4591 PyObject *__pyx_t_7 = NULL;
4592 int __pyx_t_8;
4593 PyObject *__pyx_t_9 = NULL;
4594 PyObject *__pyx_t_10 = NULL;
4595 PyObject *__pyx_t_11 = NULL;
4596 PyObject *__pyx_t_12 = NULL;
4597 int __pyx_t_13;
4598 char const *__pyx_t_14;
4599 PyObject *__pyx_t_15 = NULL;
4600 PyObject *__pyx_t_16 = NULL;
4601 PyObject *__pyx_t_17 = NULL;
4602 int __pyx_lineno = 0;
4603 const char *__pyx_filename = NULL;
4604 int __pyx_clineno = 0;
4605 __Pyx_RefNannySetupContext("_check_and_notify", 0);
4606
4607 /* "src/gevent/_abstract_linkable.py":215
4608 * def _check_and_notify(self):
4609 * # If this object is ready to be notified, begin the process.
4610 * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<<
4611 * hub = None
4612 * try:
4613 */
4614 __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
4615 if (__pyx_t_2) {
4616 } else {
4617 __pyx_t_1 = __pyx_t_2;
4618 goto __pyx_L4_bool_binop_done;
4619 }
4620 __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_links) != 0);
4621 if (__pyx_t_2) {
4622 } else {
4623 __pyx_t_1 = __pyx_t_2;
4624 goto __pyx_L4_bool_binop_done;
4625 }
4626 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 215, __pyx_L1_error)
4627 __pyx_t_3 = ((!__pyx_t_2) != 0);
4628 __pyx_t_1 = __pyx_t_3;
4629 __pyx_L4_bool_binop_done:;
4630 if (__pyx_t_1) {
4631
4632 /* "src/gevent/_abstract_linkable.py":216
4633 * # If this object is ready to be notified, begin the process.
4634 * if self.ready() and self._links and not self._notifier:
4635 * hub = None # <<<<<<<<<<<<<<
4636 * try:
4637 * hub = self._capture_hub(False) # Must create, we need it.
4638 */
4639 __Pyx_INCREF(Py_None);
4640 __pyx_v_hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None);
4641
4642 /* "src/gevent/_abstract_linkable.py":217
4643 * if self.ready() and self._links and not self._notifier:
4644 * hub = None
4645 * try: # <<<<<<<<<<<<<<
4646 * hub = self._capture_hub(False) # Must create, we need it.
4647 * except InvalidThreadUseError:
4648 */
4649 {
4650 __Pyx_PyThreadState_declare
4651 __Pyx_PyThreadState_assign
4652 __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
4653 __Pyx_XGOTREF(__pyx_t_4);
4654 __Pyx_XGOTREF(__pyx_t_5);
4655 __Pyx_XGOTREF(__pyx_t_6);
4656 /*try:*/ {
4657
4658 /* "src/gevent/_abstract_linkable.py":218
4659 * hub = None
4660 * try:
4661 * hub = self._capture_hub(False) # Must create, we need it. # <<<<<<<<<<<<<<
4662 * except InvalidThreadUseError:
4663 * # The current hub doesn't match self.hub. That's OK,
4664 */
4665 __pyx_t_7 = ((PyObject *)((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_capture_hub(__pyx_v_self, 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 218, __pyx_L7_error)
4666 __Pyx_GOTREF(__pyx_t_7);
4667 __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_7));
4668 __pyx_t_7 = 0;
4669
4670 /* "src/gevent/_abstract_linkable.py":217
4671 * if self.ready() and self._links and not self._notifier:
4672 * hub = None
4673 * try: # <<<<<<<<<<<<<<
4674 * hub = self._capture_hub(False) # Must create, we need it.
4675 * except InvalidThreadUseError:
4676 */
4677 }
4678 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4679 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4680 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
4681 goto __pyx_L12_try_end;
4682 __pyx_L7_error:;
4683 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4684
4685 /* "src/gevent/_abstract_linkable.py":219
4686 * try:
4687 * hub = self._capture_hub(False) # Must create, we need it.
4688 * except InvalidThreadUseError: # <<<<<<<<<<<<<<
4689 * # The current hub doesn't match self.hub. That's OK,
4690 * # we still want to start the notifier in the thread running
4691 */
4692 __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError);
4693 if (__pyx_t_8) {
4694 __Pyx_ErrRestore(0,0,0);
4695 goto __pyx_L8_exception_handled;
4696 }
4697 goto __pyx_L9_except_error;
4698 __pyx_L9_except_error:;
4699
4700 /* "src/gevent/_abstract_linkable.py":217
4701 * if self.ready() and self._links and not self._notifier:
4702 * hub = None
4703 * try: # <<<<<<<<<<<<<<
4704 * hub = self._capture_hub(False) # Must create, we need it.
4705 * except InvalidThreadUseError:
4706 */
4707 __Pyx_XGIVEREF(__pyx_t_4);
4708 __Pyx_XGIVEREF(__pyx_t_5);
4709 __Pyx_XGIVEREF(__pyx_t_6);
4710 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
4711 goto __pyx_L1_error;
4712 __pyx_L8_exception_handled:;
4713 __Pyx_XGIVEREF(__pyx_t_4);
4714 __Pyx_XGIVEREF(__pyx_t_5);
4715 __Pyx_XGIVEREF(__pyx_t_6);
4716 __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
4717 __pyx_L12_try_end:;
4718 }
4719
4720 /* "src/gevent/_abstract_linkable.py":225
4721 * # calls valid only in that hub)
4722 * pass
4723 * if hub is not None: # <<<<<<<<<<<<<<
4724 * self._notifier = hub.loop.run_callback(self._notify_links, [])
4725 * else:
4726 */
4727 __pyx_t_1 = (((PyObject *)__pyx_v_hub) != Py_None);
4728 __pyx_t_3 = (__pyx_t_1 != 0);
4729 if (__pyx_t_3) {
4730
4731 /* "src/gevent/_abstract_linkable.py":226
4732 * pass
4733 * if hub is not None:
4734 * self._notifier = hub.loop.run_callback(self._notify_links, []) # <<<<<<<<<<<<<<
4735 * else:
4736 * # Hmm, no hub. We must be the only thing running. Then its OK
4737 */
4738 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_run_callback); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 226, __pyx_L1_error)
4739 __Pyx_GOTREF(__pyx_t_9);
4740 __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 226, __pyx_L1_error)
4741 __Pyx_GOTREF(__pyx_t_10);
4742 __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 226, __pyx_L1_error)
4743 __Pyx_GOTREF(__pyx_t_11);
4744 __pyx_t_12 = NULL;
4745 __pyx_t_8 = 0;
4746 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
4747 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_9);
4748 if (likely(__pyx_t_12)) {
4749 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
4750 __Pyx_INCREF(__pyx_t_12);
4751 __Pyx_INCREF(function);
4752 __Pyx_DECREF_SET(__pyx_t_9, function);
4753 __pyx_t_8 = 1;
4754 }
4755 }
4756 {
4757 PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_t_10, __pyx_t_11};
4758 __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_9, __pyx_callargs+1-__pyx_t_8, 2+__pyx_t_8);
4759 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4760 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4761 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4762 if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 226, __pyx_L1_error)
4763 __Pyx_GOTREF(__pyx_t_7);
4764 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4765 }
4766 __Pyx_GIVEREF(__pyx_t_7);
4767 __Pyx_GOTREF(__pyx_v_self->_notifier);
4768 __Pyx_DECREF(__pyx_v_self->_notifier);
4769 __pyx_v_self->_notifier = __pyx_t_7;
4770 __pyx_t_7 = 0;
4771
4772 /* "src/gevent/_abstract_linkable.py":225
4773 * # calls valid only in that hub)
4774 * pass
4775 * if hub is not None: # <<<<<<<<<<<<<<
4776 * self._notifier = hub.loop.run_callback(self._notify_links, [])
4777 * else:
4778 */
4779 goto __pyx_L13;
4780 }
4781
4782 /* "src/gevent/_abstract_linkable.py":230
4783 * # Hmm, no hub. We must be the only thing running. Then its OK
4784 * # to just directly call the callbacks.
4785 * self._notifier = 1 # <<<<<<<<<<<<<<
4786 * try:
4787 * self._notify_links([])
4788 */
4789 /*else*/ {
4790 __Pyx_INCREF(__pyx_int_1);
4791 __Pyx_GIVEREF(__pyx_int_1);
4792 __Pyx_GOTREF(__pyx_v_self->_notifier);
4793 __Pyx_DECREF(__pyx_v_self->_notifier);
4794 __pyx_v_self->_notifier = __pyx_int_1;
4795
4796 /* "src/gevent/_abstract_linkable.py":231
4797 * # to just directly call the callbacks.
4798 * self._notifier = 1
4799 * try: # <<<<<<<<<<<<<<
4800 * self._notify_links([])
4801 * finally:
4802 */
4803 /*try:*/ {
4804
4805 /* "src/gevent/_abstract_linkable.py":232
4806 * self._notifier = 1
4807 * try:
4808 * self._notify_links([]) # <<<<<<<<<<<<<<
4809 * finally:
4810 * self._notifier = None
4811 */
4812 __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 232, __pyx_L15_error)
4813 __Pyx_GOTREF(__pyx_t_7);
4814 __pyx_t_9 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_notify_links(__pyx_v_self, ((PyObject*)__pyx_t_7), 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 232, __pyx_L15_error)
4815 __Pyx_GOTREF(__pyx_t_9);
4816 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4817 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
4818 }
4819
4820 /* "src/gevent/_abstract_linkable.py":234
4821 * self._notify_links([])
4822 * finally:
4823 * self._notifier = None # <<<<<<<<<<<<<<
4824 *
4825 * def _notify_link_list(self, links):
4826 */
4827 /*finally:*/ {
4828 /*normal exit:*/{
4829 __Pyx_INCREF(Py_None);
4830 __Pyx_GIVEREF(Py_None);
4831 __Pyx_GOTREF(__pyx_v_self->_notifier);
4832 __Pyx_DECREF(__pyx_v_self->_notifier);
4833 __pyx_v_self->_notifier = Py_None;
4834 goto __pyx_L16;
4835 }
4836 __pyx_L15_error:;
4837 /*exception exit:*/{
4838 __Pyx_PyThreadState_declare
4839 __Pyx_PyThreadState_assign
4840 __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
4841 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
4842 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
4843 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
4844 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
4845 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
4846 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
4847 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
4848 __Pyx_XGOTREF(__pyx_t_6);
4849 __Pyx_XGOTREF(__pyx_t_5);
4850 __Pyx_XGOTREF(__pyx_t_4);
4851 __Pyx_XGOTREF(__pyx_t_15);
4852 __Pyx_XGOTREF(__pyx_t_16);
4853 __Pyx_XGOTREF(__pyx_t_17);
4854 __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
4855 {
4856 __Pyx_INCREF(Py_None);
4857 __Pyx_GIVEREF(Py_None);
4858 __Pyx_GOTREF(__pyx_v_self->_notifier);
4859 __Pyx_DECREF(__pyx_v_self->_notifier);
4860 __pyx_v_self->_notifier = Py_None;
4861 }
4862 if (PY_MAJOR_VERSION >= 3) {
4863 __Pyx_XGIVEREF(__pyx_t_15);
4864 __Pyx_XGIVEREF(__pyx_t_16);
4865 __Pyx_XGIVEREF(__pyx_t_17);
4866 __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
4867 }
4868 __Pyx_XGIVEREF(__pyx_t_6);
4869 __Pyx_XGIVEREF(__pyx_t_5);
4870 __Pyx_XGIVEREF(__pyx_t_4);
4871 __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
4872 __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
4873 __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
4874 goto __pyx_L1_error;
4875 }
4876 __pyx_L16:;
4877 }
4878 }
4879 __pyx_L13:;
4880
4881 /* "src/gevent/_abstract_linkable.py":215
4882 * def _check_and_notify(self):
4883 * # If this object is ready to be notified, begin the process.
4884 * if self.ready() and self._links and not self._notifier: # <<<<<<<<<<<<<<
4885 * hub = None
4886 * try:
4887 */
4888 }
4889
4890 /* "src/gevent/_abstract_linkable.py":213
4891 * return self.hub
4892 *
4893 * def _check_and_notify(self): # <<<<<<<<<<<<<<
4894 * # If this object is ready to be notified, begin the process.
4895 * if self.ready() and self._links and not self._notifier:
4896 */
4897
4898 /* function exit code */
4899 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4900 goto __pyx_L0;
4901 __pyx_L1_error:;
4902 __Pyx_XDECREF(__pyx_t_7);
4903 __Pyx_XDECREF(__pyx_t_9);
4904 __Pyx_XDECREF(__pyx_t_10);
4905 __Pyx_XDECREF(__pyx_t_11);
4906 __Pyx_XDECREF(__pyx_t_12);
4907 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._check_and_notify", __pyx_clineno, __pyx_lineno, __pyx_filename);
4908 __pyx_r = 0;
4909 __pyx_L0:;
4910 __Pyx_XDECREF((PyObject *)__pyx_v_hub);
4911 __Pyx_XGIVEREF(__pyx_r);
4912 __Pyx_RefNannyFinishContext();
4913 return __pyx_r;
4914 }
4915
4916 /* "src/gevent/_abstract_linkable.py":236
4917 * self._notifier = None
4918 *
4919 * def _notify_link_list(self, links): # <<<<<<<<<<<<<<
4920 * # The core of the _notify_links method to notify
4921 * # links in order. Lets the ``links`` list be mutated,
4922 */
4923
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_link_list(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_links)4924 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_link_list(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_links) {
4925 int __pyx_v_only_while_ready;
4926 PyObject *__pyx_v_final_link = NULL;
4927 PyObject *__pyx_v_done = NULL;
4928 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
4929 PyObject *__pyx_v_unswitched = NULL;
4930 PyObject *__pyx_v_link = NULL;
4931 PyObject *__pyx_v_id_link = NULL;
4932 PyObject *__pyx_v_traceback = NULL;
4933 PyObject *__pyx_r = NULL;
4934 __Pyx_RefNannyDeclarations
4935 int __pyx_t_1;
4936 int __pyx_t_2;
4937 PyObject *__pyx_t_3 = NULL;
4938 PyObject *__pyx_t_4 = NULL;
4939 int __pyx_t_5;
4940 PyObject *__pyx_t_6 = NULL;
4941 PyObject *__pyx_t_7 = NULL;
4942 PyObject *__pyx_t_8 = NULL;
4943 PyObject *__pyx_t_9 = NULL;
4944 PyObject *__pyx_t_10 = NULL;
4945 PyObject *__pyx_t_11 = NULL;
4946 PyObject *__pyx_t_12 = NULL;
4947 int __pyx_t_13;
4948 PyObject *__pyx_t_14 = NULL;
4949 int __pyx_t_15;
4950 char const *__pyx_t_16;
4951 PyObject *__pyx_t_17 = NULL;
4952 PyObject *__pyx_t_18 = NULL;
4953 PyObject *__pyx_t_19 = NULL;
4954 PyObject *__pyx_t_20 = NULL;
4955 PyObject *__pyx_t_21 = NULL;
4956 PyObject *__pyx_t_22 = NULL;
4957 PyObject *__pyx_t_23 = NULL;
4958 int __pyx_lineno = 0;
4959 const char *__pyx_filename = NULL;
4960 int __pyx_clineno = 0;
4961 __Pyx_RefNannySetupContext("_notify_link_list", 0);
4962
4963 /* "src/gevent/_abstract_linkable.py":241
4964 * # and only notifies up to the last item in the list, in case
4965 * # objects are added to it.
4966 * if not links: # <<<<<<<<<<<<<<
4967 * # HMM. How did we get here? Running two threads at once?
4968 * # Seen once on Py27/Win/Appveyor
4969 */
4970 __pyx_t_1 = (__pyx_v_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_links) != 0);
4971 __pyx_t_2 = ((!__pyx_t_1) != 0);
4972 if (__pyx_t_2) {
4973
4974 /* "src/gevent/_abstract_linkable.py":245
4975 * # Seen once on Py27/Win/Appveyor
4976 * # https://ci.appveyor.com/project/jamadden/gevent/builds/36875645/job/9wahj9ft4h4qa170
4977 * return [] # <<<<<<<<<<<<<<
4978 *
4979 * only_while_ready = not self._notify_all
4980 */
4981 __Pyx_XDECREF(__pyx_r);
4982 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 245, __pyx_L1_error)
4983 __Pyx_GOTREF(__pyx_t_3);
4984 __pyx_r = ((PyObject*)__pyx_t_3);
4985 __pyx_t_3 = 0;
4986 goto __pyx_L0;
4987
4988 /* "src/gevent/_abstract_linkable.py":241
4989 * # and only notifies up to the last item in the list, in case
4990 * # objects are added to it.
4991 * if not links: # <<<<<<<<<<<<<<
4992 * # HMM. How did we get here? Running two threads at once?
4993 * # Seen once on Py27/Win/Appveyor
4994 */
4995 }
4996
4997 /* "src/gevent/_abstract_linkable.py":247
4998 * return []
4999 *
5000 * only_while_ready = not self._notify_all # <<<<<<<<<<<<<<
5001 * final_link = links[-1]
5002 * done = set() # of ids
5003 */
5004 __pyx_v_only_while_ready = (!(__pyx_v_self->_notify_all != 0));
5005
5006 /* "src/gevent/_abstract_linkable.py":248
5007 *
5008 * only_while_ready = not self._notify_all
5009 * final_link = links[-1] # <<<<<<<<<<<<<<
5010 * done = set() # of ids
5011 * hub = self.hub if self.hub is not None else get_hub_if_exists()
5012 */
5013 if (unlikely(__pyx_v_links == Py_None)) {
5014 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5015 __PYX_ERR(0, 248, __pyx_L1_error)
5016 }
5017 __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyInt_From_long, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
5018 __Pyx_GOTREF(__pyx_t_3);
5019 __pyx_v_final_link = __pyx_t_3;
5020 __pyx_t_3 = 0;
5021
5022 /* "src/gevent/_abstract_linkable.py":249
5023 * only_while_ready = not self._notify_all
5024 * final_link = links[-1]
5025 * done = set() # of ids # <<<<<<<<<<<<<<
5026 * hub = self.hub if self.hub is not None else get_hub_if_exists()
5027 * unswitched = []
5028 */
5029 __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 249, __pyx_L1_error)
5030 __Pyx_GOTREF(__pyx_t_3);
5031 __pyx_v_done = ((PyObject*)__pyx_t_3);
5032 __pyx_t_3 = 0;
5033
5034 /* "src/gevent/_abstract_linkable.py":250
5035 * final_link = links[-1]
5036 * done = set() # of ids
5037 * hub = self.hub if self.hub is not None else get_hub_if_exists() # <<<<<<<<<<<<<<
5038 * unswitched = []
5039 * while links: # remember this can be mutated
5040 */
5041 __pyx_t_2 = (((PyObject *)__pyx_v_self->hub) != Py_None);
5042 if ((__pyx_t_2 != 0)) {
5043 __Pyx_INCREF((PyObject *)__pyx_v_self->hub);
5044 __pyx_t_3 = ((PyObject *)__pyx_v_self->hub);
5045 } else {
5046 __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
5047 __Pyx_GOTREF(__pyx_t_4);
5048 __pyx_t_3 = __pyx_t_4;
5049 __pyx_t_4 = 0;
5050 }
5051 __pyx_v_hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3);
5052 __pyx_t_3 = 0;
5053
5054 /* "src/gevent/_abstract_linkable.py":251
5055 * done = set() # of ids
5056 * hub = self.hub if self.hub is not None else get_hub_if_exists()
5057 * unswitched = [] # <<<<<<<<<<<<<<
5058 * while links: # remember this can be mutated
5059 * if only_while_ready and not self.ready():
5060 */
5061 __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
5062 __Pyx_GOTREF(__pyx_t_3);
5063 __pyx_v_unswitched = ((PyObject*)__pyx_t_3);
5064 __pyx_t_3 = 0;
5065
5066 /* "src/gevent/_abstract_linkable.py":252
5067 * hub = self.hub if self.hub is not None else get_hub_if_exists()
5068 * unswitched = []
5069 * while links: # remember this can be mutated # <<<<<<<<<<<<<<
5070 * if only_while_ready and not self.ready():
5071 * break
5072 */
5073 while (1) {
5074 __pyx_t_2 = (__pyx_v_links != Py_None)&&(PyList_GET_SIZE(__pyx_v_links) != 0);
5075 if (!__pyx_t_2) break;
5076
5077 /* "src/gevent/_abstract_linkable.py":253
5078 * unswitched = []
5079 * while links: # remember this can be mutated
5080 * if only_while_ready and not self.ready(): # <<<<<<<<<<<<<<
5081 * break
5082 *
5083 */
5084 __pyx_t_1 = (__pyx_v_only_while_ready != 0);
5085 if (__pyx_t_1) {
5086 } else {
5087 __pyx_t_2 = __pyx_t_1;
5088 goto __pyx_L7_bool_binop_done;
5089 }
5090 __pyx_t_1 = ((!(((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0)) != 0);
5091 __pyx_t_2 = __pyx_t_1;
5092 __pyx_L7_bool_binop_done:;
5093 if (__pyx_t_2) {
5094
5095 /* "src/gevent/_abstract_linkable.py":254
5096 * while links: # remember this can be mutated
5097 * if only_while_ready and not self.ready():
5098 * break # <<<<<<<<<<<<<<
5099 *
5100 * link = links.pop(0) # Cython optimizes using list internals
5101 */
5102 goto __pyx_L5_break;
5103
5104 /* "src/gevent/_abstract_linkable.py":253
5105 * unswitched = []
5106 * while links: # remember this can be mutated
5107 * if only_while_ready and not self.ready(): # <<<<<<<<<<<<<<
5108 * break
5109 *
5110 */
5111 }
5112
5113 /* "src/gevent/_abstract_linkable.py":256
5114 * break
5115 *
5116 * link = links.pop(0) # Cython optimizes using list internals # <<<<<<<<<<<<<<
5117 * id_link = id(link)
5118 * if id_link not in done:
5119 */
5120 if (unlikely(__pyx_v_links == Py_None)) {
5121 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
5122 __PYX_ERR(0, 256, __pyx_L1_error)
5123 }
5124 __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_links, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 256, __pyx_L1_error)
5125 __Pyx_GOTREF(__pyx_t_3);
5126 __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_3);
5127 __pyx_t_3 = 0;
5128
5129 /* "src/gevent/_abstract_linkable.py":257
5130 *
5131 * link = links.pop(0) # Cython optimizes using list internals
5132 * id_link = id(link) # <<<<<<<<<<<<<<
5133 * if id_link not in done:
5134 * # XXX: JAM: What was I thinking? This doesn't make much sense,
5135 */
5136 __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, __pyx_v_link); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 257, __pyx_L1_error)
5137 __Pyx_GOTREF(__pyx_t_3);
5138 __Pyx_XDECREF_SET(__pyx_v_id_link, __pyx_t_3);
5139 __pyx_t_3 = 0;
5140
5141 /* "src/gevent/_abstract_linkable.py":258
5142 * link = links.pop(0) # Cython optimizes using list internals
5143 * id_link = id(link)
5144 * if id_link not in done: # <<<<<<<<<<<<<<
5145 * # XXX: JAM: What was I thinking? This doesn't make much sense,
5146 * # there's a good chance `link` will be deallocated, and its id() will
5147 */
5148 __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_id_link, __pyx_v_done, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 258, __pyx_L1_error)
5149 __pyx_t_1 = (__pyx_t_2 != 0);
5150 if (__pyx_t_1) {
5151
5152 /* "src/gevent/_abstract_linkable.py":263
5153 * # be free to be reused. This also makes looping difficult, you have to
5154 * # create new functions inside a loop rather than just once outside the loop.
5155 * done.add(id_link) # <<<<<<<<<<<<<<
5156 * try:
5157 * self._drop_lock_for_switch_out()
5158 */
5159 __pyx_t_5 = PySet_Add(__pyx_v_done, __pyx_v_id_link); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 263, __pyx_L1_error)
5160
5161 /* "src/gevent/_abstract_linkable.py":264
5162 * # create new functions inside a loop rather than just once outside the loop.
5163 * done.add(id_link)
5164 * try: # <<<<<<<<<<<<<<
5165 * self._drop_lock_for_switch_out()
5166 * try:
5167 */
5168 {
5169 __Pyx_PyThreadState_declare
5170 __Pyx_PyThreadState_assign
5171 __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
5172 __Pyx_XGOTREF(__pyx_t_6);
5173 __Pyx_XGOTREF(__pyx_t_7);
5174 __Pyx_XGOTREF(__pyx_t_8);
5175 /*try:*/ {
5176
5177 /* "src/gevent/_abstract_linkable.py":265
5178 * done.add(id_link)
5179 * try:
5180 * self._drop_lock_for_switch_out() # <<<<<<<<<<<<<<
5181 * try:
5182 * link(self)
5183 */
5184 __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_drop_lock_for_switch_out(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 265, __pyx_L10_error)
5185 __Pyx_GOTREF(__pyx_t_3);
5186 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5187
5188 /* "src/gevent/_abstract_linkable.py":266
5189 * try:
5190 * self._drop_lock_for_switch_out()
5191 * try: # <<<<<<<<<<<<<<
5192 * link(self)
5193 * except greenlet_error:
5194 */
5195 /*try:*/ {
5196 {
5197 __Pyx_PyThreadState_declare
5198 __Pyx_PyThreadState_assign
5199 __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
5200 __Pyx_XGOTREF(__pyx_t_9);
5201 __Pyx_XGOTREF(__pyx_t_10);
5202 __Pyx_XGOTREF(__pyx_t_11);
5203 /*try:*/ {
5204
5205 /* "src/gevent/_abstract_linkable.py":267
5206 * self._drop_lock_for_switch_out()
5207 * try:
5208 * link(self) # <<<<<<<<<<<<<<
5209 * except greenlet_error:
5210 * # couldn't switch to a greenlet, we must be
5211 */
5212 __Pyx_INCREF(__pyx_v_link);
5213 __pyx_t_4 = __pyx_v_link; __pyx_t_12 = NULL;
5214 __pyx_t_13 = 0;
5215 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
5216 __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_4);
5217 if (likely(__pyx_t_12)) {
5218 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
5219 __Pyx_INCREF(__pyx_t_12);
5220 __Pyx_INCREF(function);
5221 __Pyx_DECREF_SET(__pyx_t_4, function);
5222 __pyx_t_13 = 1;
5223 }
5224 }
5225 {
5226 PyObject *__pyx_callargs[2] = {__pyx_t_12, ((PyObject *)__pyx_v_self)};
5227 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_13, 1+__pyx_t_13);
5228 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5229 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 267, __pyx_L23_error)
5230 __Pyx_GOTREF(__pyx_t_3);
5231 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5232 }
5233 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5234
5235 /* "src/gevent/_abstract_linkable.py":266
5236 * try:
5237 * self._drop_lock_for_switch_out()
5238 * try: # <<<<<<<<<<<<<<
5239 * link(self)
5240 * except greenlet_error:
5241 */
5242 }
5243 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5244 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5245 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5246 goto __pyx_L30_try_end;
5247 __pyx_L23_error:;
5248 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5249 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5250 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5251
5252 /* "src/gevent/_abstract_linkable.py":268
5253 * try:
5254 * link(self)
5255 * except greenlet_error: # <<<<<<<<<<<<<<
5256 * # couldn't switch to a greenlet, we must be
5257 * # running in a different thread. back on the list it goes for next time.
5258 */
5259 __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_12);
5260 __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_n_s_greenlet_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 268, __pyx_L25_except_error)
5261 __Pyx_GOTREF(__pyx_t_14);
5262 __pyx_t_13 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_14);
5263 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5264 __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_12);
5265 __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_12 = 0;
5266 if (__pyx_t_13) {
5267 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._notify_link_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
5268 if (__Pyx_GetException(&__pyx_t_12, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 268, __pyx_L25_except_error)
5269 __Pyx_GOTREF(__pyx_t_12);
5270 __Pyx_GOTREF(__pyx_t_4);
5271 __Pyx_GOTREF(__pyx_t_3);
5272
5273 /* "src/gevent/_abstract_linkable.py":271
5274 * # couldn't switch to a greenlet, we must be
5275 * # running in a different thread. back on the list it goes for next time.
5276 * unswitched.append(link) # <<<<<<<<<<<<<<
5277 * finally:
5278 * self._acquire_lock_for_switch_in()
5279 */
5280 __pyx_t_5 = __Pyx_PyList_Append(__pyx_v_unswitched, __pyx_v_link); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 271, __pyx_L25_except_error)
5281 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5282 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5283 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5284 goto __pyx_L24_exception_handled;
5285 }
5286 goto __pyx_L25_except_error;
5287 __pyx_L25_except_error:;
5288
5289 /* "src/gevent/_abstract_linkable.py":266
5290 * try:
5291 * self._drop_lock_for_switch_out()
5292 * try: # <<<<<<<<<<<<<<
5293 * link(self)
5294 * except greenlet_error:
5295 */
5296 __Pyx_XGIVEREF(__pyx_t_9);
5297 __Pyx_XGIVEREF(__pyx_t_10);
5298 __Pyx_XGIVEREF(__pyx_t_11);
5299 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
5300 goto __pyx_L21_error;
5301 __pyx_L24_exception_handled:;
5302 __Pyx_XGIVEREF(__pyx_t_9);
5303 __Pyx_XGIVEREF(__pyx_t_10);
5304 __Pyx_XGIVEREF(__pyx_t_11);
5305 __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
5306 __pyx_L30_try_end:;
5307 }
5308 }
5309
5310 /* "src/gevent/_abstract_linkable.py":273
5311 * unswitched.append(link)
5312 * finally:
5313 * self._acquire_lock_for_switch_in() # <<<<<<<<<<<<<<
5314 *
5315 * except: # pylint:disable=bare-except
5316 */
5317 /*finally:*/ {
5318 /*normal exit:*/{
5319 __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_acquire_lock_for_switch_in(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L10_error)
5320 __Pyx_GOTREF(__pyx_t_3);
5321 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5322 goto __pyx_L22;
5323 }
5324 __pyx_L21_error:;
5325 /*exception exit:*/{
5326 __Pyx_PyThreadState_declare
5327 __Pyx_PyThreadState_assign
5328 __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
5329 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5330 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
5331 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5332 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5333 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
5334 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_10, &__pyx_t_9);
5335 __Pyx_XGOTREF(__pyx_t_11);
5336 __Pyx_XGOTREF(__pyx_t_10);
5337 __Pyx_XGOTREF(__pyx_t_9);
5338 __Pyx_XGOTREF(__pyx_t_17);
5339 __Pyx_XGOTREF(__pyx_t_18);
5340 __Pyx_XGOTREF(__pyx_t_19);
5341 __pyx_t_13 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
5342 {
5343 __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_acquire_lock_for_switch_in(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 273, __pyx_L36_error)
5344 __Pyx_GOTREF(__pyx_t_3);
5345 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5346 }
5347 if (PY_MAJOR_VERSION >= 3) {
5348 __Pyx_XGIVEREF(__pyx_t_17);
5349 __Pyx_XGIVEREF(__pyx_t_18);
5350 __Pyx_XGIVEREF(__pyx_t_19);
5351 __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
5352 }
5353 __Pyx_XGIVEREF(__pyx_t_11);
5354 __Pyx_XGIVEREF(__pyx_t_10);
5355 __Pyx_XGIVEREF(__pyx_t_9);
5356 __Pyx_ErrRestore(__pyx_t_11, __pyx_t_10, __pyx_t_9);
5357 __pyx_t_11 = 0; __pyx_t_10 = 0; __pyx_t_9 = 0; __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
5358 __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
5359 goto __pyx_L10_error;
5360 __pyx_L36_error:;
5361 if (PY_MAJOR_VERSION >= 3) {
5362 __Pyx_XGIVEREF(__pyx_t_17);
5363 __Pyx_XGIVEREF(__pyx_t_18);
5364 __Pyx_XGIVEREF(__pyx_t_19);
5365 __Pyx_ExceptionReset(__pyx_t_17, __pyx_t_18, __pyx_t_19);
5366 }
5367 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
5368 __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5369 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
5370 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0;
5371 goto __pyx_L10_error;
5372 }
5373 __pyx_L22:;
5374 }
5375
5376 /* "src/gevent/_abstract_linkable.py":264
5377 * # create new functions inside a loop rather than just once outside the loop.
5378 * done.add(id_link)
5379 * try: # <<<<<<<<<<<<<<
5380 * self._drop_lock_for_switch_out()
5381 * try:
5382 */
5383 }
5384 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5385 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5386 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
5387 goto __pyx_L17_try_end;
5388 __pyx_L10_error:;
5389 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5390 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
5391 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5392 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5393
5394 /* "src/gevent/_abstract_linkable.py":275
5395 * self._acquire_lock_for_switch_in()
5396 *
5397 * except: # pylint:disable=bare-except # <<<<<<<<<<<<<<
5398 * # We're running in the hub, errors must not escape.
5399 * if hub is not None:
5400 */
5401 /*except:*/ {
5402 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._notify_link_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
5403 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_12) < 0) __PYX_ERR(0, 275, __pyx_L12_except_error)
5404 __Pyx_GOTREF(__pyx_t_3);
5405 __Pyx_GOTREF(__pyx_t_4);
5406 __Pyx_GOTREF(__pyx_t_12);
5407
5408 /* "src/gevent/_abstract_linkable.py":277
5409 * except: # pylint:disable=bare-except
5410 * # We're running in the hub, errors must not escape.
5411 * if hub is not None: # <<<<<<<<<<<<<<
5412 * hub.handle_error((link, self), *sys.exc_info())
5413 * else:
5414 */
5415 __pyx_t_1 = (((PyObject *)__pyx_v_hub) != Py_None);
5416 __pyx_t_2 = (__pyx_t_1 != 0);
5417 if (__pyx_t_2) {
5418
5419 /* "src/gevent/_abstract_linkable.py":278
5420 * # We're running in the hub, errors must not escape.
5421 * if hub is not None:
5422 * hub.handle_error((link, self), *sys.exc_info()) # <<<<<<<<<<<<<<
5423 * else:
5424 * import traceback
5425 */
5426 __pyx_t_14 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5427 __Pyx_GOTREF(__pyx_t_14);
5428 __pyx_t_20 = PyTuple_New(2); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5429 __Pyx_GOTREF(__pyx_t_20);
5430 __Pyx_INCREF(__pyx_v_link);
5431 __Pyx_GIVEREF(__pyx_v_link);
5432 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_v_link);
5433 __Pyx_INCREF((PyObject *)__pyx_v_self);
5434 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
5435 PyTuple_SET_ITEM(__pyx_t_20, 1, ((PyObject *)__pyx_v_self));
5436 __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5437 __Pyx_GOTREF(__pyx_t_21);
5438 __Pyx_GIVEREF(__pyx_t_20);
5439 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_20);
5440 __pyx_t_20 = 0;
5441 __Pyx_GetModuleGlobalName(__pyx_t_22, __pyx_n_s_sys); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5442 __Pyx_GOTREF(__pyx_t_22);
5443 __pyx_t_23 = __Pyx_PyObject_GetAttrStr(__pyx_t_22, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5444 __Pyx_GOTREF(__pyx_t_23);
5445 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
5446 __pyx_t_22 = NULL;
5447 __pyx_t_15 = 0;
5448 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_23))) {
5449 __pyx_t_22 = PyMethod_GET_SELF(__pyx_t_23);
5450 if (likely(__pyx_t_22)) {
5451 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_23);
5452 __Pyx_INCREF(__pyx_t_22);
5453 __Pyx_INCREF(function);
5454 __Pyx_DECREF_SET(__pyx_t_23, function);
5455 __pyx_t_15 = 1;
5456 }
5457 }
5458 {
5459 PyObject *__pyx_callargs[1] = {__pyx_t_22, };
5460 __pyx_t_20 = __Pyx_PyObject_FastCall(__pyx_t_23, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
5461 __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
5462 if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5463 __Pyx_GOTREF(__pyx_t_20);
5464 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
5465 }
5466 __pyx_t_23 = __Pyx_PySequence_Tuple(__pyx_t_20); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5467 __Pyx_GOTREF(__pyx_t_23);
5468 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5469 __pyx_t_20 = PyNumber_Add(__pyx_t_21, __pyx_t_23); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5470 __Pyx_GOTREF(__pyx_t_20);
5471 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
5472 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
5473 __pyx_t_23 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_20, NULL); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 278, __pyx_L12_except_error)
5474 __Pyx_GOTREF(__pyx_t_23);
5475 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5476 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5477 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
5478
5479 /* "src/gevent/_abstract_linkable.py":277
5480 * except: # pylint:disable=bare-except
5481 * # We're running in the hub, errors must not escape.
5482 * if hub is not None: # <<<<<<<<<<<<<<
5483 * hub.handle_error((link, self), *sys.exc_info())
5484 * else:
5485 */
5486 goto __pyx_L39;
5487 }
5488
5489 /* "src/gevent/_abstract_linkable.py":280
5490 * hub.handle_error((link, self), *sys.exc_info())
5491 * else:
5492 * import traceback # <<<<<<<<<<<<<<
5493 * traceback.print_exc()
5494 *
5495 */
5496 /*else*/ {
5497 __pyx_t_23 = __Pyx_ImportDottedModule(__pyx_n_s_traceback, NULL); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 280, __pyx_L12_except_error)
5498 __Pyx_GOTREF(__pyx_t_23);
5499 __Pyx_XDECREF_SET(__pyx_v_traceback, __pyx_t_23);
5500 __pyx_t_23 = 0;
5501
5502 /* "src/gevent/_abstract_linkable.py":281
5503 * else:
5504 * import traceback
5505 * traceback.print_exc() # <<<<<<<<<<<<<<
5506 *
5507 * if link is final_link:
5508 */
5509 __pyx_t_20 = __Pyx_PyObject_GetAttrStr(__pyx_v_traceback, __pyx_n_s_print_exc); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 281, __pyx_L12_except_error)
5510 __Pyx_GOTREF(__pyx_t_20);
5511 __pyx_t_14 = NULL;
5512 __pyx_t_15 = 0;
5513 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_20))) {
5514 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_20);
5515 if (likely(__pyx_t_14)) {
5516 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_20);
5517 __Pyx_INCREF(__pyx_t_14);
5518 __Pyx_INCREF(function);
5519 __Pyx_DECREF_SET(__pyx_t_20, function);
5520 __pyx_t_15 = 1;
5521 }
5522 }
5523 {
5524 PyObject *__pyx_callargs[1] = {__pyx_t_14, };
5525 __pyx_t_23 = __Pyx_PyObject_FastCall(__pyx_t_20, __pyx_callargs+1-__pyx_t_15, 0+__pyx_t_15);
5526 __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
5527 if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 281, __pyx_L12_except_error)
5528 __Pyx_GOTREF(__pyx_t_23);
5529 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5530 }
5531 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
5532 }
5533 __pyx_L39:;
5534 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5535 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5536 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
5537 goto __pyx_L11_exception_handled;
5538 }
5539 __pyx_L12_except_error:;
5540
5541 /* "src/gevent/_abstract_linkable.py":264
5542 * # create new functions inside a loop rather than just once outside the loop.
5543 * done.add(id_link)
5544 * try: # <<<<<<<<<<<<<<
5545 * self._drop_lock_for_switch_out()
5546 * try:
5547 */
5548 __Pyx_XGIVEREF(__pyx_t_6);
5549 __Pyx_XGIVEREF(__pyx_t_7);
5550 __Pyx_XGIVEREF(__pyx_t_8);
5551 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5552 goto __pyx_L1_error;
5553 __pyx_L11_exception_handled:;
5554 __Pyx_XGIVEREF(__pyx_t_6);
5555 __Pyx_XGIVEREF(__pyx_t_7);
5556 __Pyx_XGIVEREF(__pyx_t_8);
5557 __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
5558 __pyx_L17_try_end:;
5559 }
5560
5561 /* "src/gevent/_abstract_linkable.py":258
5562 * link = links.pop(0) # Cython optimizes using list internals
5563 * id_link = id(link)
5564 * if id_link not in done: # <<<<<<<<<<<<<<
5565 * # XXX: JAM: What was I thinking? This doesn't make much sense,
5566 * # there's a good chance `link` will be deallocated, and its id() will
5567 */
5568 }
5569
5570 /* "src/gevent/_abstract_linkable.py":283
5571 * traceback.print_exc()
5572 *
5573 * if link is final_link: # <<<<<<<<<<<<<<
5574 * break
5575 * return unswitched
5576 */
5577 __pyx_t_2 = (__pyx_v_link == __pyx_v_final_link);
5578 __pyx_t_1 = (__pyx_t_2 != 0);
5579 if (__pyx_t_1) {
5580
5581 /* "src/gevent/_abstract_linkable.py":284
5582 *
5583 * if link is final_link:
5584 * break # <<<<<<<<<<<<<<
5585 * return unswitched
5586 *
5587 */
5588 goto __pyx_L5_break;
5589
5590 /* "src/gevent/_abstract_linkable.py":283
5591 * traceback.print_exc()
5592 *
5593 * if link is final_link: # <<<<<<<<<<<<<<
5594 * break
5595 * return unswitched
5596 */
5597 }
5598 }
5599 __pyx_L5_break:;
5600
5601 /* "src/gevent/_abstract_linkable.py":285
5602 * if link is final_link:
5603 * break
5604 * return unswitched # <<<<<<<<<<<<<<
5605 *
5606 * def _notify_links(self, arrived_while_waiting):
5607 */
5608 __Pyx_XDECREF(__pyx_r);
5609 __Pyx_INCREF(__pyx_v_unswitched);
5610 __pyx_r = __pyx_v_unswitched;
5611 goto __pyx_L0;
5612
5613 /* "src/gevent/_abstract_linkable.py":236
5614 * self._notifier = None
5615 *
5616 * def _notify_link_list(self, links): # <<<<<<<<<<<<<<
5617 * # The core of the _notify_links method to notify
5618 * # links in order. Lets the ``links`` list be mutated,
5619 */
5620
5621 /* function exit code */
5622 __pyx_L1_error:;
5623 __Pyx_XDECREF(__pyx_t_3);
5624 __Pyx_XDECREF(__pyx_t_4);
5625 __Pyx_XDECREF(__pyx_t_12);
5626 __Pyx_XDECREF(__pyx_t_14);
5627 __Pyx_XDECREF(__pyx_t_20);
5628 __Pyx_XDECREF(__pyx_t_21);
5629 __Pyx_XDECREF(__pyx_t_22);
5630 __Pyx_XDECREF(__pyx_t_23);
5631 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._notify_link_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
5632 __pyx_r = 0;
5633 __pyx_L0:;
5634 __Pyx_XDECREF(__pyx_v_final_link);
5635 __Pyx_XDECREF(__pyx_v_done);
5636 __Pyx_XDECREF((PyObject *)__pyx_v_hub);
5637 __Pyx_XDECREF(__pyx_v_unswitched);
5638 __Pyx_XDECREF(__pyx_v_link);
5639 __Pyx_XDECREF(__pyx_v_id_link);
5640 __Pyx_XDECREF(__pyx_v_traceback);
5641 __Pyx_XGIVEREF(__pyx_r);
5642 __Pyx_RefNannyFinishContext();
5643 return __pyx_r;
5644 }
5645
5646 /* "src/gevent/_abstract_linkable.py":287
5647 * return unswitched
5648 *
5649 * def _notify_links(self, arrived_while_waiting): # <<<<<<<<<<<<<<
5650 * # This method must hold the GIL, or be guarded with the lock that guards
5651 * # this object. Thus, while we are notifying objects, an object from another
5652 */
5653
5654 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting); /*proto*/
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_arrived_while_waiting,int __pyx_skip_dispatch)5655 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting, int __pyx_skip_dispatch) {
5656 PyObject *__pyx_v_notifier = NULL;
5657 PyObject *__pyx_v_unswitched = NULL;
5658 PyObject *__pyx_v_un2 = NULL;
5659 PyObject *__pyx_r = NULL;
5660 __Pyx_RefNannyDeclarations
5661 PyObject *__pyx_t_1 = NULL;
5662 PyObject *__pyx_t_2 = NULL;
5663 PyObject *__pyx_t_3 = NULL;
5664 PyObject *__pyx_t_4 = NULL;
5665 int __pyx_t_5;
5666 int __pyx_t_6;
5667 int __pyx_t_7;
5668 int __pyx_t_8;
5669 int __pyx_t_9;
5670 char const *__pyx_t_10;
5671 PyObject *__pyx_t_11 = NULL;
5672 PyObject *__pyx_t_12 = NULL;
5673 PyObject *__pyx_t_13 = NULL;
5674 PyObject *__pyx_t_14 = NULL;
5675 PyObject *__pyx_t_15 = NULL;
5676 PyObject *__pyx_t_16 = NULL;
5677 int __pyx_lineno = 0;
5678 const char *__pyx_filename = NULL;
5679 int __pyx_clineno = 0;
5680 __Pyx_RefNannySetupContext("_notify_links", 0);
5681 /* Check if called by wrapper */
5682 if (unlikely(__pyx_skip_dispatch)) ;
5683 /* Check if overridden in Python */
5684 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
5685 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5686 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5687 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
5688 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5689 #endif
5690 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
5691 __Pyx_GOTREF(__pyx_t_1);
5692 #ifdef __Pyx_CyFunction_USED
5693 if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
5694 #else
5695 if (!PyCFunction_Check(__pyx_t_1)
5696 #endif
5697 || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links)) {
5698 __Pyx_XDECREF(__pyx_r);
5699 __Pyx_INCREF(__pyx_t_1);
5700 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
5701 __pyx_t_5 = 0;
5702 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
5703 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
5704 if (likely(__pyx_t_4)) {
5705 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
5706 __Pyx_INCREF(__pyx_t_4);
5707 __Pyx_INCREF(function);
5708 __Pyx_DECREF_SET(__pyx_t_3, function);
5709 __pyx_t_5 = 1;
5710 }
5711 }
5712 {
5713 PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_arrived_while_waiting};
5714 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
5715 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5716 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error)
5717 __Pyx_GOTREF(__pyx_t_2);
5718 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5719 }
5720 __pyx_r = __pyx_t_2;
5721 __pyx_t_2 = 0;
5722 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5723 goto __pyx_L0;
5724 }
5725 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5726 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
5727 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
5728 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
5729 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
5730 }
5731 #endif
5732 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5733 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
5734 }
5735 #endif
5736 }
5737
5738 /* "src/gevent/_abstract_linkable.py":301
5739 * # The object itself becomes false in a boolean way as soon
5740 * # as this method returns.
5741 * notifier = self._notifier # <<<<<<<<<<<<<<
5742 * if notifier is None:
5743 * # XXX: How did we get here?
5744 */
5745 __pyx_t_1 = __pyx_v_self->_notifier;
5746 __Pyx_INCREF(__pyx_t_1);
5747 __pyx_v_notifier = __pyx_t_1;
5748 __pyx_t_1 = 0;
5749
5750 /* "src/gevent/_abstract_linkable.py":302
5751 * # as this method returns.
5752 * notifier = self._notifier
5753 * if notifier is None: # <<<<<<<<<<<<<<
5754 * # XXX: How did we get here?
5755 * self._check_and_notify()
5756 */
5757 __pyx_t_6 = (__pyx_v_notifier == Py_None);
5758 __pyx_t_7 = (__pyx_t_6 != 0);
5759 if (__pyx_t_7) {
5760
5761 /* "src/gevent/_abstract_linkable.py":304
5762 * if notifier is None:
5763 * # XXX: How did we get here?
5764 * self._check_and_notify() # <<<<<<<<<<<<<<
5765 * return
5766 * # Early links are allowed to remove later links, and links
5767 */
5768 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
5769 __Pyx_GOTREF(__pyx_t_1);
5770 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5771
5772 /* "src/gevent/_abstract_linkable.py":305
5773 * # XXX: How did we get here?
5774 * self._check_and_notify()
5775 * return # <<<<<<<<<<<<<<
5776 * # Early links are allowed to remove later links, and links
5777 * # are allowed to add more links, thus we must not
5778 */
5779 __Pyx_XDECREF(__pyx_r);
5780 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5781 goto __pyx_L0;
5782
5783 /* "src/gevent/_abstract_linkable.py":302
5784 * # as this method returns.
5785 * notifier = self._notifier
5786 * if notifier is None: # <<<<<<<<<<<<<<
5787 * # XXX: How did we get here?
5788 * self._check_and_notify()
5789 */
5790 }
5791
5792 /* "src/gevent/_abstract_linkable.py":318
5793 * # any more. In that case, we must not keep notifying anyone that's
5794 * # newly added after that, even if we go ready again.
5795 * try: # <<<<<<<<<<<<<<
5796 * unswitched = self._notify_link_list(self._links)
5797 * # Now, those that arrived after we had begun the notification
5798 */
5799 /*try:*/ {
5800
5801 /* "src/gevent/_abstract_linkable.py":319
5802 * # newly added after that, even if we go ready again.
5803 * try:
5804 * unswitched = self._notify_link_list(self._links) # <<<<<<<<<<<<<<
5805 * # Now, those that arrived after we had begun the notification
5806 * # process. Follow the same rules, stop with those that are
5807 */
5808 __pyx_t_1 = __pyx_v_self->_links;
5809 __Pyx_INCREF(__pyx_t_1);
5810 __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_notify_link_list(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L5_error)
5811 __Pyx_GOTREF(__pyx_t_2);
5812 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5813 __pyx_v_unswitched = ((PyObject*)__pyx_t_2);
5814 __pyx_t_2 = 0;
5815
5816 /* "src/gevent/_abstract_linkable.py":323
5817 * # process. Follow the same rules, stop with those that are
5818 * # added so far to prevent starvation.
5819 * if arrived_while_waiting: # <<<<<<<<<<<<<<
5820 * un2 = self._notify_link_list(arrived_while_waiting)
5821 * unswitched.extend(un2)
5822 */
5823 __pyx_t_7 = (__pyx_v_arrived_while_waiting != Py_None)&&(PyList_GET_SIZE(__pyx_v_arrived_while_waiting) != 0);
5824 if (__pyx_t_7) {
5825
5826 /* "src/gevent/_abstract_linkable.py":324
5827 * # added so far to prevent starvation.
5828 * if arrived_while_waiting:
5829 * un2 = self._notify_link_list(arrived_while_waiting) # <<<<<<<<<<<<<<
5830 * unswitched.extend(un2)
5831 *
5832 */
5833 __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_notify_link_list(__pyx_v_self, __pyx_v_arrived_while_waiting); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 324, __pyx_L5_error)
5834 __Pyx_GOTREF(__pyx_t_2);
5835 __pyx_v_un2 = ((PyObject*)__pyx_t_2);
5836 __pyx_t_2 = 0;
5837
5838 /* "src/gevent/_abstract_linkable.py":325
5839 * if arrived_while_waiting:
5840 * un2 = self._notify_link_list(arrived_while_waiting)
5841 * unswitched.extend(un2) # <<<<<<<<<<<<<<
5842 *
5843 * # Anything left needs to go back on the main list.
5844 */
5845 if (unlikely(__pyx_v_unswitched == Py_None)) {
5846 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend");
5847 __PYX_ERR(0, 325, __pyx_L5_error)
5848 }
5849 __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_unswitched, __pyx_v_un2); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 325, __pyx_L5_error)
5850
5851 /* "src/gevent/_abstract_linkable.py":328
5852 *
5853 * # Anything left needs to go back on the main list.
5854 * self._links.extend(arrived_while_waiting) # <<<<<<<<<<<<<<
5855 * finally:
5856 * # We should not have created a new notifier even if callbacks
5857 */
5858 if (unlikely(__pyx_v_self->_links == Py_None)) {
5859 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend");
5860 __PYX_ERR(0, 328, __pyx_L5_error)
5861 }
5862 __pyx_t_8 = __Pyx_PyList_Extend(__pyx_v_self->_links, __pyx_v_arrived_while_waiting); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L5_error)
5863
5864 /* "src/gevent/_abstract_linkable.py":323
5865 * # process. Follow the same rules, stop with those that are
5866 * # added so far to prevent starvation.
5867 * if arrived_while_waiting: # <<<<<<<<<<<<<<
5868 * un2 = self._notify_link_list(arrived_while_waiting)
5869 * unswitched.extend(un2)
5870 */
5871 }
5872 }
5873
5874 /* "src/gevent/_abstract_linkable.py":333
5875 * # released us because we loop through *all* of our links on the
5876 * # same callback while self._notifier is still true.
5877 * assert self._notifier is notifier, (self._notifier, notifier) # <<<<<<<<<<<<<<
5878 * self._notifier = None
5879 * # TODO: Maybe we should intelligently reset self.hub to
5880 */
5881 /*finally:*/ {
5882 /*normal exit:*/{
5883 #ifndef CYTHON_WITHOUT_ASSERTIONS
5884 if (unlikely(!Py_OptimizeFlag)) {
5885 __pyx_t_7 = (__pyx_v_self->_notifier == __pyx_v_notifier);
5886 __pyx_t_6 = (__pyx_t_7 != 0);
5887 if (unlikely(!__pyx_t_6)) {
5888 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L1_error)
5889 __Pyx_GOTREF(__pyx_t_2);
5890 __Pyx_INCREF(__pyx_v_self->_notifier);
5891 __Pyx_GIVEREF(__pyx_v_self->_notifier);
5892 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_self->_notifier);
5893 __Pyx_INCREF(__pyx_v_notifier);
5894 __Pyx_GIVEREF(__pyx_v_notifier);
5895 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_notifier);
5896 __pyx_t_1 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
5897 __Pyx_GOTREF(__pyx_t_1);
5898 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5899 __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
5900 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5901 __PYX_ERR(0, 333, __pyx_L1_error)
5902 }
5903 }
5904 #else
5905 if ((1)); else __PYX_ERR(0, 333, __pyx_L1_error)
5906 #endif
5907
5908 /* "src/gevent/_abstract_linkable.py":334
5909 * # same callback while self._notifier is still true.
5910 * assert self._notifier is notifier, (self._notifier, notifier)
5911 * self._notifier = None # <<<<<<<<<<<<<<
5912 * # TODO: Maybe we should intelligently reset self.hub to
5913 * # free up thread affinity? In case of a pathological situation where
5914 */
5915 __Pyx_INCREF(Py_None);
5916 __Pyx_GIVEREF(Py_None);
5917 __Pyx_GOTREF(__pyx_v_self->_notifier);
5918 __Pyx_DECREF(__pyx_v_self->_notifier);
5919 __pyx_v_self->_notifier = Py_None;
5920 goto __pyx_L6;
5921 }
5922 __pyx_L5_error:;
5923 /*exception exit:*/{
5924 __Pyx_PyThreadState_declare
5925 __Pyx_PyThreadState_assign
5926 __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
5927 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
5928 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
5929 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
5930 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5931 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
5932 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
5933 __Pyx_XGOTREF(__pyx_t_11);
5934 __Pyx_XGOTREF(__pyx_t_12);
5935 __Pyx_XGOTREF(__pyx_t_13);
5936 __Pyx_XGOTREF(__pyx_t_14);
5937 __Pyx_XGOTREF(__pyx_t_15);
5938 __Pyx_XGOTREF(__pyx_t_16);
5939 __pyx_t_5 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
5940 {
5941
5942 /* "src/gevent/_abstract_linkable.py":333
5943 * # released us because we loop through *all* of our links on the
5944 * # same callback while self._notifier is still true.
5945 * assert self._notifier is notifier, (self._notifier, notifier) # <<<<<<<<<<<<<<
5946 * self._notifier = None
5947 * # TODO: Maybe we should intelligently reset self.hub to
5948 */
5949 #ifndef CYTHON_WITHOUT_ASSERTIONS
5950 if (unlikely(!Py_OptimizeFlag)) {
5951 __pyx_t_6 = (__pyx_v_self->_notifier == __pyx_v_notifier);
5952 __pyx_t_7 = (__pyx_t_6 != 0);
5953 if (unlikely(!__pyx_t_7)) {
5954 __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L9_error)
5955 __Pyx_GOTREF(__pyx_t_1);
5956 __Pyx_INCREF(__pyx_v_self->_notifier);
5957 __Pyx_GIVEREF(__pyx_v_self->_notifier);
5958 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->_notifier);
5959 __Pyx_INCREF(__pyx_v_notifier);
5960 __Pyx_GIVEREF(__pyx_v_notifier);
5961 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_notifier);
5962 __pyx_t_2 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 333, __pyx_L9_error)
5963 __Pyx_GOTREF(__pyx_t_2);
5964 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5965 __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
5966 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5967 __PYX_ERR(0, 333, __pyx_L9_error)
5968 }
5969 }
5970 #else
5971 if ((1)); else __PYX_ERR(0, 333, __pyx_L9_error)
5972 #endif
5973
5974 /* "src/gevent/_abstract_linkable.py":334
5975 * # same callback while self._notifier is still true.
5976 * assert self._notifier is notifier, (self._notifier, notifier)
5977 * self._notifier = None # <<<<<<<<<<<<<<
5978 * # TODO: Maybe we should intelligently reset self.hub to
5979 * # free up thread affinity? In case of a pathological situation where
5980 */
5981 __Pyx_INCREF(Py_None);
5982 __Pyx_GIVEREF(Py_None);
5983 __Pyx_GOTREF(__pyx_v_self->_notifier);
5984 __Pyx_DECREF(__pyx_v_self->_notifier);
5985 __pyx_v_self->_notifier = Py_None;
5986 }
5987 if (PY_MAJOR_VERSION >= 3) {
5988 __Pyx_XGIVEREF(__pyx_t_14);
5989 __Pyx_XGIVEREF(__pyx_t_15);
5990 __Pyx_XGIVEREF(__pyx_t_16);
5991 __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
5992 }
5993 __Pyx_XGIVEREF(__pyx_t_11);
5994 __Pyx_XGIVEREF(__pyx_t_12);
5995 __Pyx_XGIVEREF(__pyx_t_13);
5996 __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
5997 __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
5998 __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
5999 goto __pyx_L1_error;
6000 __pyx_L9_error:;
6001 if (PY_MAJOR_VERSION >= 3) {
6002 __Pyx_XGIVEREF(__pyx_t_14);
6003 __Pyx_XGIVEREF(__pyx_t_15);
6004 __Pyx_XGIVEREF(__pyx_t_16);
6005 __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
6006 }
6007 __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
6008 __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
6009 __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
6010 __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
6011 goto __pyx_L1_error;
6012 }
6013 __pyx_L6:;
6014 }
6015
6016 /* "src/gevent/_abstract_linkable.py":345
6017 * # must have more links than we started with. We need to schedule the
6018 * # wakeup.
6019 * self._check_and_notify() # <<<<<<<<<<<<<<
6020 * if unswitched:
6021 * self._handle_unswitched_notifications(unswitched)
6022 */
6023 __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 345, __pyx_L1_error)
6024 __Pyx_GOTREF(__pyx_t_2);
6025 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6026
6027 /* "src/gevent/_abstract_linkable.py":346
6028 * # wakeup.
6029 * self._check_and_notify()
6030 * if unswitched: # <<<<<<<<<<<<<<
6031 * self._handle_unswitched_notifications(unswitched)
6032 *
6033 */
6034 __pyx_t_7 = (__pyx_v_unswitched != Py_None)&&(PyList_GET_SIZE(__pyx_v_unswitched) != 0);
6035 if (__pyx_t_7) {
6036
6037 /* "src/gevent/_abstract_linkable.py":347
6038 * self._check_and_notify()
6039 * if unswitched:
6040 * self._handle_unswitched_notifications(unswitched) # <<<<<<<<<<<<<<
6041 *
6042 *
6043 */
6044 __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_handle_unswitched_notifications(__pyx_v_self, __pyx_v_unswitched); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 347, __pyx_L1_error)
6045 __Pyx_GOTREF(__pyx_t_2);
6046 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6047
6048 /* "src/gevent/_abstract_linkable.py":346
6049 * # wakeup.
6050 * self._check_and_notify()
6051 * if unswitched: # <<<<<<<<<<<<<<
6052 * self._handle_unswitched_notifications(unswitched)
6053 *
6054 */
6055 }
6056
6057 /* "src/gevent/_abstract_linkable.py":287
6058 * return unswitched
6059 *
6060 * def _notify_links(self, arrived_while_waiting): # <<<<<<<<<<<<<<
6061 * # This method must hold the GIL, or be guarded with the lock that guards
6062 * # this object. Thus, while we are notifying objects, an object from another
6063 */
6064
6065 /* function exit code */
6066 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6067 goto __pyx_L0;
6068 __pyx_L1_error:;
6069 __Pyx_XDECREF(__pyx_t_1);
6070 __Pyx_XDECREF(__pyx_t_2);
6071 __Pyx_XDECREF(__pyx_t_3);
6072 __Pyx_XDECREF(__pyx_t_4);
6073 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
6074 __pyx_r = 0;
6075 __pyx_L0:;
6076 __Pyx_XDECREF(__pyx_v_notifier);
6077 __Pyx_XDECREF(__pyx_v_unswitched);
6078 __Pyx_XDECREF(__pyx_v_un2);
6079 __Pyx_XGIVEREF(__pyx_r);
6080 __Pyx_RefNannyFinishContext();
6081 return __pyx_r;
6082 }
6083
6084 /* Python wrapper */
6085 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting); /*proto*/
6086 PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links, "AbstractLinkable._notify_links(self, list arrived_while_waiting)");
6087 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links, METH_O, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links(PyObject * __pyx_v_self,PyObject * __pyx_v_arrived_while_waiting)6088 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting) {
6089 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
6090 int __pyx_lineno = 0;
6091 const char *__pyx_filename = NULL;
6092 int __pyx_clineno = 0;
6093 PyObject *__pyx_r = 0;
6094 __Pyx_RefNannyDeclarations
6095 __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0);
6096 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arrived_while_waiting), (&PyList_Type), 1, "arrived_while_waiting", 1))) __PYX_ERR(0, 287, __pyx_L1_error)
6097 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject*)__pyx_v_arrived_while_waiting));
6098
6099 /* function exit code */
6100 goto __pyx_L0;
6101 __pyx_L1_error:;
6102 __pyx_r = NULL;
6103 __pyx_L0:;
6104 __Pyx_RefNannyFinishContext();
6105 return __pyx_r;
6106 }
6107
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_arrived_while_waiting)6108 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting) {
6109 PyObject *__pyx_r = NULL;
6110 __Pyx_RefNannyDeclarations
6111 PyObject *__pyx_t_1 = NULL;
6112 int __pyx_lineno = 0;
6113 const char *__pyx_filename = NULL;
6114 int __pyx_clineno = 0;
6115 __Pyx_RefNannySetupContext("_notify_links", 0);
6116 __Pyx_XDECREF(__pyx_r);
6117 __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_links(__pyx_v_self, __pyx_v_arrived_while_waiting, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
6118 __Pyx_GOTREF(__pyx_t_1);
6119 __pyx_r = __pyx_t_1;
6120 __pyx_t_1 = 0;
6121 goto __pyx_L0;
6122
6123 /* function exit code */
6124 __pyx_L1_error:;
6125 __Pyx_XDECREF(__pyx_t_1);
6126 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
6127 __pyx_r = NULL;
6128 __pyx_L0:;
6129 __Pyx_XGIVEREF(__pyx_r);
6130 __Pyx_RefNannyFinishContext();
6131 return __pyx_r;
6132 }
6133
6134 /* "src/gevent/_abstract_linkable.py":350
6135 *
6136 *
6137 * def _handle_unswitched_notifications(self, unswitched): # <<<<<<<<<<<<<<
6138 * # Given a list of callable objects that raised
6139 * # ``greenlet.error`` when we called them: If we can determine
6140 */
6141
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__handle_unswitched_notifications(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_unswitched)6142 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__handle_unswitched_notifications(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_unswitched) {
6143 struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = 0;
6144 PyObject *__pyx_v_root_greenlets = NULL;
6145 int __pyx_v_printed_tb;
6146 int __pyx_v_only_while_ready;
6147 PyObject *__pyx_v_link = NULL;
6148 PyObject *__pyx_v_glet = NULL;
6149 PyObject *__pyx_v_parent = NULL;
6150 PyObject *__pyx_r = NULL;
6151 __Pyx_RefNannyDeclarations
6152 int __pyx_t_1;
6153 int __pyx_t_2;
6154 PyObject *__pyx_t_3 = NULL;
6155 int __pyx_t_4;
6156 PyObject *__pyx_t_5 = NULL;
6157 PyObject *__pyx_t_6 = NULL;
6158 int __pyx_t_7;
6159 int __pyx_lineno = 0;
6160 const char *__pyx_filename = NULL;
6161 int __pyx_clineno = 0;
6162 __Pyx_RefNannySetupContext("_handle_unswitched_notifications", 0);
6163
6164 /* "src/gevent/_abstract_linkable.py":371
6165 * # TODO: Add a 'strict' mode that prevents doing this dance, since it's
6166 * # inherently not safe.
6167 * root_greenlets = None # <<<<<<<<<<<<<<
6168 * printed_tb = False
6169 * only_while_ready = not self._notify_all
6170 */
6171 __Pyx_INCREF(Py_None);
6172 __pyx_v_root_greenlets = ((PyObject*)Py_None);
6173
6174 /* "src/gevent/_abstract_linkable.py":372
6175 * # inherently not safe.
6176 * root_greenlets = None
6177 * printed_tb = False # <<<<<<<<<<<<<<
6178 * only_while_ready = not self._notify_all
6179 *
6180 */
6181 __pyx_v_printed_tb = 0;
6182
6183 /* "src/gevent/_abstract_linkable.py":373
6184 * root_greenlets = None
6185 * printed_tb = False
6186 * only_while_ready = not self._notify_all # <<<<<<<<<<<<<<
6187 *
6188 * while unswitched:
6189 */
6190 __pyx_v_only_while_ready = (!(__pyx_v_self->_notify_all != 0));
6191
6192 /* "src/gevent/_abstract_linkable.py":375
6193 * only_while_ready = not self._notify_all
6194 *
6195 * while unswitched: # <<<<<<<<<<<<<<
6196 * if only_while_ready and not self.ready():
6197 * self.__print_unswitched_warning(unswitched, printed_tb)
6198 */
6199 while (1) {
6200 __pyx_t_1 = (__pyx_v_unswitched != Py_None)&&(PyList_GET_SIZE(__pyx_v_unswitched) != 0);
6201 if (!__pyx_t_1) break;
6202
6203 /* "src/gevent/_abstract_linkable.py":376
6204 *
6205 * while unswitched:
6206 * if only_while_ready and not self.ready(): # <<<<<<<<<<<<<<
6207 * self.__print_unswitched_warning(unswitched, printed_tb)
6208 * break
6209 */
6210 __pyx_t_2 = (__pyx_v_only_while_ready != 0);
6211 if (__pyx_t_2) {
6212 } else {
6213 __pyx_t_1 = __pyx_t_2;
6214 goto __pyx_L6_bool_binop_done;
6215 }
6216 __pyx_t_2 = ((!(((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0)) != 0);
6217 __pyx_t_1 = __pyx_t_2;
6218 __pyx_L6_bool_binop_done:;
6219 if (__pyx_t_1) {
6220
6221 /* "src/gevent/_abstract_linkable.py":377
6222 * while unswitched:
6223 * if only_while_ready and not self.ready():
6224 * self.__print_unswitched_warning(unswitched, printed_tb) # <<<<<<<<<<<<<<
6225 * break
6226 *
6227 */
6228 __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_AbstractLinkable__print_unswitched_warning(__pyx_v_self, __pyx_v_unswitched, __pyx_v_printed_tb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error)
6229 __Pyx_GOTREF(__pyx_t_3);
6230 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6231
6232 /* "src/gevent/_abstract_linkable.py":378
6233 * if only_while_ready and not self.ready():
6234 * self.__print_unswitched_warning(unswitched, printed_tb)
6235 * break # <<<<<<<<<<<<<<
6236 *
6237 * link = unswitched.pop(0)
6238 */
6239 goto __pyx_L4_break;
6240
6241 /* "src/gevent/_abstract_linkable.py":376
6242 *
6243 * while unswitched:
6244 * if only_while_ready and not self.ready(): # <<<<<<<<<<<<<<
6245 * self.__print_unswitched_warning(unswitched, printed_tb)
6246 * break
6247 */
6248 }
6249
6250 /* "src/gevent/_abstract_linkable.py":380
6251 * break
6252 *
6253 * link = unswitched.pop(0) # <<<<<<<<<<<<<<
6254 *
6255 * hub = None # Also serves as a "handled?" flag
6256 */
6257 if (unlikely(__pyx_v_unswitched == Py_None)) {
6258 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
6259 __PYX_ERR(0, 380, __pyx_L1_error)
6260 }
6261 __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_unswitched, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 380, __pyx_L1_error)
6262 __Pyx_GOTREF(__pyx_t_3);
6263 __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_3);
6264 __pyx_t_3 = 0;
6265
6266 /* "src/gevent/_abstract_linkable.py":382
6267 * link = unswitched.pop(0)
6268 *
6269 * hub = None # Also serves as a "handled?" flag # <<<<<<<<<<<<<<
6270 * # Is it a greenlet.switch method?
6271 * if (getattr(link, '__name__', None) == 'switch'
6272 */
6273 __Pyx_INCREF(Py_None);
6274 __Pyx_XDECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None));
6275
6276 /* "src/gevent/_abstract_linkable.py":384
6277 * hub = None # Also serves as a "handled?" flag
6278 * # Is it a greenlet.switch method?
6279 * if (getattr(link, '__name__', None) == 'switch' # <<<<<<<<<<<<<<
6280 * and isinstance(getattr(link, '__self__', None), greenlet)):
6281 * glet = link.__self__
6282 */
6283 __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_name, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
6284 __Pyx_GOTREF(__pyx_t_3);
6285 __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_switch, Py_EQ)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 384, __pyx_L1_error)
6286 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6287 if (__pyx_t_2) {
6288 } else {
6289 __pyx_t_1 = __pyx_t_2;
6290 goto __pyx_L9_bool_binop_done;
6291 }
6292
6293 /* "src/gevent/_abstract_linkable.py":385
6294 * # Is it a greenlet.switch method?
6295 * if (getattr(link, '__name__', None) == 'switch'
6296 * and isinstance(getattr(link, '__self__', None), greenlet)): # <<<<<<<<<<<<<<
6297 * glet = link.__self__
6298 * parent = glet.parent
6299 */
6300 __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_link, __pyx_n_s_self, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 385, __pyx_L1_error)
6301 __Pyx_GOTREF(__pyx_t_3);
6302 __pyx_t_2 = __Pyx_TypeCheck(__pyx_t_3, __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet);
6303 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6304 __pyx_t_4 = (__pyx_t_2 != 0);
6305 __pyx_t_1 = __pyx_t_4;
6306 __pyx_L9_bool_binop_done:;
6307
6308 /* "src/gevent/_abstract_linkable.py":384
6309 * hub = None # Also serves as a "handled?" flag
6310 * # Is it a greenlet.switch method?
6311 * if (getattr(link, '__name__', None) == 'switch' # <<<<<<<<<<<<<<
6312 * and isinstance(getattr(link, '__self__', None), greenlet)):
6313 * glet = link.__self__
6314 */
6315 if (__pyx_t_1) {
6316
6317 /* "src/gevent/_abstract_linkable.py":386
6318 * if (getattr(link, '__name__', None) == 'switch'
6319 * and isinstance(getattr(link, '__self__', None), greenlet)):
6320 * glet = link.__self__ # <<<<<<<<<<<<<<
6321 * parent = glet.parent
6322 *
6323 */
6324 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_n_s_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
6325 __Pyx_GOTREF(__pyx_t_3);
6326 __Pyx_XDECREF_SET(__pyx_v_glet, __pyx_t_3);
6327 __pyx_t_3 = 0;
6328
6329 /* "src/gevent/_abstract_linkable.py":387
6330 * and isinstance(getattr(link, '__self__', None), greenlet)):
6331 * glet = link.__self__
6332 * parent = glet.parent # <<<<<<<<<<<<<<
6333 *
6334 * while parent is not None:
6335 */
6336 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 387, __pyx_L1_error)
6337 __Pyx_GOTREF(__pyx_t_3);
6338 __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_3);
6339 __pyx_t_3 = 0;
6340
6341 /* "src/gevent/_abstract_linkable.py":389
6342 * parent = glet.parent
6343 *
6344 * while parent is not None: # <<<<<<<<<<<<<<
6345 * if hasattr(parent, 'loop'): # Assuming the hub.
6346 * hub = glet.parent
6347 */
6348 while (1) {
6349 __pyx_t_1 = (__pyx_v_parent != Py_None);
6350 __pyx_t_4 = (__pyx_t_1 != 0);
6351 if (!__pyx_t_4) break;
6352
6353 /* "src/gevent/_abstract_linkable.py":390
6354 *
6355 * while parent is not None:
6356 * if hasattr(parent, 'loop'): # Assuming the hub. # <<<<<<<<<<<<<<
6357 * hub = glet.parent
6358 * break
6359 */
6360 __pyx_t_4 = __Pyx_HasAttr(__pyx_v_parent, __pyx_n_s_loop); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 390, __pyx_L1_error)
6361 __pyx_t_1 = (__pyx_t_4 != 0);
6362 if (__pyx_t_1) {
6363
6364 /* "src/gevent/_abstract_linkable.py":391
6365 * while parent is not None:
6366 * if hasattr(parent, 'loop'): # Assuming the hub.
6367 * hub = glet.parent # <<<<<<<<<<<<<<
6368 * break
6369 * parent = glet.parent
6370 */
6371 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
6372 __Pyx_GOTREF(__pyx_t_3);
6373 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 391, __pyx_L1_error)
6374 __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3));
6375 __pyx_t_3 = 0;
6376
6377 /* "src/gevent/_abstract_linkable.py":392
6378 * if hasattr(parent, 'loop'): # Assuming the hub.
6379 * hub = glet.parent
6380 * break # <<<<<<<<<<<<<<
6381 * parent = glet.parent
6382 *
6383 */
6384 goto __pyx_L12_break;
6385
6386 /* "src/gevent/_abstract_linkable.py":390
6387 *
6388 * while parent is not None:
6389 * if hasattr(parent, 'loop'): # Assuming the hub. # <<<<<<<<<<<<<<
6390 * hub = glet.parent
6391 * break
6392 */
6393 }
6394
6395 /* "src/gevent/_abstract_linkable.py":393
6396 * hub = glet.parent
6397 * break
6398 * parent = glet.parent # <<<<<<<<<<<<<<
6399 *
6400 * if hub is None:
6401 */
6402 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_n_s_parent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
6403 __Pyx_GOTREF(__pyx_t_3);
6404 __Pyx_DECREF_SET(__pyx_v_parent, __pyx_t_3);
6405 __pyx_t_3 = 0;
6406 }
6407 __pyx_L12_break:;
6408
6409 /* "src/gevent/_abstract_linkable.py":395
6410 * parent = glet.parent
6411 *
6412 * if hub is None: # <<<<<<<<<<<<<<
6413 * if root_greenlets is None:
6414 * root_greenlets = get_roots_and_hubs()
6415 */
6416 __pyx_t_1 = (((PyObject *)__pyx_v_hub) == Py_None);
6417 __pyx_t_4 = (__pyx_t_1 != 0);
6418 if (__pyx_t_4) {
6419
6420 /* "src/gevent/_abstract_linkable.py":396
6421 *
6422 * if hub is None:
6423 * if root_greenlets is None: # <<<<<<<<<<<<<<
6424 * root_greenlets = get_roots_and_hubs()
6425 * hub = root_greenlets.get(glet)
6426 */
6427 __pyx_t_4 = (__pyx_v_root_greenlets == ((PyObject*)Py_None));
6428 __pyx_t_1 = (__pyx_t_4 != 0);
6429 if (__pyx_t_1) {
6430
6431 /* "src/gevent/_abstract_linkable.py":397
6432 * if hub is None:
6433 * if root_greenlets is None:
6434 * root_greenlets = get_roots_and_hubs() # <<<<<<<<<<<<<<
6435 * hub = root_greenlets.get(glet)
6436 *
6437 */
6438 __pyx_t_3 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_get_roots_and_hubs(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
6439 __Pyx_GOTREF(__pyx_t_3);
6440 __Pyx_DECREF_SET(__pyx_v_root_greenlets, ((PyObject*)__pyx_t_3));
6441 __pyx_t_3 = 0;
6442
6443 /* "src/gevent/_abstract_linkable.py":396
6444 *
6445 * if hub is None:
6446 * if root_greenlets is None: # <<<<<<<<<<<<<<
6447 * root_greenlets = get_roots_and_hubs()
6448 * hub = root_greenlets.get(glet)
6449 */
6450 }
6451
6452 /* "src/gevent/_abstract_linkable.py":398
6453 * if root_greenlets is None:
6454 * root_greenlets = get_roots_and_hubs()
6455 * hub = root_greenlets.get(glet) # <<<<<<<<<<<<<<
6456 *
6457 * if hub is not None and hub.loop is not None:
6458 */
6459 if (unlikely(__pyx_v_root_greenlets == Py_None)) {
6460 PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
6461 __PYX_ERR(0, 398, __pyx_L1_error)
6462 }
6463 __pyx_t_3 = __Pyx_PyDict_GetItemDefault(__pyx_v_root_greenlets, __pyx_v_glet, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
6464 __Pyx_GOTREF(__pyx_t_3);
6465 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 398, __pyx_L1_error)
6466 __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3));
6467 __pyx_t_3 = 0;
6468
6469 /* "src/gevent/_abstract_linkable.py":395
6470 * parent = glet.parent
6471 *
6472 * if hub is None: # <<<<<<<<<<<<<<
6473 * if root_greenlets is None:
6474 * root_greenlets = get_roots_and_hubs()
6475 */
6476 }
6477
6478 /* "src/gevent/_abstract_linkable.py":400
6479 * hub = root_greenlets.get(glet)
6480 *
6481 * if hub is not None and hub.loop is not None: # <<<<<<<<<<<<<<
6482 * hub.loop.run_callback_threadsafe(link, self)
6483 * if hub is None or hub.loop is None:
6484 */
6485 __pyx_t_4 = (((PyObject *)__pyx_v_hub) != Py_None);
6486 __pyx_t_2 = (__pyx_t_4 != 0);
6487 if (__pyx_t_2) {
6488 } else {
6489 __pyx_t_1 = __pyx_t_2;
6490 goto __pyx_L17_bool_binop_done;
6491 }
6492 __pyx_t_2 = (__pyx_v_hub->loop != Py_None);
6493 __pyx_t_4 = (__pyx_t_2 != 0);
6494 __pyx_t_1 = __pyx_t_4;
6495 __pyx_L17_bool_binop_done:;
6496 if (__pyx_t_1) {
6497
6498 /* "src/gevent/_abstract_linkable.py":401
6499 *
6500 * if hub is not None and hub.loop is not None:
6501 * hub.loop.run_callback_threadsafe(link, self) # <<<<<<<<<<<<<<
6502 * if hub is None or hub.loop is None:
6503 * # We couldn't handle it
6504 */
6505 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_hub->loop, __pyx_n_s_run_callback_threadsafe); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 401, __pyx_L1_error)
6506 __Pyx_GOTREF(__pyx_t_5);
6507 __pyx_t_6 = NULL;
6508 __pyx_t_7 = 0;
6509 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
6510 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
6511 if (likely(__pyx_t_6)) {
6512 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
6513 __Pyx_INCREF(__pyx_t_6);
6514 __Pyx_INCREF(function);
6515 __Pyx_DECREF_SET(__pyx_t_5, function);
6516 __pyx_t_7 = 1;
6517 }
6518 }
6519 {
6520 PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_v_link, ((PyObject *)__pyx_v_self)};
6521 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_7, 2+__pyx_t_7);
6522 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6523 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
6524 __Pyx_GOTREF(__pyx_t_3);
6525 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6526 }
6527 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6528
6529 /* "src/gevent/_abstract_linkable.py":400
6530 * hub = root_greenlets.get(glet)
6531 *
6532 * if hub is not None and hub.loop is not None: # <<<<<<<<<<<<<<
6533 * hub.loop.run_callback_threadsafe(link, self)
6534 * if hub is None or hub.loop is None:
6535 */
6536 }
6537
6538 /* "src/gevent/_abstract_linkable.py":384
6539 * hub = None # Also serves as a "handled?" flag
6540 * # Is it a greenlet.switch method?
6541 * if (getattr(link, '__name__', None) == 'switch' # <<<<<<<<<<<<<<
6542 * and isinstance(getattr(link, '__self__', None), greenlet)):
6543 * glet = link.__self__
6544 */
6545 }
6546
6547 /* "src/gevent/_abstract_linkable.py":402
6548 * if hub is not None and hub.loop is not None:
6549 * hub.loop.run_callback_threadsafe(link, self)
6550 * if hub is None or hub.loop is None: # <<<<<<<<<<<<<<
6551 * # We couldn't handle it
6552 * self.__print_unswitched_warning(link, printed_tb)
6553 */
6554 __pyx_t_4 = (((PyObject *)__pyx_v_hub) == Py_None);
6555 __pyx_t_2 = (__pyx_t_4 != 0);
6556 if (!__pyx_t_2) {
6557 } else {
6558 __pyx_t_1 = __pyx_t_2;
6559 goto __pyx_L20_bool_binop_done;
6560 }
6561 __pyx_t_2 = (__pyx_v_hub->loop == Py_None);
6562 __pyx_t_4 = (__pyx_t_2 != 0);
6563 __pyx_t_1 = __pyx_t_4;
6564 __pyx_L20_bool_binop_done:;
6565 if (__pyx_t_1) {
6566
6567 /* "src/gevent/_abstract_linkable.py":404
6568 * if hub is None or hub.loop is None:
6569 * # We couldn't handle it
6570 * self.__print_unswitched_warning(link, printed_tb) # <<<<<<<<<<<<<<
6571 * printed_tb = True
6572 *
6573 */
6574 __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_AbstractLinkable__print_unswitched_warning(__pyx_v_self, __pyx_v_link, __pyx_v_printed_tb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 404, __pyx_L1_error)
6575 __Pyx_GOTREF(__pyx_t_3);
6576 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6577
6578 /* "src/gevent/_abstract_linkable.py":405
6579 * # We couldn't handle it
6580 * self.__print_unswitched_warning(link, printed_tb)
6581 * printed_tb = True # <<<<<<<<<<<<<<
6582 *
6583 *
6584 */
6585 __pyx_v_printed_tb = 1;
6586
6587 /* "src/gevent/_abstract_linkable.py":402
6588 * if hub is not None and hub.loop is not None:
6589 * hub.loop.run_callback_threadsafe(link, self)
6590 * if hub is None or hub.loop is None: # <<<<<<<<<<<<<<
6591 * # We couldn't handle it
6592 * self.__print_unswitched_warning(link, printed_tb)
6593 */
6594 }
6595 }
6596 __pyx_L4_break:;
6597
6598 /* "src/gevent/_abstract_linkable.py":350
6599 *
6600 *
6601 * def _handle_unswitched_notifications(self, unswitched): # <<<<<<<<<<<<<<
6602 * # Given a list of callable objects that raised
6603 * # ``greenlet.error`` when we called them: If we can determine
6604 */
6605
6606 /* function exit code */
6607 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6608 goto __pyx_L0;
6609 __pyx_L1_error:;
6610 __Pyx_XDECREF(__pyx_t_3);
6611 __Pyx_XDECREF(__pyx_t_5);
6612 __Pyx_XDECREF(__pyx_t_6);
6613 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._handle_unswitched_notifications", __pyx_clineno, __pyx_lineno, __pyx_filename);
6614 __pyx_r = 0;
6615 __pyx_L0:;
6616 __Pyx_XDECREF((PyObject *)__pyx_v_hub);
6617 __Pyx_XDECREF(__pyx_v_root_greenlets);
6618 __Pyx_XDECREF(__pyx_v_link);
6619 __Pyx_XDECREF(__pyx_v_glet);
6620 __Pyx_XDECREF(__pyx_v_parent);
6621 __Pyx_XGIVEREF(__pyx_r);
6622 __Pyx_RefNannyFinishContext();
6623 return __pyx_r;
6624 }
6625
6626 /* "src/gevent/_abstract_linkable.py":408
6627 *
6628 *
6629 * def __print_unswitched_warning(self, link, printed_tb): # <<<<<<<<<<<<<<
6630 * print('gevent: error: Unable to switch to greenlet', link,
6631 * 'from', self, '; crossing thread boundaries is not allowed.',
6632 */
6633
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__print_unswitched_warning(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_link,int __pyx_v_printed_tb)6634 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__print_unswitched_warning(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_link, int __pyx_v_printed_tb) {
6635 PyObject *__pyx_v_traceback = NULL;
6636 PyObject *__pyx_r = NULL;
6637 __Pyx_RefNannyDeclarations
6638 PyObject *__pyx_t_1 = NULL;
6639 PyObject *__pyx_t_2 = NULL;
6640 PyObject *__pyx_t_3 = NULL;
6641 PyObject *__pyx_t_4 = NULL;
6642 int __pyx_t_5;
6643 int __pyx_t_6;
6644 int __pyx_lineno = 0;
6645 const char *__pyx_filename = NULL;
6646 int __pyx_clineno = 0;
6647 __Pyx_RefNannySetupContext("_AbstractLinkable__print_unswitched_warning", 0);
6648
6649 /* "src/gevent/_abstract_linkable.py":409
6650 *
6651 * def __print_unswitched_warning(self, link, printed_tb):
6652 * print('gevent: error: Unable to switch to greenlet', link, # <<<<<<<<<<<<<<
6653 * 'from', self, '; crossing thread boundaries is not allowed.',
6654 * file=sys.stderr)
6655 */
6656 __pyx_t_1 = PyTuple_New(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 409, __pyx_L1_error)
6657 __Pyx_GOTREF(__pyx_t_1);
6658 __Pyx_INCREF(__pyx_kp_s_gevent_error_Unable_to_switch_to);
6659 __Pyx_GIVEREF(__pyx_kp_s_gevent_error_Unable_to_switch_to);
6660 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_s_gevent_error_Unable_to_switch_to);
6661 __Pyx_INCREF(__pyx_v_link);
6662 __Pyx_GIVEREF(__pyx_v_link);
6663 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_link);
6664 __Pyx_INCREF(__pyx_n_s_from);
6665 __Pyx_GIVEREF(__pyx_n_s_from);
6666 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_from);
6667 __Pyx_INCREF((PyObject *)__pyx_v_self);
6668 __Pyx_GIVEREF((PyObject *)__pyx_v_self);
6669 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_self));
6670 __Pyx_INCREF(__pyx_kp_s_crossing_thread_boundaries_is_n);
6671 __Pyx_GIVEREF(__pyx_kp_s_crossing_thread_boundaries_is_n);
6672 PyTuple_SET_ITEM(__pyx_t_1, 4, __pyx_kp_s_crossing_thread_boundaries_is_n);
6673
6674 /* "src/gevent/_abstract_linkable.py":411
6675 * print('gevent: error: Unable to switch to greenlet', link,
6676 * 'from', self, '; crossing thread boundaries is not allowed.',
6677 * file=sys.stderr) # <<<<<<<<<<<<<<
6678 *
6679 * if not printed_tb:
6680 */
6681 __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 411, __pyx_L1_error)
6682 __Pyx_GOTREF(__pyx_t_2);
6683 __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 411, __pyx_L1_error)
6684 __Pyx_GOTREF(__pyx_t_3);
6685 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_stderr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 411, __pyx_L1_error)
6686 __Pyx_GOTREF(__pyx_t_4);
6687 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6688 if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_file, __pyx_t_4) < 0) __PYX_ERR(0, 411, __pyx_L1_error)
6689 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6690
6691 /* "src/gevent/_abstract_linkable.py":409
6692 *
6693 * def __print_unswitched_warning(self, link, printed_tb):
6694 * print('gevent: error: Unable to switch to greenlet', link, # <<<<<<<<<<<<<<
6695 * 'from', self, '; crossing thread boundaries is not allowed.',
6696 * file=sys.stderr)
6697 */
6698 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
6699 __Pyx_GOTREF(__pyx_t_4);
6700 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6701 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6702 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6703
6704 /* "src/gevent/_abstract_linkable.py":413
6705 * file=sys.stderr)
6706 *
6707 * if not printed_tb: # <<<<<<<<<<<<<<
6708 * printed_tb = True
6709 * print(
6710 */
6711 __pyx_t_5 = ((!(__pyx_v_printed_tb != 0)) != 0);
6712 if (__pyx_t_5) {
6713
6714 /* "src/gevent/_abstract_linkable.py":414
6715 *
6716 * if not printed_tb:
6717 * printed_tb = True # <<<<<<<<<<<<<<
6718 * print(
6719 * 'gevent: error: '
6720 */
6721 __pyx_v_printed_tb = 1;
6722
6723 /* "src/gevent/_abstract_linkable.py":418
6724 * 'gevent: error: '
6725 * 'This is a result of using gevent objects from multiple threads,',
6726 * 'and is a bug in the calling code.', file=sys.stderr) # <<<<<<<<<<<<<<
6727 *
6728 * import traceback
6729 */
6730 __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 418, __pyx_L1_error)
6731 __Pyx_GOTREF(__pyx_t_4);
6732 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
6733 __Pyx_GOTREF(__pyx_t_2);
6734 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stderr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 418, __pyx_L1_error)
6735 __Pyx_GOTREF(__pyx_t_1);
6736 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6737 if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_file, __pyx_t_1) < 0) __PYX_ERR(0, 418, __pyx_L1_error)
6738 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6739
6740 /* "src/gevent/_abstract_linkable.py":415
6741 * if not printed_tb:
6742 * printed_tb = True
6743 * print( # <<<<<<<<<<<<<<
6744 * 'gevent: error: '
6745 * 'This is a result of using gevent objects from multiple threads,',
6746 */
6747 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 415, __pyx_L1_error)
6748 __Pyx_GOTREF(__pyx_t_1);
6749 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6750 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6751
6752 /* "src/gevent/_abstract_linkable.py":420
6753 * 'and is a bug in the calling code.', file=sys.stderr)
6754 *
6755 * import traceback # <<<<<<<<<<<<<<
6756 * traceback.print_stack()
6757 *
6758 */
6759 __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_traceback, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
6760 __Pyx_GOTREF(__pyx_t_1);
6761 __pyx_v_traceback = __pyx_t_1;
6762 __pyx_t_1 = 0;
6763
6764 /* "src/gevent/_abstract_linkable.py":421
6765 *
6766 * import traceback
6767 * traceback.print_stack() # <<<<<<<<<<<<<<
6768 *
6769 * def _quiet_unlink_all(self, obj):
6770 */
6771 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_traceback, __pyx_n_s_print_stack); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 421, __pyx_L1_error)
6772 __Pyx_GOTREF(__pyx_t_4);
6773 __pyx_t_2 = NULL;
6774 __pyx_t_6 = 0;
6775 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
6776 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
6777 if (likely(__pyx_t_2)) {
6778 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
6779 __Pyx_INCREF(__pyx_t_2);
6780 __Pyx_INCREF(function);
6781 __Pyx_DECREF_SET(__pyx_t_4, function);
6782 __pyx_t_6 = 1;
6783 }
6784 }
6785 {
6786 PyObject *__pyx_callargs[1] = {__pyx_t_2, };
6787 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 0+__pyx_t_6);
6788 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6789 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 421, __pyx_L1_error)
6790 __Pyx_GOTREF(__pyx_t_1);
6791 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6792 }
6793 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6794
6795 /* "src/gevent/_abstract_linkable.py":413
6796 * file=sys.stderr)
6797 *
6798 * if not printed_tb: # <<<<<<<<<<<<<<
6799 * printed_tb = True
6800 * print(
6801 */
6802 }
6803
6804 /* "src/gevent/_abstract_linkable.py":408
6805 *
6806 *
6807 * def __print_unswitched_warning(self, link, printed_tb): # <<<<<<<<<<<<<<
6808 * print('gevent: error: Unable to switch to greenlet', link,
6809 * 'from', self, '; crossing thread boundaries is not allowed.',
6810 */
6811
6812 /* function exit code */
6813 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6814 goto __pyx_L0;
6815 __pyx_L1_error:;
6816 __Pyx_XDECREF(__pyx_t_1);
6817 __Pyx_XDECREF(__pyx_t_2);
6818 __Pyx_XDECREF(__pyx_t_3);
6819 __Pyx_XDECREF(__pyx_t_4);
6820 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._AbstractLinkable__print_unswitched_warning", __pyx_clineno, __pyx_lineno, __pyx_filename);
6821 __pyx_r = 0;
6822 __pyx_L0:;
6823 __Pyx_XDECREF(__pyx_v_traceback);
6824 __Pyx_XGIVEREF(__pyx_r);
6825 __Pyx_RefNannyFinishContext();
6826 return __pyx_r;
6827 }
6828
6829 /* "src/gevent/_abstract_linkable.py":423
6830 * traceback.print_stack()
6831 *
6832 * def _quiet_unlink_all(self, obj): # <<<<<<<<<<<<<<
6833 * if obj is None:
6834 * return
6835 */
6836
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__quiet_unlink_all(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_obj)6837 static void __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__quiet_unlink_all(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_obj) {
6838 __Pyx_RefNannyDeclarations
6839 int __pyx_t_1;
6840 int __pyx_t_2;
6841 PyObject *__pyx_t_3 = NULL;
6842 int __pyx_t_4;
6843 PyObject *__pyx_t_5 = NULL;
6844 PyObject *__pyx_t_6 = NULL;
6845 PyObject *__pyx_t_7 = NULL;
6846 PyObject *__pyx_t_8 = NULL;
6847 PyObject *__pyx_t_9 = NULL;
6848 int __pyx_t_10;
6849 int __pyx_lineno = 0;
6850 const char *__pyx_filename = NULL;
6851 int __pyx_clineno = 0;
6852 __Pyx_RefNannySetupContext("_quiet_unlink_all", 0);
6853
6854 /* "src/gevent/_abstract_linkable.py":424
6855 *
6856 * def _quiet_unlink_all(self, obj):
6857 * if obj is None: # <<<<<<<<<<<<<<
6858 * return
6859 *
6860 */
6861 __pyx_t_1 = (__pyx_v_obj == Py_None);
6862 __pyx_t_2 = (__pyx_t_1 != 0);
6863 if (__pyx_t_2) {
6864
6865 /* "src/gevent/_abstract_linkable.py":425
6866 * def _quiet_unlink_all(self, obj):
6867 * if obj is None:
6868 * return # <<<<<<<<<<<<<<
6869 *
6870 * self.unlink(obj)
6871 */
6872 goto __pyx_L0;
6873
6874 /* "src/gevent/_abstract_linkable.py":424
6875 *
6876 * def _quiet_unlink_all(self, obj):
6877 * if obj is None: # <<<<<<<<<<<<<<
6878 * return
6879 *
6880 */
6881 }
6882
6883 /* "src/gevent/_abstract_linkable.py":427
6884 * return
6885 *
6886 * self.unlink(obj) # <<<<<<<<<<<<<<
6887 * if self._notifier is not None and self._notifier.args:
6888 * try:
6889 */
6890 __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_obj, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
6891 __Pyx_GOTREF(__pyx_t_3);
6892 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6893
6894 /* "src/gevent/_abstract_linkable.py":428
6895 *
6896 * self.unlink(obj)
6897 * if self._notifier is not None and self._notifier.args: # <<<<<<<<<<<<<<
6898 * try:
6899 * self._notifier.args[0].remove(obj)
6900 */
6901 __pyx_t_1 = (__pyx_v_self->_notifier != Py_None);
6902 __pyx_t_4 = (__pyx_t_1 != 0);
6903 if (__pyx_t_4) {
6904 } else {
6905 __pyx_t_2 = __pyx_t_4;
6906 goto __pyx_L5_bool_binop_done;
6907 }
6908 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_args); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
6909 __Pyx_GOTREF(__pyx_t_3);
6910 __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 428, __pyx_L1_error)
6911 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6912 __pyx_t_2 = __pyx_t_4;
6913 __pyx_L5_bool_binop_done:;
6914 if (__pyx_t_2) {
6915
6916 /* "src/gevent/_abstract_linkable.py":429
6917 * self.unlink(obj)
6918 * if self._notifier is not None and self._notifier.args:
6919 * try: # <<<<<<<<<<<<<<
6920 * self._notifier.args[0].remove(obj)
6921 * except ValueError:
6922 */
6923 {
6924 __Pyx_PyThreadState_declare
6925 __Pyx_PyThreadState_assign
6926 __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
6927 __Pyx_XGOTREF(__pyx_t_5);
6928 __Pyx_XGOTREF(__pyx_t_6);
6929 __Pyx_XGOTREF(__pyx_t_7);
6930 /*try:*/ {
6931
6932 /* "src/gevent/_abstract_linkable.py":430
6933 * if self._notifier is not None and self._notifier.args:
6934 * try:
6935 * self._notifier.args[0].remove(obj) # <<<<<<<<<<<<<<
6936 * except ValueError:
6937 * pass
6938 */
6939 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 430, __pyx_L7_error)
6940 __Pyx_GOTREF(__pyx_t_8);
6941 __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 430, __pyx_L7_error)
6942 __Pyx_GOTREF(__pyx_t_9);
6943 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6944 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_remove); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 430, __pyx_L7_error)
6945 __Pyx_GOTREF(__pyx_t_8);
6946 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6947 __pyx_t_9 = NULL;
6948 __pyx_t_10 = 0;
6949 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
6950 __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
6951 if (likely(__pyx_t_9)) {
6952 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
6953 __Pyx_INCREF(__pyx_t_9);
6954 __Pyx_INCREF(function);
6955 __Pyx_DECREF_SET(__pyx_t_8, function);
6956 __pyx_t_10 = 1;
6957 }
6958 }
6959 {
6960 PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_v_obj};
6961 __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
6962 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6963 if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L7_error)
6964 __Pyx_GOTREF(__pyx_t_3);
6965 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
6966 }
6967 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6968
6969 /* "src/gevent/_abstract_linkable.py":429
6970 * self.unlink(obj)
6971 * if self._notifier is not None and self._notifier.args:
6972 * try: # <<<<<<<<<<<<<<
6973 * self._notifier.args[0].remove(obj)
6974 * except ValueError:
6975 */
6976 }
6977 __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
6978 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6979 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6980 goto __pyx_L12_try_end;
6981 __pyx_L7_error:;
6982 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6983 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
6984 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
6985
6986 /* "src/gevent/_abstract_linkable.py":431
6987 * try:
6988 * self._notifier.args[0].remove(obj)
6989 * except ValueError: # <<<<<<<<<<<<<<
6990 * pass
6991 *
6992 */
6993 __pyx_t_10 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
6994 if (__pyx_t_10) {
6995 __Pyx_ErrRestore(0,0,0);
6996 goto __pyx_L8_exception_handled;
6997 }
6998 goto __pyx_L9_except_error;
6999 __pyx_L9_except_error:;
7000
7001 /* "src/gevent/_abstract_linkable.py":429
7002 * self.unlink(obj)
7003 * if self._notifier is not None and self._notifier.args:
7004 * try: # <<<<<<<<<<<<<<
7005 * self._notifier.args[0].remove(obj)
7006 * except ValueError:
7007 */
7008 __Pyx_XGIVEREF(__pyx_t_5);
7009 __Pyx_XGIVEREF(__pyx_t_6);
7010 __Pyx_XGIVEREF(__pyx_t_7);
7011 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
7012 goto __pyx_L1_error;
7013 __pyx_L8_exception_handled:;
7014 __Pyx_XGIVEREF(__pyx_t_5);
7015 __Pyx_XGIVEREF(__pyx_t_6);
7016 __Pyx_XGIVEREF(__pyx_t_7);
7017 __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
7018 __pyx_L12_try_end:;
7019 }
7020
7021 /* "src/gevent/_abstract_linkable.py":428
7022 *
7023 * self.unlink(obj)
7024 * if self._notifier is not None and self._notifier.args: # <<<<<<<<<<<<<<
7025 * try:
7026 * self._notifier.args[0].remove(obj)
7027 */
7028 }
7029
7030 /* "src/gevent/_abstract_linkable.py":423
7031 * traceback.print_stack()
7032 *
7033 * def _quiet_unlink_all(self, obj): # <<<<<<<<<<<<<<
7034 * if obj is None:
7035 * return
7036 */
7037
7038 /* function exit code */
7039 goto __pyx_L0;
7040 __pyx_L1_error:;
7041 __Pyx_XDECREF(__pyx_t_3);
7042 __Pyx_XDECREF(__pyx_t_8);
7043 __Pyx_XDECREF(__pyx_t_9);
7044 __Pyx_WriteUnraisable("gevent._gevent_c_abstract_linkable.AbstractLinkable._quiet_unlink_all", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
7045 __pyx_L0:;
7046 __Pyx_RefNannyFinishContext();
7047 }
7048
7049 /* "src/gevent/_abstract_linkable.py":434
7050 * pass
7051 *
7052 * def __wait_to_be_notified(self, rawlink): # pylint:disable=too-many-branches # <<<<<<<<<<<<<<
7053 * resume_this_greenlet = getcurrent().switch # pylint:disable=undefined-variable
7054 * if rawlink:
7055 */
7056
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__wait_to_be_notified(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,int __pyx_v_rawlink)7057 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__wait_to_be_notified(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_v_rawlink) {
7058 PyObject *__pyx_v_resume_this_greenlet = NULL;
7059 PyObject *__pyx_r = NULL;
7060 __Pyx_RefNannyDeclarations
7061 PyObject *__pyx_t_1 = NULL;
7062 PyObject *__pyx_t_2 = NULL;
7063 int __pyx_t_3;
7064 int __pyx_t_4;
7065 int __pyx_t_5;
7066 int __pyx_t_6;
7067 char const *__pyx_t_7;
7068 PyObject *__pyx_t_8 = NULL;
7069 PyObject *__pyx_t_9 = NULL;
7070 PyObject *__pyx_t_10 = NULL;
7071 PyObject *__pyx_t_11 = NULL;
7072 PyObject *__pyx_t_12 = NULL;
7073 PyObject *__pyx_t_13 = NULL;
7074 int __pyx_lineno = 0;
7075 const char *__pyx_filename = NULL;
7076 int __pyx_clineno = 0;
7077 __Pyx_RefNannySetupContext("_AbstractLinkable__wait_to_be_notified", 0);
7078
7079 /* "src/gevent/_abstract_linkable.py":435
7080 *
7081 * def __wait_to_be_notified(self, rawlink): # pylint:disable=too-many-branches
7082 * resume_this_greenlet = getcurrent().switch # pylint:disable=undefined-variable # <<<<<<<<<<<<<<
7083 * if rawlink:
7084 * self.rawlink(resume_this_greenlet)
7085 */
7086 __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
7087 __Pyx_GOTREF(__pyx_t_1);
7088 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
7089 __Pyx_GOTREF(__pyx_t_2);
7090 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7091 __pyx_v_resume_this_greenlet = __pyx_t_2;
7092 __pyx_t_2 = 0;
7093
7094 /* "src/gevent/_abstract_linkable.py":436
7095 * def __wait_to_be_notified(self, rawlink): # pylint:disable=too-many-branches
7096 * resume_this_greenlet = getcurrent().switch # pylint:disable=undefined-variable
7097 * if rawlink: # <<<<<<<<<<<<<<
7098 * self.rawlink(resume_this_greenlet)
7099 * else:
7100 */
7101 __pyx_t_3 = (__pyx_v_rawlink != 0);
7102 if (__pyx_t_3) {
7103
7104 /* "src/gevent/_abstract_linkable.py":437
7105 * resume_this_greenlet = getcurrent().switch # pylint:disable=undefined-variable
7106 * if rawlink:
7107 * self.rawlink(resume_this_greenlet) # <<<<<<<<<<<<<<
7108 * else:
7109 * self._notifier.args[0].append(resume_this_greenlet)
7110 */
7111 __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_resume_this_greenlet, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
7112 __Pyx_GOTREF(__pyx_t_2);
7113 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7114
7115 /* "src/gevent/_abstract_linkable.py":436
7116 * def __wait_to_be_notified(self, rawlink): # pylint:disable=too-many-branches
7117 * resume_this_greenlet = getcurrent().switch # pylint:disable=undefined-variable
7118 * if rawlink: # <<<<<<<<<<<<<<
7119 * self.rawlink(resume_this_greenlet)
7120 * else:
7121 */
7122 goto __pyx_L3;
7123 }
7124
7125 /* "src/gevent/_abstract_linkable.py":439
7126 * self.rawlink(resume_this_greenlet)
7127 * else:
7128 * self._notifier.args[0].append(resume_this_greenlet) # <<<<<<<<<<<<<<
7129 *
7130 * try:
7131 */
7132 /*else*/ {
7133 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_n_s_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 439, __pyx_L1_error)
7134 __Pyx_GOTREF(__pyx_t_2);
7135 __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
7136 __Pyx_GOTREF(__pyx_t_1);
7137 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7138 __pyx_t_4 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_resume_this_greenlet); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 439, __pyx_L1_error)
7139 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7140 }
7141 __pyx_L3:;
7142
7143 /* "src/gevent/_abstract_linkable.py":441
7144 * self._notifier.args[0].append(resume_this_greenlet)
7145 *
7146 * try: # <<<<<<<<<<<<<<
7147 * self._switch_to_hub(self.hub)
7148 * # If we got here, we were automatically unlinked already.
7149 */
7150 /*try:*/ {
7151
7152 /* "src/gevent/_abstract_linkable.py":442
7153 *
7154 * try:
7155 * self._switch_to_hub(self.hub) # <<<<<<<<<<<<<<
7156 * # If we got here, we were automatically unlinked already.
7157 * resume_this_greenlet = None
7158 */
7159 __pyx_t_1 = ((PyObject *)__pyx_v_self->hub);
7160 __Pyx_INCREF(__pyx_t_1);
7161 __pyx_t_5 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_switch_to_hub(__pyx_v_self, __pyx_t_1); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(0, 442, __pyx_L5_error)
7162 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7163
7164 /* "src/gevent/_abstract_linkable.py":444
7165 * self._switch_to_hub(self.hub)
7166 * # If we got here, we were automatically unlinked already.
7167 * resume_this_greenlet = None # <<<<<<<<<<<<<<
7168 * finally:
7169 * self._quiet_unlink_all(resume_this_greenlet)
7170 */
7171 __Pyx_INCREF(Py_None);
7172 __Pyx_DECREF_SET(__pyx_v_resume_this_greenlet, Py_None);
7173 }
7174
7175 /* "src/gevent/_abstract_linkable.py":446
7176 * resume_this_greenlet = None
7177 * finally:
7178 * self._quiet_unlink_all(resume_this_greenlet) # <<<<<<<<<<<<<<
7179 *
7180 * def _switch_to_hub(self, the_hub):
7181 */
7182 /*finally:*/ {
7183 /*normal exit:*/{
7184 ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_quiet_unlink_all(__pyx_v_self, __pyx_v_resume_this_greenlet);
7185 goto __pyx_L6;
7186 }
7187 __pyx_L5_error:;
7188 /*exception exit:*/{
7189 __Pyx_PyThreadState_declare
7190 __Pyx_PyThreadState_assign
7191 __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
7192 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7193 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7194 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
7195 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10) < 0)) __Pyx_ErrFetch(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
7196 __Pyx_XGOTREF(__pyx_t_8);
7197 __Pyx_XGOTREF(__pyx_t_9);
7198 __Pyx_XGOTREF(__pyx_t_10);
7199 __Pyx_XGOTREF(__pyx_t_11);
7200 __Pyx_XGOTREF(__pyx_t_12);
7201 __Pyx_XGOTREF(__pyx_t_13);
7202 __pyx_t_5 = __pyx_lineno; __pyx_t_6 = __pyx_clineno; __pyx_t_7 = __pyx_filename;
7203 {
7204 ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_quiet_unlink_all(__pyx_v_self, __pyx_v_resume_this_greenlet);
7205 }
7206 if (PY_MAJOR_VERSION >= 3) {
7207 __Pyx_XGIVEREF(__pyx_t_11);
7208 __Pyx_XGIVEREF(__pyx_t_12);
7209 __Pyx_XGIVEREF(__pyx_t_13);
7210 __Pyx_ExceptionReset(__pyx_t_11, __pyx_t_12, __pyx_t_13);
7211 }
7212 __Pyx_XGIVEREF(__pyx_t_8);
7213 __Pyx_XGIVEREF(__pyx_t_9);
7214 __Pyx_XGIVEREF(__pyx_t_10);
7215 __Pyx_ErrRestore(__pyx_t_8, __pyx_t_9, __pyx_t_10);
7216 __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0;
7217 __pyx_lineno = __pyx_t_5; __pyx_clineno = __pyx_t_6; __pyx_filename = __pyx_t_7;
7218 goto __pyx_L1_error;
7219 }
7220 __pyx_L6:;
7221 }
7222
7223 /* "src/gevent/_abstract_linkable.py":434
7224 * pass
7225 *
7226 * def __wait_to_be_notified(self, rawlink): # pylint:disable=too-many-branches # <<<<<<<<<<<<<<
7227 * resume_this_greenlet = getcurrent().switch # pylint:disable=undefined-variable
7228 * if rawlink:
7229 */
7230
7231 /* function exit code */
7232 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7233 goto __pyx_L0;
7234 __pyx_L1_error:;
7235 __Pyx_XDECREF(__pyx_t_1);
7236 __Pyx_XDECREF(__pyx_t_2);
7237 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._AbstractLinkable__wait_to_be_notified", __pyx_clineno, __pyx_lineno, __pyx_filename);
7238 __pyx_r = 0;
7239 __pyx_L0:;
7240 __Pyx_XDECREF(__pyx_v_resume_this_greenlet);
7241 __Pyx_XGIVEREF(__pyx_r);
7242 __Pyx_RefNannyFinishContext();
7243 return __pyx_r;
7244 }
7245
7246 /* "src/gevent/_abstract_linkable.py":448
7247 * self._quiet_unlink_all(resume_this_greenlet)
7248 *
7249 * def _switch_to_hub(self, the_hub): # <<<<<<<<<<<<<<
7250 * self._drop_lock_for_switch_out()
7251 * try:
7252 */
7253
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__switch_to_hub(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_the_hub)7254 static int __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__switch_to_hub(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_the_hub) {
7255 PyObject *__pyx_v_result = NULL;
7256 int __pyx_r;
7257 __Pyx_RefNannyDeclarations
7258 PyObject *__pyx_t_1 = NULL;
7259 PyObject *__pyx_t_2 = NULL;
7260 PyObject *__pyx_t_3 = NULL;
7261 int __pyx_t_4;
7262 int __pyx_t_5;
7263 char const *__pyx_t_6;
7264 PyObject *__pyx_t_7 = NULL;
7265 PyObject *__pyx_t_8 = NULL;
7266 PyObject *__pyx_t_9 = NULL;
7267 PyObject *__pyx_t_10 = NULL;
7268 PyObject *__pyx_t_11 = NULL;
7269 PyObject *__pyx_t_12 = NULL;
7270 int __pyx_t_13;
7271 int __pyx_t_14;
7272 PyObject *__pyx_t_15 = NULL;
7273 int __pyx_lineno = 0;
7274 const char *__pyx_filename = NULL;
7275 int __pyx_clineno = 0;
7276 __Pyx_RefNannySetupContext("_switch_to_hub", 0);
7277
7278 /* "src/gevent/_abstract_linkable.py":449
7279 *
7280 * def _switch_to_hub(self, the_hub):
7281 * self._drop_lock_for_switch_out() # <<<<<<<<<<<<<<
7282 * try:
7283 * result = the_hub.switch()
7284 */
7285 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_drop_lock_for_switch_out(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
7286 __Pyx_GOTREF(__pyx_t_1);
7287 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7288
7289 /* "src/gevent/_abstract_linkable.py":450
7290 * def _switch_to_hub(self, the_hub):
7291 * self._drop_lock_for_switch_out()
7292 * try: # <<<<<<<<<<<<<<
7293 * result = the_hub.switch()
7294 * finally:
7295 */
7296 /*try:*/ {
7297
7298 /* "src/gevent/_abstract_linkable.py":451
7299 * self._drop_lock_for_switch_out()
7300 * try:
7301 * result = the_hub.switch() # <<<<<<<<<<<<<<
7302 * finally:
7303 * self._acquire_lock_for_switch_in()
7304 */
7305 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_the_hub, __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L4_error)
7306 __Pyx_GOTREF(__pyx_t_2);
7307 __pyx_t_3 = NULL;
7308 __pyx_t_4 = 0;
7309 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7310 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7311 if (likely(__pyx_t_3)) {
7312 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7313 __Pyx_INCREF(__pyx_t_3);
7314 __Pyx_INCREF(function);
7315 __Pyx_DECREF_SET(__pyx_t_2, function);
7316 __pyx_t_4 = 1;
7317 }
7318 }
7319 {
7320 PyObject *__pyx_callargs[1] = {__pyx_t_3, };
7321 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
7322 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7323 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L4_error)
7324 __Pyx_GOTREF(__pyx_t_1);
7325 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7326 }
7327 __pyx_v_result = __pyx_t_1;
7328 __pyx_t_1 = 0;
7329 }
7330
7331 /* "src/gevent/_abstract_linkable.py":453
7332 * result = the_hub.switch()
7333 * finally:
7334 * self._acquire_lock_for_switch_in() # <<<<<<<<<<<<<<
7335 * if result is not self: # pragma: no cover
7336 * raise InvalidSwitchError(
7337 */
7338 /*finally:*/ {
7339 /*normal exit:*/{
7340 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_acquire_lock_for_switch_in(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
7341 __Pyx_GOTREF(__pyx_t_1);
7342 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7343 goto __pyx_L5;
7344 }
7345 __pyx_L4_error:;
7346 /*exception exit:*/{
7347 __Pyx_PyThreadState_declare
7348 __Pyx_PyThreadState_assign
7349 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
7350 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7351 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7352 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7353 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
7354 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
7355 __Pyx_XGOTREF(__pyx_t_7);
7356 __Pyx_XGOTREF(__pyx_t_8);
7357 __Pyx_XGOTREF(__pyx_t_9);
7358 __Pyx_XGOTREF(__pyx_t_10);
7359 __Pyx_XGOTREF(__pyx_t_11);
7360 __Pyx_XGOTREF(__pyx_t_12);
7361 __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
7362 {
7363 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_acquire_lock_for_switch_in(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L7_error)
7364 __Pyx_GOTREF(__pyx_t_1);
7365 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7366 }
7367 if (PY_MAJOR_VERSION >= 3) {
7368 __Pyx_XGIVEREF(__pyx_t_10);
7369 __Pyx_XGIVEREF(__pyx_t_11);
7370 __Pyx_XGIVEREF(__pyx_t_12);
7371 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
7372 }
7373 __Pyx_XGIVEREF(__pyx_t_7);
7374 __Pyx_XGIVEREF(__pyx_t_8);
7375 __Pyx_XGIVEREF(__pyx_t_9);
7376 __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
7377 __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
7378 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
7379 goto __pyx_L1_error;
7380 __pyx_L7_error:;
7381 if (PY_MAJOR_VERSION >= 3) {
7382 __Pyx_XGIVEREF(__pyx_t_10);
7383 __Pyx_XGIVEREF(__pyx_t_11);
7384 __Pyx_XGIVEREF(__pyx_t_12);
7385 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
7386 }
7387 __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7388 __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
7389 __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7390 __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
7391 goto __pyx_L1_error;
7392 }
7393 __pyx_L5:;
7394 }
7395
7396 /* "src/gevent/_abstract_linkable.py":454
7397 * finally:
7398 * self._acquire_lock_for_switch_in()
7399 * if result is not self: # pragma: no cover # <<<<<<<<<<<<<<
7400 * raise InvalidSwitchError(
7401 * 'Invalid switch into %s.wait(): %r' % (
7402 */
7403 __pyx_t_13 = (__pyx_v_result != ((PyObject *)__pyx_v_self));
7404 __pyx_t_14 = (__pyx_t_13 != 0);
7405 if (unlikely(__pyx_t_14)) {
7406
7407 /* "src/gevent/_abstract_linkable.py":457
7408 * raise InvalidSwitchError(
7409 * 'Invalid switch into %s.wait(): %r' % (
7410 * self.__class__.__name__, # <<<<<<<<<<<<<<
7411 * result,
7412 * )
7413 */
7414 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
7415 __Pyx_GOTREF(__pyx_t_2);
7416 __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
7417 __Pyx_GOTREF(__pyx_t_3);
7418 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7419
7420 /* "src/gevent/_abstract_linkable.py":458
7421 * 'Invalid switch into %s.wait(): %r' % (
7422 * self.__class__.__name__,
7423 * result, # <<<<<<<<<<<<<<
7424 * )
7425 * )
7426 */
7427 __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
7428 __Pyx_GOTREF(__pyx_t_2);
7429 __Pyx_GIVEREF(__pyx_t_3);
7430 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
7431 __Pyx_INCREF(__pyx_v_result);
7432 __Pyx_GIVEREF(__pyx_v_result);
7433 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_result);
7434 __pyx_t_3 = 0;
7435
7436 /* "src/gevent/_abstract_linkable.py":456
7437 * if result is not self: # pragma: no cover
7438 * raise InvalidSwitchError(
7439 * 'Invalid switch into %s.wait(): %r' % ( # <<<<<<<<<<<<<<
7440 * self.__class__.__name__,
7441 * result,
7442 */
7443 __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_switch_into_s_wait_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
7444 __Pyx_GOTREF(__pyx_t_3);
7445 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7446 __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError);
7447 __pyx_t_2 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError; __pyx_t_15 = NULL;
7448 __pyx_t_5 = 0;
7449 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7450 __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_2);
7451 if (likely(__pyx_t_15)) {
7452 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7453 __Pyx_INCREF(__pyx_t_15);
7454 __Pyx_INCREF(function);
7455 __Pyx_DECREF_SET(__pyx_t_2, function);
7456 __pyx_t_5 = 1;
7457 }
7458 }
7459 {
7460 PyObject *__pyx_callargs[2] = {__pyx_t_15, __pyx_t_3};
7461 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
7462 __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
7463 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7464 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
7465 __Pyx_GOTREF(__pyx_t_1);
7466 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7467 }
7468 __Pyx_Raise(__pyx_t_1, 0, 0, 0);
7469 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7470 __PYX_ERR(0, 455, __pyx_L1_error)
7471
7472 /* "src/gevent/_abstract_linkable.py":454
7473 * finally:
7474 * self._acquire_lock_for_switch_in()
7475 * if result is not self: # pragma: no cover # <<<<<<<<<<<<<<
7476 * raise InvalidSwitchError(
7477 * 'Invalid switch into %s.wait(): %r' % (
7478 */
7479 }
7480
7481 /* "src/gevent/_abstract_linkable.py":448
7482 * self._quiet_unlink_all(resume_this_greenlet)
7483 *
7484 * def _switch_to_hub(self, the_hub): # <<<<<<<<<<<<<<
7485 * self._drop_lock_for_switch_out()
7486 * try:
7487 */
7488
7489 /* function exit code */
7490 __pyx_r = 0;
7491 goto __pyx_L0;
7492 __pyx_L1_error:;
7493 __Pyx_XDECREF(__pyx_t_1);
7494 __Pyx_XDECREF(__pyx_t_2);
7495 __Pyx_XDECREF(__pyx_t_3);
7496 __Pyx_XDECREF(__pyx_t_15);
7497 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._switch_to_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
7498 __pyx_r = -1;
7499 __pyx_L0:;
7500 __Pyx_XDECREF(__pyx_v_result);
7501 __Pyx_RefNannyFinishContext();
7502 return __pyx_r;
7503 }
7504
7505 /* "src/gevent/_abstract_linkable.py":462
7506 * )
7507 *
7508 * def _acquire_lock_for_switch_in(self): # <<<<<<<<<<<<<<
7509 * return
7510 *
7511 */
7512
7513 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__acquire_lock_for_switch_in(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,int __pyx_skip_dispatch)7514 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__acquire_lock_for_switch_in(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
7515 PyObject *__pyx_r = NULL;
7516 __Pyx_RefNannyDeclarations
7517 PyObject *__pyx_t_1 = NULL;
7518 PyObject *__pyx_t_2 = NULL;
7519 PyObject *__pyx_t_3 = NULL;
7520 PyObject *__pyx_t_4 = NULL;
7521 int __pyx_t_5;
7522 int __pyx_lineno = 0;
7523 const char *__pyx_filename = NULL;
7524 int __pyx_clineno = 0;
7525 __Pyx_RefNannySetupContext("_acquire_lock_for_switch_in", 0);
7526 /* Check if called by wrapper */
7527 if (unlikely(__pyx_skip_dispatch)) ;
7528 /* Check if overridden in Python */
7529 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
7530 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7531 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7532 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
7533 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7534 #endif
7535 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_acquire_lock_for_switch_in); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
7536 __Pyx_GOTREF(__pyx_t_1);
7537 #ifdef __Pyx_CyFunction_USED
7538 if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
7539 #else
7540 if (!PyCFunction_Check(__pyx_t_1)
7541 #endif
7542 || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in)) {
7543 __Pyx_XDECREF(__pyx_r);
7544 __Pyx_INCREF(__pyx_t_1);
7545 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
7546 __pyx_t_5 = 0;
7547 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7548 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
7549 if (likely(__pyx_t_4)) {
7550 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7551 __Pyx_INCREF(__pyx_t_4);
7552 __Pyx_INCREF(function);
7553 __Pyx_DECREF_SET(__pyx_t_3, function);
7554 __pyx_t_5 = 1;
7555 }
7556 }
7557 {
7558 PyObject *__pyx_callargs[1] = {__pyx_t_4, };
7559 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
7560 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7561 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 462, __pyx_L1_error)
7562 __Pyx_GOTREF(__pyx_t_2);
7563 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7564 }
7565 __pyx_r = __pyx_t_2;
7566 __pyx_t_2 = 0;
7567 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7568 goto __pyx_L0;
7569 }
7570 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7571 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7572 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
7573 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
7574 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7575 }
7576 #endif
7577 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7578 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7579 }
7580 #endif
7581 }
7582
7583 /* "src/gevent/_abstract_linkable.py":463
7584 *
7585 * def _acquire_lock_for_switch_in(self):
7586 * return # <<<<<<<<<<<<<<
7587 *
7588 * def _drop_lock_for_switch_out(self):
7589 */
7590 __Pyx_XDECREF(__pyx_r);
7591 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7592 goto __pyx_L0;
7593
7594 /* "src/gevent/_abstract_linkable.py":462
7595 * )
7596 *
7597 * def _acquire_lock_for_switch_in(self): # <<<<<<<<<<<<<<
7598 * return
7599 *
7600 */
7601
7602 /* function exit code */
7603 __pyx_L1_error:;
7604 __Pyx_XDECREF(__pyx_t_1);
7605 __Pyx_XDECREF(__pyx_t_2);
7606 __Pyx_XDECREF(__pyx_t_3);
7607 __Pyx_XDECREF(__pyx_t_4);
7608 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._acquire_lock_for_switch_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
7609 __pyx_r = 0;
7610 __pyx_L0:;
7611 __Pyx_XGIVEREF(__pyx_r);
7612 __Pyx_RefNannyFinishContext();
7613 return __pyx_r;
7614 }
7615
7616 /* Python wrapper */
7617 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7618 PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in, "AbstractLinkable._acquire_lock_for_switch_in(self)");
7619 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in = {"_acquire_lock_for_switch_in", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)7620 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7621 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7622 PyObject *__pyx_r = 0;
7623 __Pyx_RefNannyDeclarations
7624 __Pyx_RefNannySetupContext("_acquire_lock_for_switch_in (wrapper)", 0);
7625 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));
7626
7627 /* function exit code */
7628 __Pyx_RefNannyFinishContext();
7629 return __pyx_r;
7630 }
7631
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)7632 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
7633 PyObject *__pyx_r = NULL;
7634 __Pyx_RefNannyDeclarations
7635 PyObject *__pyx_t_1 = NULL;
7636 int __pyx_lineno = 0;
7637 const char *__pyx_filename = NULL;
7638 int __pyx_clineno = 0;
7639 __Pyx_RefNannySetupContext("_acquire_lock_for_switch_in", 0);
7640 __Pyx_XDECREF(__pyx_r);
7641 __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__acquire_lock_for_switch_in(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
7642 __Pyx_GOTREF(__pyx_t_1);
7643 __pyx_r = __pyx_t_1;
7644 __pyx_t_1 = 0;
7645 goto __pyx_L0;
7646
7647 /* function exit code */
7648 __pyx_L1_error:;
7649 __Pyx_XDECREF(__pyx_t_1);
7650 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._acquire_lock_for_switch_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
7651 __pyx_r = NULL;
7652 __pyx_L0:;
7653 __Pyx_XGIVEREF(__pyx_r);
7654 __Pyx_RefNannyFinishContext();
7655 return __pyx_r;
7656 }
7657
7658 /* "src/gevent/_abstract_linkable.py":465
7659 * return
7660 *
7661 * def _drop_lock_for_switch_out(self): # <<<<<<<<<<<<<<
7662 * return
7663 *
7664 */
7665
7666 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__drop_lock_for_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,int __pyx_skip_dispatch)7667 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__drop_lock_for_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
7668 PyObject *__pyx_r = NULL;
7669 __Pyx_RefNannyDeclarations
7670 PyObject *__pyx_t_1 = NULL;
7671 PyObject *__pyx_t_2 = NULL;
7672 PyObject *__pyx_t_3 = NULL;
7673 PyObject *__pyx_t_4 = NULL;
7674 int __pyx_t_5;
7675 int __pyx_lineno = 0;
7676 const char *__pyx_filename = NULL;
7677 int __pyx_clineno = 0;
7678 __Pyx_RefNannySetupContext("_drop_lock_for_switch_out", 0);
7679 /* Check if called by wrapper */
7680 if (unlikely(__pyx_skip_dispatch)) ;
7681 /* Check if overridden in Python */
7682 else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
7683 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7684 static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7685 if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
7686 PY_UINT64_T __pyx_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7687 #endif
7688 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_drop_lock_for_switch_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
7689 __Pyx_GOTREF(__pyx_t_1);
7690 #ifdef __Pyx_CyFunction_USED
7691 if (!__Pyx_IsCyOrPyCFunction(__pyx_t_1)
7692 #else
7693 if (!PyCFunction_Check(__pyx_t_1)
7694 #endif
7695 || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out)) {
7696 __Pyx_XDECREF(__pyx_r);
7697 __Pyx_INCREF(__pyx_t_1);
7698 __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
7699 __pyx_t_5 = 0;
7700 if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
7701 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
7702 if (likely(__pyx_t_4)) {
7703 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7704 __Pyx_INCREF(__pyx_t_4);
7705 __Pyx_INCREF(function);
7706 __Pyx_DECREF_SET(__pyx_t_3, function);
7707 __pyx_t_5 = 1;
7708 }
7709 }
7710 {
7711 PyObject *__pyx_callargs[1] = {__pyx_t_4, };
7712 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 0+__pyx_t_5);
7713 __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
7714 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
7715 __Pyx_GOTREF(__pyx_t_2);
7716 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7717 }
7718 __pyx_r = __pyx_t_2;
7719 __pyx_t_2 = 0;
7720 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7721 goto __pyx_L0;
7722 }
7723 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7724 __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
7725 __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
7726 if (unlikely(__pyx_typedict_guard != __pyx_tp_dict_version)) {
7727 __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
7728 }
7729 #endif
7730 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7731 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
7732 }
7733 #endif
7734 }
7735
7736 /* "src/gevent/_abstract_linkable.py":466
7737 *
7738 * def _drop_lock_for_switch_out(self):
7739 * return # <<<<<<<<<<<<<<
7740 *
7741 * def _wait_core(self, timeout, catch=Timeout):
7742 */
7743 __Pyx_XDECREF(__pyx_r);
7744 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7745 goto __pyx_L0;
7746
7747 /* "src/gevent/_abstract_linkable.py":465
7748 * return
7749 *
7750 * def _drop_lock_for_switch_out(self): # <<<<<<<<<<<<<<
7751 * return
7752 *
7753 */
7754
7755 /* function exit code */
7756 __pyx_L1_error:;
7757 __Pyx_XDECREF(__pyx_t_1);
7758 __Pyx_XDECREF(__pyx_t_2);
7759 __Pyx_XDECREF(__pyx_t_3);
7760 __Pyx_XDECREF(__pyx_t_4);
7761 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._drop_lock_for_switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
7762 __pyx_r = 0;
7763 __pyx_L0:;
7764 __Pyx_XGIVEREF(__pyx_r);
7765 __Pyx_RefNannyFinishContext();
7766 return __pyx_r;
7767 }
7768
7769 /* Python wrapper */
7770 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
7771 PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out, "AbstractLinkable._drop_lock_for_switch_out(self)");
7772 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out = {"_drop_lock_for_switch_out", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)7773 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
7774 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
7775 PyObject *__pyx_r = 0;
7776 __Pyx_RefNannyDeclarations
7777 __Pyx_RefNannySetupContext("_drop_lock_for_switch_out (wrapper)", 0);
7778 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));
7779
7780 /* function exit code */
7781 __Pyx_RefNannyFinishContext();
7782 return __pyx_r;
7783 }
7784
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)7785 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
7786 PyObject *__pyx_r = NULL;
7787 __Pyx_RefNannyDeclarations
7788 PyObject *__pyx_t_1 = NULL;
7789 int __pyx_lineno = 0;
7790 const char *__pyx_filename = NULL;
7791 int __pyx_clineno = 0;
7792 __Pyx_RefNannySetupContext("_drop_lock_for_switch_out", 0);
7793 __Pyx_XDECREF(__pyx_r);
7794 __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__drop_lock_for_switch_out(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
7795 __Pyx_GOTREF(__pyx_t_1);
7796 __pyx_r = __pyx_t_1;
7797 __pyx_t_1 = 0;
7798 goto __pyx_L0;
7799
7800 /* function exit code */
7801 __pyx_L1_error:;
7802 __Pyx_XDECREF(__pyx_t_1);
7803 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._drop_lock_for_switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
7804 __pyx_r = NULL;
7805 __pyx_L0:;
7806 __Pyx_XGIVEREF(__pyx_r);
7807 __Pyx_RefNannyFinishContext();
7808 return __pyx_r;
7809 }
7810
7811 /* "src/gevent/_abstract_linkable.py":468
7812 * return
7813 *
7814 * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<<
7815 * """
7816 * The core of the wait implementation, handling switching and
7817 */
7818
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,PyObject * __pyx_v_timeout,struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core * __pyx_optional_args)7819 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args) {
7820 PyObject *__pyx_v_catch = __pyx_k__3;
7821 PyObject *__pyx_v_timer = NULL;
7822 PyObject *__pyx_v_ex = NULL;
7823 PyObject *__pyx_r = NULL;
7824 __Pyx_RefNannyDeclarations
7825 PyObject *__pyx_t_1 = NULL;
7826 PyObject *__pyx_t_2 = NULL;
7827 PyObject *__pyx_t_3 = NULL;
7828 int __pyx_t_4;
7829 PyObject *__pyx_t_5 = NULL;
7830 PyObject *__pyx_t_6 = NULL;
7831 PyObject *__pyx_t_7 = NULL;
7832 PyObject *__pyx_t_8 = NULL;
7833 PyObject *__pyx_t_9 = NULL;
7834 PyObject *__pyx_t_10 = NULL;
7835 PyObject *__pyx_t_11 = NULL;
7836 PyObject *__pyx_t_12 = NULL;
7837 int __pyx_t_13;
7838 int __pyx_t_14;
7839 int __pyx_t_15;
7840 char const *__pyx_t_16;
7841 PyObject *__pyx_t_17 = NULL;
7842 PyObject *__pyx_t_18 = NULL;
7843 PyObject *__pyx_t_19 = NULL;
7844 PyObject *__pyx_t_20 = NULL;
7845 PyObject *__pyx_t_21 = NULL;
7846 PyObject *__pyx_t_22 = NULL;
7847 int __pyx_lineno = 0;
7848 const char *__pyx_filename = NULL;
7849 int __pyx_clineno = 0;
7850 __Pyx_RefNannySetupContext("_wait_core", 0);
7851 if (__pyx_optional_args) {
7852 if (__pyx_optional_args->__pyx_n > 0) {
7853 __pyx_v_catch = __pyx_optional_args->catch;
7854 }
7855 }
7856
7857 /* "src/gevent/_abstract_linkable.py":487
7858 * resumed in this greenlet.
7859 * """
7860 * with Timeout._start_new_or_dummy(timeout) as timer: # Might release # <<<<<<<<<<<<<<
7861 * # We already checked above (_wait()) if we're ready()
7862 * try:
7863 */
7864 /*with:*/ {
7865 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout, __pyx_n_s_start_new_or_dummy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L1_error)
7866 __Pyx_GOTREF(__pyx_t_2);
7867 __pyx_t_3 = NULL;
7868 __pyx_t_4 = 0;
7869 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
7870 __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
7871 if (likely(__pyx_t_3)) {
7872 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7873 __Pyx_INCREF(__pyx_t_3);
7874 __Pyx_INCREF(function);
7875 __Pyx_DECREF_SET(__pyx_t_2, function);
7876 __pyx_t_4 = 1;
7877 }
7878 }
7879 {
7880 PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_timeout};
7881 __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
7882 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7883 if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error)
7884 __Pyx_GOTREF(__pyx_t_1);
7885 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7886 }
7887 __pyx_t_5 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_exit); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 487, __pyx_L1_error)
7888 __Pyx_GOTREF(__pyx_t_5);
7889 __pyx_t_3 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_n_s_enter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 487, __pyx_L3_error)
7890 __Pyx_GOTREF(__pyx_t_3);
7891 __pyx_t_6 = NULL;
7892 __pyx_t_4 = 0;
7893 if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7894 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
7895 if (likely(__pyx_t_6)) {
7896 PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7897 __Pyx_INCREF(__pyx_t_6);
7898 __Pyx_INCREF(function);
7899 __Pyx_DECREF_SET(__pyx_t_3, function);
7900 __pyx_t_4 = 1;
7901 }
7902 }
7903 {
7904 PyObject *__pyx_callargs[1] = {__pyx_t_6, };
7905 __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
7906 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7907 if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 487, __pyx_L3_error)
7908 __Pyx_GOTREF(__pyx_t_2);
7909 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7910 }
7911 __pyx_t_3 = __pyx_t_2;
7912 __pyx_t_2 = 0;
7913 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7914 /*try:*/ {
7915 {
7916 __Pyx_PyThreadState_declare
7917 __Pyx_PyThreadState_assign
7918 __Pyx_ExceptionSave(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
7919 __Pyx_XGOTREF(__pyx_t_7);
7920 __Pyx_XGOTREF(__pyx_t_8);
7921 __Pyx_XGOTREF(__pyx_t_9);
7922 /*try:*/ {
7923 __pyx_v_timer = __pyx_t_3;
7924 __pyx_t_3 = 0;
7925
7926 /* "src/gevent/_abstract_linkable.py":489
7927 * with Timeout._start_new_or_dummy(timeout) as timer: # Might release
7928 * # We already checked above (_wait()) if we're ready()
7929 * try: # <<<<<<<<<<<<<<
7930 * self.__wait_to_be_notified(
7931 * True,# Use rawlink()
7932 */
7933 {
7934 __Pyx_PyThreadState_declare
7935 __Pyx_PyThreadState_assign
7936 __Pyx_ExceptionSave(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
7937 __Pyx_XGOTREF(__pyx_t_10);
7938 __Pyx_XGOTREF(__pyx_t_11);
7939 __Pyx_XGOTREF(__pyx_t_12);
7940 /*try:*/ {
7941
7942 /* "src/gevent/_abstract_linkable.py":490
7943 * # We already checked above (_wait()) if we're ready()
7944 * try:
7945 * self.__wait_to_be_notified( # <<<<<<<<<<<<<<
7946 * True,# Use rawlink()
7947 * )
7948 */
7949 __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_AbstractLinkable__wait_to_be_notified(__pyx_v_self, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 490, __pyx_L13_error)
7950 __Pyx_GOTREF(__pyx_t_3);
7951 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7952
7953 /* "src/gevent/_abstract_linkable.py":493
7954 * True,# Use rawlink()
7955 * )
7956 * return True # <<<<<<<<<<<<<<
7957 * except catch as ex:
7958 * if ex is not timer:
7959 */
7960 __Pyx_XDECREF(__pyx_r);
7961 __Pyx_INCREF(Py_True);
7962 __pyx_r = Py_True;
7963 goto __pyx_L17_try_return;
7964
7965 /* "src/gevent/_abstract_linkable.py":489
7966 * with Timeout._start_new_or_dummy(timeout) as timer: # Might release
7967 * # We already checked above (_wait()) if we're ready()
7968 * try: # <<<<<<<<<<<<<<
7969 * self.__wait_to_be_notified(
7970 * True,# Use rawlink()
7971 */
7972 }
7973 __pyx_L13_error:;
7974 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7975 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7976 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7977 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7978
7979 /* "src/gevent/_abstract_linkable.py":494
7980 * )
7981 * return True
7982 * except catch as ex: # <<<<<<<<<<<<<<
7983 * if ex is not timer:
7984 * raise
7985 */
7986 __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_v_catch);
7987 if (__pyx_t_4) {
7988 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
7989 if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 494, __pyx_L15_except_error)
7990 __Pyx_GOTREF(__pyx_t_3);
7991 __Pyx_GOTREF(__pyx_t_1);
7992 __Pyx_GOTREF(__pyx_t_2);
7993 __Pyx_INCREF(__pyx_t_1);
7994 __pyx_v_ex = __pyx_t_1;
7995 /*try:*/ {
7996
7997 /* "src/gevent/_abstract_linkable.py":495
7998 * return True
7999 * except catch as ex:
8000 * if ex is not timer: # <<<<<<<<<<<<<<
8001 * raise
8002 * # test_set_and_clear and test_timeout in test_threading
8003 */
8004 __pyx_t_13 = (__pyx_v_ex != __pyx_v_timer);
8005 __pyx_t_14 = (__pyx_t_13 != 0);
8006 if (unlikely(__pyx_t_14)) {
8007
8008 /* "src/gevent/_abstract_linkable.py":496
8009 * except catch as ex:
8010 * if ex is not timer:
8011 * raise # <<<<<<<<<<<<<<
8012 * # test_set_and_clear and test_timeout in test_threading
8013 * # rely on the exact return values, not just truthish-ness
8014 */
8015 __Pyx_GIVEREF(__pyx_t_3);
8016 __Pyx_GIVEREF(__pyx_t_1);
8017 __Pyx_XGIVEREF(__pyx_t_2);
8018 __Pyx_ErrRestoreWithState(__pyx_t_3, __pyx_t_1, __pyx_t_2);
8019 __pyx_t_3 = 0; __pyx_t_1 = 0; __pyx_t_2 = 0;
8020 __PYX_ERR(0, 496, __pyx_L24_error)
8021
8022 /* "src/gevent/_abstract_linkable.py":495
8023 * return True
8024 * except catch as ex:
8025 * if ex is not timer: # <<<<<<<<<<<<<<
8026 * raise
8027 * # test_set_and_clear and test_timeout in test_threading
8028 */
8029 }
8030
8031 /* "src/gevent/_abstract_linkable.py":499
8032 * # test_set_and_clear and test_timeout in test_threading
8033 * # rely on the exact return values, not just truthish-ness
8034 * return False # <<<<<<<<<<<<<<
8035 *
8036 * def _wait_return_value(self, waited, wait_success):
8037 */
8038 __Pyx_XDECREF(__pyx_r);
8039 __Pyx_INCREF(Py_False);
8040 __pyx_r = Py_False;
8041 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8042 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8043 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8044 goto __pyx_L23_return;
8045 }
8046
8047 /* "src/gevent/_abstract_linkable.py":494
8048 * )
8049 * return True
8050 * except catch as ex: # <<<<<<<<<<<<<<
8051 * if ex is not timer:
8052 * raise
8053 */
8054 /*finally:*/ {
8055 __pyx_L24_error:;
8056 /*exception exit:*/{
8057 __Pyx_PyThreadState_declare
8058 __Pyx_PyThreadState_assign
8059 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
8060 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8061 if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
8062 if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
8063 __Pyx_XGOTREF(__pyx_t_17);
8064 __Pyx_XGOTREF(__pyx_t_18);
8065 __Pyx_XGOTREF(__pyx_t_19);
8066 __Pyx_XGOTREF(__pyx_t_20);
8067 __Pyx_XGOTREF(__pyx_t_21);
8068 __Pyx_XGOTREF(__pyx_t_22);
8069 __pyx_t_4 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
8070 {
8071 __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
8072 }
8073 if (PY_MAJOR_VERSION >= 3) {
8074 __Pyx_XGIVEREF(__pyx_t_20);
8075 __Pyx_XGIVEREF(__pyx_t_21);
8076 __Pyx_XGIVEREF(__pyx_t_22);
8077 __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
8078 }
8079 __Pyx_XGIVEREF(__pyx_t_17);
8080 __Pyx_XGIVEREF(__pyx_t_18);
8081 __Pyx_XGIVEREF(__pyx_t_19);
8082 __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
8083 __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
8084 __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
8085 goto __pyx_L15_except_error;
8086 }
8087 __pyx_L23_return: {
8088 __pyx_t_22 = __pyx_r;
8089 __pyx_r = 0;
8090 __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
8091 __pyx_r = __pyx_t_22;
8092 __pyx_t_22 = 0;
8093 goto __pyx_L16_except_return;
8094 }
8095 }
8096 }
8097 goto __pyx_L15_except_error;
8098 __pyx_L15_except_error:;
8099
8100 /* "src/gevent/_abstract_linkable.py":489
8101 * with Timeout._start_new_or_dummy(timeout) as timer: # Might release
8102 * # We already checked above (_wait()) if we're ready()
8103 * try: # <<<<<<<<<<<<<<
8104 * self.__wait_to_be_notified(
8105 * True,# Use rawlink()
8106 */
8107 __Pyx_XGIVEREF(__pyx_t_10);
8108 __Pyx_XGIVEREF(__pyx_t_11);
8109 __Pyx_XGIVEREF(__pyx_t_12);
8110 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
8111 goto __pyx_L7_error;
8112 __pyx_L17_try_return:;
8113 __Pyx_XGIVEREF(__pyx_t_10);
8114 __Pyx_XGIVEREF(__pyx_t_11);
8115 __Pyx_XGIVEREF(__pyx_t_12);
8116 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
8117 goto __pyx_L11_try_return;
8118 __pyx_L16_except_return:;
8119 __Pyx_XGIVEREF(__pyx_t_10);
8120 __Pyx_XGIVEREF(__pyx_t_11);
8121 __Pyx_XGIVEREF(__pyx_t_12);
8122 __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
8123 goto __pyx_L11_try_return;
8124 }
8125
8126 /* "src/gevent/_abstract_linkable.py":487
8127 * resumed in this greenlet.
8128 * """
8129 * with Timeout._start_new_or_dummy(timeout) as timer: # Might release # <<<<<<<<<<<<<<
8130 * # We already checked above (_wait()) if we're ready()
8131 * try:
8132 */
8133 }
8134 __pyx_L7_error:;
8135 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8136 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8137 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8138 __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8139 /*except:*/ {
8140 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
8141 if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_3) < 0) __PYX_ERR(0, 487, __pyx_L9_except_error)
8142 __Pyx_GOTREF(__pyx_t_2);
8143 __Pyx_GOTREF(__pyx_t_1);
8144 __Pyx_GOTREF(__pyx_t_3);
8145 __pyx_t_6 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 487, __pyx_L9_except_error)
8146 __Pyx_GOTREF(__pyx_t_6);
8147 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL);
8148 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8149 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8150 if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 487, __pyx_L9_except_error)
8151 __Pyx_GOTREF(__pyx_t_12);
8152 __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_12);
8153 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
8154 if (__pyx_t_14 < 0) __PYX_ERR(0, 487, __pyx_L9_except_error)
8155 __pyx_t_13 = ((!(__pyx_t_14 != 0)) != 0);
8156 if (unlikely(__pyx_t_13)) {
8157 __Pyx_GIVEREF(__pyx_t_2);
8158 __Pyx_GIVEREF(__pyx_t_1);
8159 __Pyx_XGIVEREF(__pyx_t_3);
8160 __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_3);
8161 __pyx_t_2 = 0; __pyx_t_1 = 0; __pyx_t_3 = 0;
8162 __PYX_ERR(0, 487, __pyx_L9_except_error)
8163 }
8164 __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
8165 __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
8166 __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8167 goto __pyx_L8_exception_handled;
8168 }
8169 __pyx_L9_except_error:;
8170 __Pyx_XGIVEREF(__pyx_t_7);
8171 __Pyx_XGIVEREF(__pyx_t_8);
8172 __Pyx_XGIVEREF(__pyx_t_9);
8173 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
8174 goto __pyx_L1_error;
8175 __pyx_L11_try_return:;
8176 __Pyx_XGIVEREF(__pyx_t_7);
8177 __Pyx_XGIVEREF(__pyx_t_8);
8178 __Pyx_XGIVEREF(__pyx_t_9);
8179 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
8180 goto __pyx_L4_return;
8181 __pyx_L8_exception_handled:;
8182 __Pyx_XGIVEREF(__pyx_t_7);
8183 __Pyx_XGIVEREF(__pyx_t_8);
8184 __Pyx_XGIVEREF(__pyx_t_9);
8185 __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
8186 }
8187 }
8188 /*finally:*/ {
8189 /*normal exit:*/{
8190 if (__pyx_t_5) {
8191 __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL);
8192 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8193 if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 487, __pyx_L1_error)
8194 __Pyx_GOTREF(__pyx_t_9);
8195 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8196 }
8197 goto __pyx_L6;
8198 }
8199 __pyx_L4_return: {
8200 __pyx_t_9 = __pyx_r;
8201 __pyx_r = 0;
8202 if (__pyx_t_5) {
8203 __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_tuple__4, NULL);
8204 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8205 if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 487, __pyx_L1_error)
8206 __Pyx_GOTREF(__pyx_t_8);
8207 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8208 }
8209 __pyx_r = __pyx_t_9;
8210 __pyx_t_9 = 0;
8211 goto __pyx_L0;
8212 }
8213 __pyx_L6:;
8214 }
8215 goto __pyx_L34;
8216 __pyx_L3_error:;
8217 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8218 goto __pyx_L1_error;
8219 __pyx_L34:;
8220 }
8221
8222 /* "src/gevent/_abstract_linkable.py":468
8223 * return
8224 *
8225 * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<<
8226 * """
8227 * The core of the wait implementation, handling switching and
8228 */
8229
8230 /* function exit code */
8231 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8232 goto __pyx_L0;
8233 __pyx_L1_error:;
8234 __Pyx_XDECREF(__pyx_t_1);
8235 __Pyx_XDECREF(__pyx_t_2);
8236 __Pyx_XDECREF(__pyx_t_3);
8237 __Pyx_XDECREF(__pyx_t_6);
8238 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
8239 __pyx_r = 0;
8240 __pyx_L0:;
8241 __Pyx_XDECREF(__pyx_v_timer);
8242 __Pyx_XDECREF(__pyx_v_ex);
8243 __Pyx_XGIVEREF(__pyx_r);
8244 __Pyx_RefNannyFinishContext();
8245 return __pyx_r;
8246 }
8247
8248 /* "src/gevent/_abstract_linkable.py":501
8249 * return False
8250 *
8251 * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<<
8252 * # pylint:disable=unused-argument
8253 * # Subclasses should override this to return a value from _wait.
8254 */
8255
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,CYTHON_UNUSED int __pyx_v_waited,CYTHON_UNUSED int __pyx_v_wait_success)8256 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED int __pyx_v_waited, CYTHON_UNUSED int __pyx_v_wait_success) {
8257 PyObject *__pyx_r = NULL;
8258 __Pyx_RefNannyDeclarations
8259 __Pyx_RefNannySetupContext("_wait_return_value", 0);
8260
8261 /* "src/gevent/_abstract_linkable.py":505
8262 * # Subclasses should override this to return a value from _wait.
8263 * # By default we return None.
8264 * return None # pragma: no cover all extent subclasses override # <<<<<<<<<<<<<<
8265 *
8266 * def _wait(self, timeout=None):
8267 */
8268 __Pyx_XDECREF(__pyx_r);
8269 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8270 goto __pyx_L0;
8271
8272 /* "src/gevent/_abstract_linkable.py":501
8273 * return False
8274 *
8275 * def _wait_return_value(self, waited, wait_success): # <<<<<<<<<<<<<<
8276 * # pylint:disable=unused-argument
8277 * # Subclasses should override this to return a value from _wait.
8278 */
8279
8280 /* function exit code */
8281 __pyx_L0:;
8282 __Pyx_XGIVEREF(__pyx_r);
8283 __Pyx_RefNannyFinishContext();
8284 return __pyx_r;
8285 }
8286
8287 /* "src/gevent/_abstract_linkable.py":507
8288 * return None # pragma: no cover all extent subclasses override
8289 *
8290 * def _wait(self, timeout=None): # <<<<<<<<<<<<<<
8291 * # Watch where we could potentially release the GIL.
8292 * self._capture_hub(True) # Must create, we must have an owner. Might release
8293 */
8294
__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self,struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait * __pyx_optional_args)8295 static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args) {
8296 PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
8297 PyObject *__pyx_v_result = NULL;
8298 PyObject *__pyx_v_gotit = NULL;
8299 PyObject *__pyx_r = NULL;
8300 __Pyx_RefNannyDeclarations
8301 PyObject *__pyx_t_1 = NULL;
8302 int __pyx_t_2;
8303 int __pyx_lineno = 0;
8304 const char *__pyx_filename = NULL;
8305 int __pyx_clineno = 0;
8306 __Pyx_RefNannySetupContext("_wait", 0);
8307 if (__pyx_optional_args) {
8308 if (__pyx_optional_args->__pyx_n > 0) {
8309 __pyx_v_timeout = __pyx_optional_args->timeout;
8310 }
8311 }
8312
8313 /* "src/gevent/_abstract_linkable.py":509
8314 * def _wait(self, timeout=None):
8315 * # Watch where we could potentially release the GIL.
8316 * self._capture_hub(True) # Must create, we must have an owner. Might release # <<<<<<<<<<<<<<
8317 *
8318 * if self.ready(): # *might* release, if overridden in Python.
8319 */
8320 __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_capture_hub(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
8321 __Pyx_GOTREF(__pyx_t_1);
8322 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8323
8324 /* "src/gevent/_abstract_linkable.py":511
8325 * self._capture_hub(True) # Must create, we must have an owner. Might release
8326 *
8327 * if self.ready(): # *might* release, if overridden in Python. # <<<<<<<<<<<<<<
8328 * result = self._wait_return_value(False, False) # pylint:disable=assignment-from-none
8329 * if self._notifier:
8330 */
8331 __pyx_t_2 = (((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0) != 0);
8332 if (__pyx_t_2) {
8333
8334 /* "src/gevent/_abstract_linkable.py":512
8335 *
8336 * if self.ready(): # *might* release, if overridden in Python.
8337 * result = self._wait_return_value(False, False) # pylint:disable=assignment-from-none # <<<<<<<<<<<<<<
8338 * if self._notifier:
8339 * # We're already notifying waiters; one of them must have run
8340 */
8341 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
8342 __Pyx_GOTREF(__pyx_t_1);
8343 __pyx_v_result = __pyx_t_1;
8344 __pyx_t_1 = 0;
8345
8346 /* "src/gevent/_abstract_linkable.py":513
8347 * if self.ready(): # *might* release, if overridden in Python.
8348 * result = self._wait_return_value(False, False) # pylint:disable=assignment-from-none
8349 * if self._notifier: # <<<<<<<<<<<<<<
8350 * # We're already notifying waiters; one of them must have run
8351 * # and switched to this greenlet, which arrived here. Alternately,
8352 */
8353 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 513, __pyx_L1_error)
8354 if (__pyx_t_2) {
8355
8356 /* "src/gevent/_abstract_linkable.py":517
8357 * # and switched to this greenlet, which arrived here. Alternately,
8358 * # we could be in a separate thread (but we're holding the GIL/object lock)
8359 * self.__wait_to_be_notified(False) # Use self._notifier.args[0] instead of self.rawlink # <<<<<<<<<<<<<<
8360 *
8361 * return result
8362 */
8363 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_AbstractLinkable__wait_to_be_notified(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
8364 __Pyx_GOTREF(__pyx_t_1);
8365 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8366
8367 /* "src/gevent/_abstract_linkable.py":513
8368 * if self.ready(): # *might* release, if overridden in Python.
8369 * result = self._wait_return_value(False, False) # pylint:disable=assignment-from-none
8370 * if self._notifier: # <<<<<<<<<<<<<<
8371 * # We're already notifying waiters; one of them must have run
8372 * # and switched to this greenlet, which arrived here. Alternately,
8373 */
8374 }
8375
8376 /* "src/gevent/_abstract_linkable.py":519
8377 * self.__wait_to_be_notified(False) # Use self._notifier.args[0] instead of self.rawlink
8378 *
8379 * return result # <<<<<<<<<<<<<<
8380 *
8381 * gotit = self._wait_core(timeout)
8382 */
8383 __Pyx_XDECREF(__pyx_r);
8384 __Pyx_INCREF(__pyx_v_result);
8385 __pyx_r = __pyx_v_result;
8386 goto __pyx_L0;
8387
8388 /* "src/gevent/_abstract_linkable.py":511
8389 * self._capture_hub(True) # Must create, we must have an owner. Might release
8390 *
8391 * if self.ready(): # *might* release, if overridden in Python. # <<<<<<<<<<<<<<
8392 * result = self._wait_return_value(False, False) # pylint:disable=assignment-from-none
8393 * if self._notifier:
8394 */
8395 }
8396
8397 /* "src/gevent/_abstract_linkable.py":521
8398 * return result
8399 *
8400 * gotit = self._wait_core(timeout) # <<<<<<<<<<<<<<
8401 * return self._wait_return_value(True, gotit)
8402 *
8403 */
8404 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_core(__pyx_v_self, __pyx_v_timeout, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 521, __pyx_L1_error)
8405 __Pyx_GOTREF(__pyx_t_1);
8406 __pyx_v_gotit = __pyx_t_1;
8407 __pyx_t_1 = 0;
8408
8409 /* "src/gevent/_abstract_linkable.py":522
8410 *
8411 * gotit = self._wait_core(timeout)
8412 * return self._wait_return_value(True, gotit) # <<<<<<<<<<<<<<
8413 *
8414 * def _at_fork_reinit(self):
8415 */
8416 __Pyx_XDECREF(__pyx_r);
8417 __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gotit); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 522, __pyx_L1_error)
8418 __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, 1, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 522, __pyx_L1_error)
8419 __Pyx_GOTREF(__pyx_t_1);
8420 __pyx_r = __pyx_t_1;
8421 __pyx_t_1 = 0;
8422 goto __pyx_L0;
8423
8424 /* "src/gevent/_abstract_linkable.py":507
8425 * return None # pragma: no cover all extent subclasses override
8426 *
8427 * def _wait(self, timeout=None): # <<<<<<<<<<<<<<
8428 * # Watch where we could potentially release the GIL.
8429 * self._capture_hub(True) # Must create, we must have an owner. Might release
8430 */
8431
8432 /* function exit code */
8433 __pyx_L1_error:;
8434 __Pyx_XDECREF(__pyx_t_1);
8435 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
8436 __pyx_r = 0;
8437 __pyx_L0:;
8438 __Pyx_XDECREF(__pyx_v_result);
8439 __Pyx_XDECREF(__pyx_v_gotit);
8440 __Pyx_XGIVEREF(__pyx_r);
8441 __Pyx_RefNannyFinishContext();
8442 return __pyx_r;
8443 }
8444
8445 /* "src/gevent/_abstract_linkable.py":524
8446 * return self._wait_return_value(True, gotit)
8447 *
8448 * def _at_fork_reinit(self): # <<<<<<<<<<<<<<
8449 * """
8450 * This method was added in Python 3.9 and is called by logging.py
8451 */
8452
8453 /* Python wrapper */
8454 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8455 PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit, "AbstractLinkable._at_fork_reinit(self)\n\n This method was added in Python 3.9 and is called by logging.py\n ``_after_at_fork_child_reinit_locks`` on Lock objects.\n\n It is also called from threading.py, ``_after_fork`` in\n ``_reset_internal_locks``, and that can hit ``Event`` objects.\n\n Subclasses should reset themselves to an initial state. This\n includes unlocking/releasing, if possible. This method detaches from the\n previous hub and drops any existing notifier.\n ");
8456 static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit = {"_at_fork_reinit", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit};
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit(PyObject * __pyx_v_self,CYTHON_UNUSED PyObject * unused)8457 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8458 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8459 PyObject *__pyx_r = 0;
8460 __Pyx_RefNannyDeclarations
8461 __Pyx_RefNannySetupContext("_at_fork_reinit (wrapper)", 0);
8462 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));
8463
8464 /* function exit code */
8465 __Pyx_RefNannyFinishContext();
8466 return __pyx_r;
8467 }
8468
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)8469 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
8470 PyObject *__pyx_r = NULL;
8471 __Pyx_RefNannyDeclarations
8472 __Pyx_RefNannySetupContext("_at_fork_reinit", 0);
8473
8474 /* "src/gevent/_abstract_linkable.py":536
8475 * previous hub and drops any existing notifier.
8476 * """
8477 * self.hub = None # <<<<<<<<<<<<<<
8478 * self._notifier = None
8479 *
8480 */
8481 __Pyx_INCREF(Py_None);
8482 __Pyx_GIVEREF(Py_None);
8483 __Pyx_GOTREF((PyObject *)__pyx_v_self->hub);
8484 __Pyx_DECREF((PyObject *)__pyx_v_self->hub);
8485 __pyx_v_self->hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None);
8486
8487 /* "src/gevent/_abstract_linkable.py":537
8488 * """
8489 * self.hub = None
8490 * self._notifier = None # <<<<<<<<<<<<<<
8491 *
8492 * def _init():
8493 */
8494 __Pyx_INCREF(Py_None);
8495 __Pyx_GIVEREF(Py_None);
8496 __Pyx_GOTREF(__pyx_v_self->_notifier);
8497 __Pyx_DECREF(__pyx_v_self->_notifier);
8498 __pyx_v_self->_notifier = Py_None;
8499
8500 /* "src/gevent/_abstract_linkable.py":524
8501 * return self._wait_return_value(True, gotit)
8502 *
8503 * def _at_fork_reinit(self): # <<<<<<<<<<<<<<
8504 * """
8505 * This method was added in Python 3.9 and is called by logging.py
8506 */
8507
8508 /* function exit code */
8509 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8510 __Pyx_XGIVEREF(__pyx_r);
8511 __Pyx_RefNannyFinishContext();
8512 return __pyx_r;
8513 }
8514
8515 /* "gevent/_gevent_c_abstract_linkable.pxd":48
8516 * cdef object __weakref__
8517 *
8518 * cdef readonly SwitchOutGreenletWithLoop hub # <<<<<<<<<<<<<<
8519 *
8520 * cdef _notifier
8521 */
8522
8523 /* Python wrapper */
8524 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/
__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3hub_1__get__(PyObject * __pyx_v_self)8525 static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3hub_1__get__(PyObject *__pyx_v_self) {
8526 CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
8527 PyObject *__pyx_r = 0;
8528 __Pyx_RefNannyDeclarations
8529 __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8530 __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3hub___get__(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));
8531
8532 /* function exit code */
8533 __Pyx_RefNannyFinishContext();
8534 return __pyx_r;
8535 }
8536
__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3hub___get__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable * __pyx_v_self)8537 static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3hub___get__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
8538 PyObject *__pyx_r = NULL;
8539 __Pyx_RefNannyDeclarations
8540 __Pyx_RefNannySetupContext("__get__", 0);
8541 __Pyx_XDECREF(__pyx_r);
8542 __Pyx_INCREF((PyObject *)__pyx_v_self->hub);
8543 __pyx_r = ((PyObject *)__pyx_v_self->hub);
8544 goto __pyx_L0;
8545
8546 /* function exit code */
8547 __pyx_L0:;
8548 __Pyx_XGIVEREF(__pyx_r);
8549 __Pyx_RefNannyFinishContext();
8550 return __pyx_r;
8551 }
8552
8553 /* "src/gevent/_abstract_linkable.py":539
8554 * self._notifier = None
8555 *
8556 * def _init(): # <<<<<<<<<<<<<<
8557 * greenlet_init() # pylint:disable=undefined-variable
8558 *
8559 */
8560
__pyx_f_6gevent_27_gevent_c_abstract_linkable__init(void)8561 static void __pyx_f_6gevent_27_gevent_c_abstract_linkable__init(void) {
8562 __Pyx_RefNannyDeclarations
8563 __Pyx_RefNannySetupContext("_init", 0);
8564
8565 /* "src/gevent/_abstract_linkable.py":540
8566 *
8567 * def _init():
8568 * greenlet_init() # pylint:disable=undefined-variable # <<<<<<<<<<<<<<
8569 *
8570 * _init()
8571 */
8572 __pyx_f_6gevent_27_gevent_c_abstract_linkable_greenlet_init();
8573
8574 /* "src/gevent/_abstract_linkable.py":539
8575 * self._notifier = None
8576 *
8577 * def _init(): # <<<<<<<<<<<<<<
8578 * greenlet_init() # pylint:disable=undefined-variable
8579 *
8580 */
8581
8582 /* function exit code */
8583 __Pyx_RefNannyFinishContext();
8584 }
8585
8586 /* "gevent/_gevent_c_greenlet_primitives.pxd":23
8587 *
8588 * @cython.final
8589 * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<<
8590 * return PyGreenlet_GetCurrent()
8591 *
8592 */
8593
__pyx_f_6gevent_29_gevent_c_greenlet_primitives_getcurrent(void)8594 static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_29_gevent_c_greenlet_primitives_getcurrent(void) {
8595 PyGreenlet *__pyx_r = NULL;
8596 __Pyx_RefNannyDeclarations
8597 PyObject *__pyx_t_1 = NULL;
8598 int __pyx_lineno = 0;
8599 const char *__pyx_filename = NULL;
8600 int __pyx_clineno = 0;
8601 __Pyx_RefNannySetupContext("getcurrent", 0);
8602
8603 /* "gevent/_gevent_c_greenlet_primitives.pxd":24
8604 * @cython.final
8605 * cdef inline greenlet getcurrent():
8606 * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<<
8607 *
8608 * cdef bint _greenlet_imported
8609 */
8610 __Pyx_XDECREF((PyObject *)__pyx_r);
8611 __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error)
8612 __Pyx_GOTREF(__pyx_t_1);
8613 __pyx_r = ((PyGreenlet *)__pyx_t_1);
8614 __pyx_t_1 = 0;
8615 goto __pyx_L0;
8616
8617 /* "gevent/_gevent_c_greenlet_primitives.pxd":23
8618 *
8619 * @cython.final
8620 * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<<
8621 * return PyGreenlet_GetCurrent()
8622 *
8623 */
8624
8625 /* function exit code */
8626 __pyx_L1_error:;
8627 __Pyx_XDECREF(__pyx_t_1);
8628 __Pyx_AddTraceback("gevent._gevent_c_greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename);
8629 __pyx_r = 0;
8630 __pyx_L0:;
8631 __Pyx_XGIVEREF((PyObject *)__pyx_r);
8632 __Pyx_RefNannyFinishContext();
8633 return __pyx_r;
8634 }
8635
8636 /* "gevent/_gevent_c_greenlet_primitives.pxd":28
8637 * cdef bint _greenlet_imported
8638 *
8639 * cdef inline void greenlet_init(): # <<<<<<<<<<<<<<
8640 * global _greenlet_imported
8641 * if not _greenlet_imported:
8642 */
8643
__pyx_f_6gevent_29_gevent_c_greenlet_primitives_greenlet_init(void)8644 static CYTHON_INLINE void __pyx_f_6gevent_29_gevent_c_greenlet_primitives_greenlet_init(void) {
8645 __Pyx_RefNannyDeclarations
8646 int __pyx_t_1;
8647 __Pyx_RefNannySetupContext("greenlet_init", 0);
8648
8649 /* "gevent/_gevent_c_greenlet_primitives.pxd":30
8650 * cdef inline void greenlet_init():
8651 * global _greenlet_imported
8652 * if not _greenlet_imported: # <<<<<<<<<<<<<<
8653 * PyGreenlet_Import()
8654 * _greenlet_imported = True
8655 */
8656 __pyx_t_1 = ((!(__pyx_v_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported != 0)) != 0);
8657 if (__pyx_t_1) {
8658
8659 /* "gevent/_gevent_c_greenlet_primitives.pxd":31
8660 * global _greenlet_imported
8661 * if not _greenlet_imported:
8662 * PyGreenlet_Import() # <<<<<<<<<<<<<<
8663 * _greenlet_imported = True
8664 *
8665 */
8666 PyGreenlet_Import();
8667
8668 /* "gevent/_gevent_c_greenlet_primitives.pxd":32
8669 * if not _greenlet_imported:
8670 * PyGreenlet_Import()
8671 * _greenlet_imported = True # <<<<<<<<<<<<<<
8672 *
8673 * cdef inline object _greenlet_switch(greenlet self):
8674 */
8675 __pyx_v_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported = 1;
8676
8677 /* "gevent/_gevent_c_greenlet_primitives.pxd":30
8678 * cdef inline void greenlet_init():
8679 * global _greenlet_imported
8680 * if not _greenlet_imported: # <<<<<<<<<<<<<<
8681 * PyGreenlet_Import()
8682 * _greenlet_imported = True
8683 */
8684 }
8685
8686 /* "gevent/_gevent_c_greenlet_primitives.pxd":28
8687 * cdef bint _greenlet_imported
8688 *
8689 * cdef inline void greenlet_init(): # <<<<<<<<<<<<<<
8690 * global _greenlet_imported
8691 * if not _greenlet_imported:
8692 */
8693
8694 /* function exit code */
8695 __Pyx_RefNannyFinishContext();
8696 }
8697
8698 /* "gevent/_gevent_c_greenlet_primitives.pxd":34
8699 * _greenlet_imported = True
8700 *
8701 * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<<
8702 * return PyGreenlet_Switch(self, NULL, NULL)
8703 *
8704 */
8705
__pyx_f_6gevent_29_gevent_c_greenlet_primitives__greenlet_switch(PyGreenlet * __pyx_v_self)8706 static CYTHON_INLINE PyObject *__pyx_f_6gevent_29_gevent_c_greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) {
8707 PyObject *__pyx_r = NULL;
8708 __Pyx_RefNannyDeclarations
8709 PyObject *__pyx_t_1 = NULL;
8710 int __pyx_lineno = 0;
8711 const char *__pyx_filename = NULL;
8712 int __pyx_clineno = 0;
8713 __Pyx_RefNannySetupContext("_greenlet_switch", 0);
8714
8715 /* "gevent/_gevent_c_greenlet_primitives.pxd":35
8716 *
8717 * cdef inline object _greenlet_switch(greenlet self):
8718 * return PyGreenlet_Switch(self, NULL, NULL) # <<<<<<<<<<<<<<
8719 *
8720 * cdef class TrackedRawGreenlet(greenlet):
8721 */
8722 __Pyx_XDECREF(__pyx_r);
8723 __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error)
8724 __Pyx_GOTREF(__pyx_t_1);
8725 __pyx_r = __pyx_t_1;
8726 __pyx_t_1 = 0;
8727 goto __pyx_L0;
8728
8729 /* "gevent/_gevent_c_greenlet_primitives.pxd":34
8730 * _greenlet_imported = True
8731 *
8732 * cdef inline object _greenlet_switch(greenlet self): # <<<<<<<<<<<<<<
8733 * return PyGreenlet_Switch(self, NULL, NULL)
8734 *
8735 */
8736
8737 /* function exit code */
8738 __pyx_L1_error:;
8739 __Pyx_XDECREF(__pyx_t_1);
8740 __Pyx_AddTraceback("gevent._gevent_c_greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
8741 __pyx_r = 0;
8742 __pyx_L0:;
8743 __Pyx_XGIVEREF(__pyx_r);
8744 __Pyx_RefNannyFinishContext();
8745 return __pyx_r;
8746 }
8747
8748 /* "gevent/_gevent_c_abstract_linkable.pxd":25
8749 * void PyGreenlet_Import()
8750 *
8751 * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<<
8752 * return PyGreenlet_GetCurrent()
8753 *
8754 */
8755
__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent(void)8756 static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent(void) {
8757 PyGreenlet *__pyx_r = NULL;
8758 __Pyx_RefNannyDeclarations
8759 PyObject *__pyx_t_1 = NULL;
8760 int __pyx_lineno = 0;
8761 const char *__pyx_filename = NULL;
8762 int __pyx_clineno = 0;
8763 __Pyx_RefNannySetupContext("getcurrent", 0);
8764
8765 /* "gevent/_gevent_c_abstract_linkable.pxd":26
8766 *
8767 * cdef inline greenlet getcurrent():
8768 * return PyGreenlet_GetCurrent() # <<<<<<<<<<<<<<
8769 *
8770 * cdef inline void greenlet_init():
8771 */
8772 __Pyx_XDECREF((PyObject *)__pyx_r);
8773 __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error)
8774 __Pyx_GOTREF(__pyx_t_1);
8775 __pyx_r = ((PyGreenlet *)__pyx_t_1);
8776 __pyx_t_1 = 0;
8777 goto __pyx_L0;
8778
8779 /* "gevent/_gevent_c_abstract_linkable.pxd":25
8780 * void PyGreenlet_Import()
8781 *
8782 * cdef inline greenlet getcurrent(): # <<<<<<<<<<<<<<
8783 * return PyGreenlet_GetCurrent()
8784 *
8785 */
8786
8787 /* function exit code */
8788 __pyx_L1_error:;
8789 __Pyx_XDECREF(__pyx_t_1);
8790 __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename);
8791 __pyx_r = 0;
8792 __pyx_L0:;
8793 __Pyx_XGIVEREF((PyObject *)__pyx_r);
8794 __Pyx_RefNannyFinishContext();
8795 return __pyx_r;
8796 }
8797
8798 /* "gevent/_gevent_c_abstract_linkable.pxd":28
8799 * return PyGreenlet_GetCurrent()
8800 *
8801 * cdef inline void greenlet_init(): # <<<<<<<<<<<<<<
8802 * global _greenlet_imported
8803 * if not _greenlet_imported:
8804 */
8805
__pyx_f_6gevent_27_gevent_c_abstract_linkable_greenlet_init(void)8806 static CYTHON_INLINE void __pyx_f_6gevent_27_gevent_c_abstract_linkable_greenlet_init(void) {
8807 __Pyx_RefNannyDeclarations
8808 int __pyx_t_1;
8809 __Pyx_RefNannySetupContext("greenlet_init", 0);
8810
8811 /* "gevent/_gevent_c_abstract_linkable.pxd":30
8812 * cdef inline void greenlet_init():
8813 * global _greenlet_imported
8814 * if not _greenlet_imported: # <<<<<<<<<<<<<<
8815 * PyGreenlet_Import()
8816 * _greenlet_imported = True
8817 */
8818 __pyx_t_1 = ((!(__pyx_v_6gevent_27_gevent_c_abstract_linkable__greenlet_imported != 0)) != 0);
8819 if (__pyx_t_1) {
8820
8821 /* "gevent/_gevent_c_abstract_linkable.pxd":31
8822 * global _greenlet_imported
8823 * if not _greenlet_imported:
8824 * PyGreenlet_Import() # <<<<<<<<<<<<<<
8825 * _greenlet_imported = True
8826 *
8827 */
8828 PyGreenlet_Import();
8829
8830 /* "gevent/_gevent_c_abstract_linkable.pxd":32
8831 * if not _greenlet_imported:
8832 * PyGreenlet_Import()
8833 * _greenlet_imported = True # <<<<<<<<<<<<<<
8834 *
8835 * cdef void _init()
8836 */
8837 __pyx_v_6gevent_27_gevent_c_abstract_linkable__greenlet_imported = 1;
8838
8839 /* "gevent/_gevent_c_abstract_linkable.pxd":30
8840 * cdef inline void greenlet_init():
8841 * global _greenlet_imported
8842 * if not _greenlet_imported: # <<<<<<<<<<<<<<
8843 * PyGreenlet_Import()
8844 * _greenlet_imported = True
8845 */
8846 }
8847
8848 /* "gevent/_gevent_c_abstract_linkable.pxd":28
8849 * return PyGreenlet_GetCurrent()
8850 *
8851 * cdef inline void greenlet_init(): # <<<<<<<<<<<<<<
8852 * global _greenlet_imported
8853 * if not _greenlet_imported:
8854 */
8855
8856 /* function exit code */
8857 __Pyx_RefNannyFinishContext();
8858 }
8859
__pyx_tp_new_6gevent_27_gevent_c_abstract_linkable__FakeNotifier(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)8860 static PyObject *__pyx_tp_new_6gevent_27_gevent_c_abstract_linkable__FakeNotifier(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8861 PyObject *o;
8862 #if CYTHON_COMPILING_IN_LIMITED_API
8863 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
8864 o = alloc_func(t, 0);
8865 #else
8866 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
8867 o = (*t->tp_alloc)(t, 0);
8868 } else {
8869 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
8870 }
8871 if (unlikely(!o)) return 0;
8872 #endif
8873 return o;
8874 }
8875
__pyx_tp_dealloc_6gevent_27_gevent_c_abstract_linkable__FakeNotifier(PyObject * o)8876 static void __pyx_tp_dealloc_6gevent_27_gevent_c_abstract_linkable__FakeNotifier(PyObject *o) {
8877 #if CYTHON_USE_TP_FINALIZE
8878 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
8879 if (PyObject_CallFinalizerFromDealloc(o)) return;
8880 }
8881 #endif
8882 (*Py_TYPE(o)->tp_free)(o);
8883 }
8884
8885 static PyMethodDef __pyx_methods_6gevent_27_gevent_c_abstract_linkable__FakeNotifier[] = {
8886 {0, 0, 0, 0}
8887 };
8888 #if CYTHON_USE_TYPE_SPECS
8889 static PyType_Slot __pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier_slots[] = {
8890 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6gevent_27_gevent_c_abstract_linkable__FakeNotifier},
8891 {Py_tp_doc, (void *)PyDoc_STR("_FakeNotifier()")},
8892 {Py_tp_methods, (void *)__pyx_methods_6gevent_27_gevent_c_abstract_linkable__FakeNotifier},
8893 {Py_tp_init, (void *)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier_1__init__},
8894 {Py_tp_new, (void *)__pyx_tp_new_6gevent_27_gevent_c_abstract_linkable__FakeNotifier},
8895 {0, 0},
8896 };
8897 static PyType_Spec __pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier_spec = {
8898 "gevent._gevent_c_abstract_linkable._FakeNotifier",
8899 sizeof(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier),
8900 0,
8901 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
8902 __pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier_slots,
8903 };
8904 #else
8905
8906 static PyTypeObject __pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier = {
8907 PyVarObject_HEAD_INIT(0, 0)
8908 "gevent._gevent_c_abstract_linkable.""_FakeNotifier", /*tp_name*/
8909 sizeof(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier), /*tp_basicsize*/
8910 0, /*tp_itemsize*/
8911 __pyx_tp_dealloc_6gevent_27_gevent_c_abstract_linkable__FakeNotifier, /*tp_dealloc*/
8912 #if PY_VERSION_HEX < 0x030800b4
8913 0, /*tp_print*/
8914 #endif
8915 #if PY_VERSION_HEX >= 0x030800b4
8916 0, /*tp_vectorcall_offset*/
8917 #endif
8918 0, /*tp_getattr*/
8919 0, /*tp_setattr*/
8920 #if PY_MAJOR_VERSION < 3
8921 0, /*tp_compare*/
8922 #endif
8923 #if PY_MAJOR_VERSION >= 3
8924 0, /*tp_as_async*/
8925 #endif
8926 0, /*tp_repr*/
8927 0, /*tp_as_number*/
8928 0, /*tp_as_sequence*/
8929 0, /*tp_as_mapping*/
8930 0, /*tp_hash*/
8931 0, /*tp_call*/
8932 0, /*tp_str*/
8933 0, /*tp_getattro*/
8934 0, /*tp_setattro*/
8935 0, /*tp_as_buffer*/
8936 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
8937 PyDoc_STR("_FakeNotifier()"), /*tp_doc*/
8938 0, /*tp_traverse*/
8939 0, /*tp_clear*/
8940 0, /*tp_richcompare*/
8941 0, /*tp_weaklistoffset*/
8942 0, /*tp_iter*/
8943 0, /*tp_iternext*/
8944 __pyx_methods_6gevent_27_gevent_c_abstract_linkable__FakeNotifier, /*tp_methods*/
8945 0, /*tp_members*/
8946 0, /*tp_getset*/
8947 0, /*tp_base*/
8948 0, /*tp_dict*/
8949 0, /*tp_descr_get*/
8950 0, /*tp_descr_set*/
8951 #if !CYTHON_USE_TYPE_SPECS
8952 0, /*tp_dictoffset*/
8953 #endif
8954 __pyx_pw_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier_1__init__, /*tp_init*/
8955 0, /*tp_alloc*/
8956 __pyx_tp_new_6gevent_27_gevent_c_abstract_linkable__FakeNotifier, /*tp_new*/
8957 0, /*tp_free*/
8958 0, /*tp_is_gc*/
8959 0, /*tp_bases*/
8960 0, /*tp_mro*/
8961 0, /*tp_cache*/
8962 0, /*tp_subclasses*/
8963 0, /*tp_weaklist*/
8964 0, /*tp_del*/
8965 0, /*tp_version_tag*/
8966 #if PY_VERSION_HEX >= 0x030400a1
8967 0, /*tp_finalize*/
8968 #endif
8969 #if PY_VERSION_HEX >= 0x030800b1
8970 0, /*tp_vectorcall*/
8971 #endif
8972 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
8973 0, /*tp_print*/
8974 #endif
8975 #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
8976 0, /*tp_pypy_flags*/
8977 #endif
8978 };
8979 #endif
8980 static struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;
8981
__pyx_tp_new_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyTypeObject * t,CYTHON_UNUSED PyObject * a,CYTHON_UNUSED PyObject * k)8982 static PyObject *__pyx_tp_new_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
8983 struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *p;
8984 PyObject *o;
8985 #if CYTHON_COMPILING_IN_LIMITED_API
8986 allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
8987 o = alloc_func(t, 0);
8988 #else
8989 if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
8990 o = (*t->tp_alloc)(t, 0);
8991 } else {
8992 o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
8993 }
8994 if (unlikely(!o)) return 0;
8995 #endif
8996 p = ((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)o);
8997 p->__pyx_vtab = __pyx_vtabptr_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;
8998 p->hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None);
8999 p->_notifier = Py_None; Py_INCREF(Py_None);
9000 p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None);
9001 return o;
9002 }
9003
__pyx_tp_dealloc_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyObject * o)9004 static void __pyx_tp_dealloc_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyObject *o) {
9005 struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)o;
9006 #if CYTHON_USE_TP_FINALIZE
9007 if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
9008 if (PyObject_CallFinalizerFromDealloc(o)) return;
9009 }
9010 #endif
9011 PyObject_GC_UnTrack(o);
9012 if (p->__weakref__) PyObject_ClearWeakRefs(o);
9013 Py_CLEAR(p->hub);
9014 Py_CLEAR(p->_notifier);
9015 Py_CLEAR(p->_links);
9016 (*Py_TYPE(o)->tp_free)(o);
9017 }
9018
__pyx_tp_traverse_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyObject * o,visitproc v,void * a)9019 static int __pyx_tp_traverse_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyObject *o, visitproc v, void *a) {
9020 int e;
9021 struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)o;
9022 if (p->hub) {
9023 e = (*v)(((PyObject *)p->hub), a); if (e) return e;
9024 }
9025 if (p->_notifier) {
9026 e = (*v)(p->_notifier, a); if (e) return e;
9027 }
9028 if (p->_links) {
9029 e = (*v)(p->_links, a); if (e) return e;
9030 }
9031 return 0;
9032 }
9033
__pyx_tp_clear_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyObject * o)9034 static int __pyx_tp_clear_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable(PyObject *o) {
9035 PyObject* tmp;
9036 struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *p = (struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)o;
9037 tmp = ((PyObject*)p->hub);
9038 p->hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None);
9039 Py_XDECREF(tmp);
9040 tmp = ((PyObject*)p->_notifier);
9041 p->_notifier = Py_None; Py_INCREF(Py_None);
9042 Py_XDECREF(tmp);
9043 tmp = ((PyObject*)p->_links);
9044 p->_links = ((PyObject*)Py_None); Py_INCREF(Py_None);
9045 Py_XDECREF(tmp);
9046 return 0;
9047 }
9048
__pyx_getprop_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_hub(PyObject * o,CYTHON_UNUSED void * x)9049 static PyObject *__pyx_getprop_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_hub(PyObject *o, CYTHON_UNUSED void *x) {
9050 return __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3hub_1__get__(o);
9051 }
9052
9053 static PyMethodDef __pyx_methods_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable[] = {
9054 {"_at_fork_reinit", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit},
9055 {0, 0, 0, 0}
9056 };
9057
9058 static struct PyGetSetDef __pyx_getsets_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable[] = {
9059 {(char *)"hub", __pyx_getprop_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_hub, 0, (char *)0, 0},
9060 {0, 0, 0, 0, 0}
9061 };
9062 #if CYTHON_USE_TYPE_SPECS
9063 static PyType_Slot __pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable_slots[] = {
9064 {Py_tp_dealloc, (void *)__pyx_tp_dealloc_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable},
9065 {Py_tp_doc, (void *)PyDoc_STR("AbstractLinkable(hub=None)")},
9066 {Py_tp_traverse, (void *)__pyx_tp_traverse_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable},
9067 {Py_tp_clear, (void *)__pyx_tp_clear_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable},
9068 {Py_tp_methods, (void *)__pyx_methods_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable},
9069 {Py_tp_getset, (void *)__pyx_getsets_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable},
9070 {Py_tp_init, (void *)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_1__init__},
9071 {Py_tp_new, (void *)__pyx_tp_new_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable},
9072 {0, 0},
9073 };
9074 static PyType_Spec __pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable_spec = {
9075 "gevent._gevent_c_abstract_linkable.AbstractLinkable",
9076 sizeof(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable),
9077 0,
9078 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC,
9079 __pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable_slots,
9080 };
9081 #else
9082
9083 static PyTypeObject __pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable = {
9084 PyVarObject_HEAD_INIT(0, 0)
9085 "gevent._gevent_c_abstract_linkable.""AbstractLinkable", /*tp_name*/
9086 sizeof(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable), /*tp_basicsize*/
9087 0, /*tp_itemsize*/
9088 __pyx_tp_dealloc_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, /*tp_dealloc*/
9089 #if PY_VERSION_HEX < 0x030800b4
9090 0, /*tp_print*/
9091 #endif
9092 #if PY_VERSION_HEX >= 0x030800b4
9093 0, /*tp_vectorcall_offset*/
9094 #endif
9095 0, /*tp_getattr*/
9096 0, /*tp_setattr*/
9097 #if PY_MAJOR_VERSION < 3
9098 0, /*tp_compare*/
9099 #endif
9100 #if PY_MAJOR_VERSION >= 3
9101 0, /*tp_as_async*/
9102 #endif
9103 0, /*tp_repr*/
9104 0, /*tp_as_number*/
9105 0, /*tp_as_sequence*/
9106 0, /*tp_as_mapping*/
9107 0, /*tp_hash*/
9108 0, /*tp_call*/
9109 0, /*tp_str*/
9110 0, /*tp_getattro*/
9111 0, /*tp_setattro*/
9112 0, /*tp_as_buffer*/
9113 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
9114 PyDoc_STR("AbstractLinkable(hub=None)"), /*tp_doc*/
9115 __pyx_tp_traverse_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, /*tp_traverse*/
9116 __pyx_tp_clear_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, /*tp_clear*/
9117 0, /*tp_richcompare*/
9118 0, /*tp_weaklistoffset*/
9119 0, /*tp_iter*/
9120 0, /*tp_iternext*/
9121 __pyx_methods_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, /*tp_methods*/
9122 0, /*tp_members*/
9123 __pyx_getsets_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, /*tp_getset*/
9124 0, /*tp_base*/
9125 0, /*tp_dict*/
9126 0, /*tp_descr_get*/
9127 0, /*tp_descr_set*/
9128 #if !CYTHON_USE_TYPE_SPECS
9129 0, /*tp_dictoffset*/
9130 #endif
9131 __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_1__init__, /*tp_init*/
9132 0, /*tp_alloc*/
9133 __pyx_tp_new_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, /*tp_new*/
9134 0, /*tp_free*/
9135 0, /*tp_is_gc*/
9136 0, /*tp_bases*/
9137 0, /*tp_mro*/
9138 0, /*tp_cache*/
9139 0, /*tp_subclasses*/
9140 0, /*tp_weaklist*/
9141 0, /*tp_del*/
9142 0, /*tp_version_tag*/
9143 #if PY_VERSION_HEX >= 0x030400a1
9144 0, /*tp_finalize*/
9145 #endif
9146 #if PY_VERSION_HEX >= 0x030800b1
9147 0, /*tp_vectorcall*/
9148 #endif
9149 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
9150 0, /*tp_print*/
9151 #endif
9152 #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
9153 0, /*tp_pypy_flags*/
9154 #endif
9155 };
9156 #endif
9157
9158 static PyMethodDef __pyx_methods[] = {
9159 {0, 0, 0, 0}
9160 };
9161 #ifndef CYTHON_SMALL_CODE
9162 #if defined(__clang__)
9163 #define CYTHON_SMALL_CODE
9164 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
9165 #define CYTHON_SMALL_CODE __attribute__((cold))
9166 #else
9167 #define CYTHON_SMALL_CODE
9168 #endif
9169 #endif
9170 /* #### Code section: pystring_table ### */
9171
9172 static __Pyx_StringTabEntry __pyx_string_tab[] = {
9173 #if CYTHON_USE_MODULE_STATE
9174 {0, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1},
9175 {0, __pyx_k_AbstractLinkable, sizeof(__pyx_k_AbstractLinkable), 0, 0, 1, 1},
9176 {0, __pyx_k_AbstractLinkable__acquire_lock_f, sizeof(__pyx_k_AbstractLinkable__acquire_lock_f), 0, 0, 1, 1},
9177 {0, __pyx_k_AbstractLinkable__at_fork_reinit, sizeof(__pyx_k_AbstractLinkable__at_fork_reinit), 0, 0, 1, 1},
9178 {0, __pyx_k_AbstractLinkable__drop_lock_for, sizeof(__pyx_k_AbstractLinkable__drop_lock_for), 0, 0, 1, 1},
9179 {0, __pyx_k_AbstractLinkable__notify_links, sizeof(__pyx_k_AbstractLinkable__notify_links), 0, 0, 1, 1},
9180 {0, __pyx_k_AbstractLinkable_linkcount, sizeof(__pyx_k_AbstractLinkable_linkcount), 0, 0, 1, 1},
9181 {0, __pyx_k_AbstractLinkable_rawlink, sizeof(__pyx_k_AbstractLinkable_rawlink), 0, 0, 1, 1},
9182 {0, __pyx_k_AbstractLinkable_ready, sizeof(__pyx_k_AbstractLinkable_ready), 0, 0, 1, 1},
9183 {0, __pyx_k_AbstractLinkable_unlink, sizeof(__pyx_k_AbstractLinkable_unlink), 0, 0, 1, 1},
9184 {0, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
9185 {0, __pyx_k_Expected_callable_r, sizeof(__pyx_k_Expected_callable_r), 0, 0, 1, 0},
9186 {0, __pyx_k_FakeNotifier, sizeof(__pyx_k_FakeNotifier), 0, 0, 1, 1},
9187 {0, __pyx_k_Hub, sizeof(__pyx_k_Hub), 0, 0, 1, 1},
9188 {0, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1},
9189 {0, __pyx_k_InvalidThreadUseError, sizeof(__pyx_k_InvalidThreadUseError), 0, 0, 1, 1},
9190 {0, __pyx_k_Invalid_switch_into_s_wait_r, sizeof(__pyx_k_Invalid_switch_into_s_wait_r), 0, 0, 1, 0},
9191 {0, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
9192 {0, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1},
9193 {0, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
9194 {0, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
9195 {0, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1},
9196 {0, __pyx_k_acquire_lock_for_switch_in, sizeof(__pyx_k_acquire_lock_for_switch_in), 0, 0, 1, 1},
9197 {0, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
9198 {0, __pyx_k_allocate_lock, sizeof(__pyx_k_allocate_lock), 0, 0, 1, 1},
9199 {0, __pyx_k_allocate_thread_lock, sizeof(__pyx_k_allocate_thread_lock), 0, 0, 1, 1},
9200 {0, __pyx_k_and_is_a_bug_in_the_calling_code, sizeof(__pyx_k_and_is_a_bug_in_the_calling_code), 0, 0, 1, 0},
9201 {0, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
9202 {0, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
9203 {0, __pyx_k_arrived_while_waiting, sizeof(__pyx_k_arrived_while_waiting), 0, 0, 1, 1},
9204 {0, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
9205 {0, __pyx_k_at_fork_reinit, sizeof(__pyx_k_at_fork_reinit), 0, 0, 1, 1},
9206 {0, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1},
9207 {0, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
9208 {0, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
9209 {0, __pyx_k_crossing_thread_boundaries_is_n, sizeof(__pyx_k_crossing_thread_boundaries_is_n), 0, 0, 1, 0},
9210 {0, __pyx_k_dead, sizeof(__pyx_k_dead), 0, 0, 1, 1},
9211 {0, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
9212 {0, __pyx_k_drop_lock_for_switch_out, sizeof(__pyx_k_drop_lock_for_switch_out), 0, 0, 1, 1},
9213 {0, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
9214 {0, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
9215 {0, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
9216 {0, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
9217 {0, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
9218 {0, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
9219 {0, __pyx_k_from, sizeof(__pyx_k_from), 0, 0, 1, 1},
9220 {0, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1},
9221 {0, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
9222 {0, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
9223 {0, __pyx_k_get_hub_if_exists, sizeof(__pyx_k_get_hub_if_exists), 0, 0, 1, 1},
9224 {0, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1},
9225 {0, __pyx_k_get_ident, sizeof(__pyx_k_get_ident), 0, 0, 1, 1},
9226 {0, __pyx_k_get_objects, sizeof(__pyx_k_get_objects), 0, 0, 1, 1},
9227 {0, __pyx_k_get_thread_ident, sizeof(__pyx_k_get_thread_ident), 0, 0, 1, 1},
9228 {0, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1},
9229 {0, __pyx_k_gevent___abstract_linkable, sizeof(__pyx_k_gevent___abstract_linkable), 0, 0, 1, 0},
9230 {0, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1},
9231 {0, __pyx_k_gevent__gevent_c_abstract_linkab, sizeof(__pyx_k_gevent__gevent_c_abstract_linkab), 0, 0, 1, 1},
9232 {0, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1},
9233 {0, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1},
9234 {0, __pyx_k_gevent_error_This_is_a_result_of, sizeof(__pyx_k_gevent_error_This_is_a_result_of), 0, 0, 1, 0},
9235 {0, __pyx_k_gevent_error_Unable_to_switch_to, sizeof(__pyx_k_gevent_error_Unable_to_switch_to), 0, 0, 1, 0},
9236 {0, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1},
9237 {0, __pyx_k_gevent_hub, sizeof(__pyx_k_gevent_hub), 0, 0, 1, 1},
9238 {0, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1},
9239 {0, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1},
9240 {0, __pyx_k_greenlet_error, sizeof(__pyx_k_greenlet_error), 0, 0, 1, 1},
9241 {0, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1},
9242 {0, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1},
9243 {0, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1},
9244 {0, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1},
9245 {0, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
9246 {0, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
9247 {0, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1},
9248 {0, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
9249 {0, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
9250 {0, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
9251 {0, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
9252 {0, __pyx_k_linkcount, sizeof(__pyx_k_linkcount), 0, 0, 1, 1},
9253 {0, __pyx_k_links, sizeof(__pyx_k_links), 0, 0, 1, 1},
9254 {0, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1},
9255 {0, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
9256 {0, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
9257 {0, __pyx_k_notifier, sizeof(__pyx_k_notifier), 0, 0, 1, 1},
9258 {0, __pyx_k_notify_all, sizeof(__pyx_k_notify_all), 0, 0, 1, 1},
9259 {0, __pyx_k_notify_links, sizeof(__pyx_k_notify_links), 0, 0, 1, 1},
9260 {0, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
9261 {0, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1},
9262 {0, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
9263 {0, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
9264 {0, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1},
9265 {0, __pyx_k_print_stack, sizeof(__pyx_k_print_stack), 0, 0, 1, 1},
9266 {0, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1},
9267 {0, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
9268 {0, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1},
9269 {0, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1},
9270 {0, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
9271 {0, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1},
9272 {0, __pyx_k_run_callback_threadsafe, sizeof(__pyx_k_run_callback_threadsafe), 0, 0, 1, 1},
9273 {0, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
9274 {0, __pyx_k_self_2, sizeof(__pyx_k_self_2), 0, 0, 1, 1},
9275 {0, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1},
9276 {0, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
9277 {0, __pyx_k_src_gevent__abstract_linkable_py, sizeof(__pyx_k_src_gevent__abstract_linkable_py), 0, 0, 1, 0},
9278 {0, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1},
9279 {0, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
9280 {0, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
9281 {0, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1},
9282 {0, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
9283 {0, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
9284 {0, __pyx_k_thread_ident, sizeof(__pyx_k_thread_ident), 0, 0, 1, 1},
9285 {0, __pyx_k_thread_mod_name, sizeof(__pyx_k_thread_mod_name), 0, 0, 1, 1},
9286 {0, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
9287 {0, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1},
9288 {0, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
9289 #else
9290 {&__pyx_n_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 1},
9291 {&__pyx_n_s_AbstractLinkable, __pyx_k_AbstractLinkable, sizeof(__pyx_k_AbstractLinkable), 0, 0, 1, 1},
9292 {&__pyx_n_s_AbstractLinkable__acquire_lock_f, __pyx_k_AbstractLinkable__acquire_lock_f, sizeof(__pyx_k_AbstractLinkable__acquire_lock_f), 0, 0, 1, 1},
9293 {&__pyx_n_s_AbstractLinkable__at_fork_reinit, __pyx_k_AbstractLinkable__at_fork_reinit, sizeof(__pyx_k_AbstractLinkable__at_fork_reinit), 0, 0, 1, 1},
9294 {&__pyx_n_s_AbstractLinkable__drop_lock_for, __pyx_k_AbstractLinkable__drop_lock_for, sizeof(__pyx_k_AbstractLinkable__drop_lock_for), 0, 0, 1, 1},
9295 {&__pyx_n_s_AbstractLinkable__notify_links, __pyx_k_AbstractLinkable__notify_links, sizeof(__pyx_k_AbstractLinkable__notify_links), 0, 0, 1, 1},
9296 {&__pyx_n_s_AbstractLinkable_linkcount, __pyx_k_AbstractLinkable_linkcount, sizeof(__pyx_k_AbstractLinkable_linkcount), 0, 0, 1, 1},
9297 {&__pyx_n_s_AbstractLinkable_rawlink, __pyx_k_AbstractLinkable_rawlink, sizeof(__pyx_k_AbstractLinkable_rawlink), 0, 0, 1, 1},
9298 {&__pyx_n_s_AbstractLinkable_ready, __pyx_k_AbstractLinkable_ready, sizeof(__pyx_k_AbstractLinkable_ready), 0, 0, 1, 1},
9299 {&__pyx_n_s_AbstractLinkable_unlink, __pyx_k_AbstractLinkable_unlink, sizeof(__pyx_k_AbstractLinkable_unlink), 0, 0, 1, 1},
9300 {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
9301 {&__pyx_kp_s_Expected_callable_r, __pyx_k_Expected_callable_r, sizeof(__pyx_k_Expected_callable_r), 0, 0, 1, 0},
9302 {&__pyx_n_s_FakeNotifier, __pyx_k_FakeNotifier, sizeof(__pyx_k_FakeNotifier), 0, 0, 1, 1},
9303 {&__pyx_n_s_Hub, __pyx_k_Hub, sizeof(__pyx_k_Hub), 0, 0, 1, 1},
9304 {&__pyx_n_s_InvalidSwitchError, __pyx_k_InvalidSwitchError, sizeof(__pyx_k_InvalidSwitchError), 0, 0, 1, 1},
9305 {&__pyx_n_s_InvalidThreadUseError, __pyx_k_InvalidThreadUseError, sizeof(__pyx_k_InvalidThreadUseError), 0, 0, 1, 1},
9306 {&__pyx_kp_s_Invalid_switch_into_s_wait_r, __pyx_k_Invalid_switch_into_s_wait_r, sizeof(__pyx_k_Invalid_switch_into_s_wait_r), 0, 0, 1, 0},
9307 {&__pyx_n_s_NotImplementedError, __pyx_k_NotImplementedError, sizeof(__pyx_k_NotImplementedError), 0, 0, 1, 1},
9308 {&__pyx_n_s_Timeout, __pyx_k_Timeout, sizeof(__pyx_k_Timeout), 0, 0, 1, 1},
9309 {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
9310 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
9311 {&__pyx_n_s__24, __pyx_k__24, sizeof(__pyx_k__24), 0, 0, 1, 1},
9312 {&__pyx_n_s_acquire_lock_for_switch_in, __pyx_k_acquire_lock_for_switch_in, sizeof(__pyx_k_acquire_lock_for_switch_in), 0, 0, 1, 1},
9313 {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
9314 {&__pyx_n_s_allocate_lock, __pyx_k_allocate_lock, sizeof(__pyx_k_allocate_lock), 0, 0, 1, 1},
9315 {&__pyx_n_s_allocate_thread_lock, __pyx_k_allocate_thread_lock, sizeof(__pyx_k_allocate_thread_lock), 0, 0, 1, 1},
9316 {&__pyx_kp_s_and_is_a_bug_in_the_calling_code, __pyx_k_and_is_a_bug_in_the_calling_code, sizeof(__pyx_k_and_is_a_bug_in_the_calling_code), 0, 0, 1, 0},
9317 {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
9318 {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
9319 {&__pyx_n_s_arrived_while_waiting, __pyx_k_arrived_while_waiting, sizeof(__pyx_k_arrived_while_waiting), 0, 0, 1, 1},
9320 {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
9321 {&__pyx_n_s_at_fork_reinit, __pyx_k_at_fork_reinit, sizeof(__pyx_k_at_fork_reinit), 0, 0, 1, 1},
9322 {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1},
9323 {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
9324 {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
9325 {&__pyx_kp_s_crossing_thread_boundaries_is_n, __pyx_k_crossing_thread_boundaries_is_n, sizeof(__pyx_k_crossing_thread_boundaries_is_n), 0, 0, 1, 0},
9326 {&__pyx_n_s_dead, __pyx_k_dead, sizeof(__pyx_k_dead), 0, 0, 1, 1},
9327 {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
9328 {&__pyx_n_s_drop_lock_for_switch_out, __pyx_k_drop_lock_for_switch_out, sizeof(__pyx_k_drop_lock_for_switch_out), 0, 0, 1, 1},
9329 {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
9330 {&__pyx_n_s_enter, __pyx_k_enter, sizeof(__pyx_k_enter), 0, 0, 1, 1},
9331 {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
9332 {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
9333 {&__pyx_n_s_exit, __pyx_k_exit, sizeof(__pyx_k_exit), 0, 0, 1, 1},
9334 {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
9335 {&__pyx_n_s_from, __pyx_k_from, sizeof(__pyx_k_from), 0, 0, 1, 1},
9336 {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1},
9337 {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
9338 {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
9339 {&__pyx_n_s_get_hub_if_exists, __pyx_k_get_hub_if_exists, sizeof(__pyx_k_get_hub_if_exists), 0, 0, 1, 1},
9340 {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1},
9341 {&__pyx_n_s_get_ident, __pyx_k_get_ident, sizeof(__pyx_k_get_ident), 0, 0, 1, 1},
9342 {&__pyx_n_s_get_objects, __pyx_k_get_objects, sizeof(__pyx_k_get_objects), 0, 0, 1, 1},
9343 {&__pyx_n_s_get_thread_ident, __pyx_k_get_thread_ident, sizeof(__pyx_k_get_thread_ident), 0, 0, 1, 1},
9344 {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1},
9345 {&__pyx_kp_s_gevent___abstract_linkable, __pyx_k_gevent___abstract_linkable, sizeof(__pyx_k_gevent___abstract_linkable), 0, 0, 1, 0},
9346 {&__pyx_n_s_gevent__compat, __pyx_k_gevent__compat, sizeof(__pyx_k_gevent__compat), 0, 0, 1, 1},
9347 {&__pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_k_gevent__gevent_c_abstract_linkab, sizeof(__pyx_k_gevent__gevent_c_abstract_linkab), 0, 0, 1, 1},
9348 {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1},
9349 {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1},
9350 {&__pyx_kp_s_gevent_error_This_is_a_result_of, __pyx_k_gevent_error_This_is_a_result_of, sizeof(__pyx_k_gevent_error_This_is_a_result_of), 0, 0, 1, 0},
9351 {&__pyx_kp_s_gevent_error_Unable_to_switch_to, __pyx_k_gevent_error_Unable_to_switch_to, sizeof(__pyx_k_gevent_error_Unable_to_switch_to), 0, 0, 1, 0},
9352 {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1},
9353 {&__pyx_n_s_gevent_hub, __pyx_k_gevent_hub, sizeof(__pyx_k_gevent_hub), 0, 0, 1, 1},
9354 {&__pyx_n_s_gevent_timeout, __pyx_k_gevent_timeout, sizeof(__pyx_k_gevent_timeout), 0, 0, 1, 1},
9355 {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1},
9356 {&__pyx_n_s_greenlet_error, __pyx_k_greenlet_error, sizeof(__pyx_k_greenlet_error), 0, 0, 1, 1},
9357 {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1},
9358 {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1},
9359 {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1},
9360 {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1},
9361 {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
9362 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
9363 {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1},
9364 {&__pyx_n_s_initializing, __pyx_k_initializing, sizeof(__pyx_k_initializing), 0, 0, 1, 1},
9365 {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
9366 {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
9367 {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
9368 {&__pyx_n_s_linkcount, __pyx_k_linkcount, sizeof(__pyx_k_linkcount), 0, 0, 1, 1},
9369 {&__pyx_n_s_links, __pyx_k_links, sizeof(__pyx_k_links), 0, 0, 1, 1},
9370 {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1},
9371 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
9372 {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
9373 {&__pyx_n_s_notifier, __pyx_k_notifier, sizeof(__pyx_k_notifier), 0, 0, 1, 1},
9374 {&__pyx_n_s_notify_all, __pyx_k_notify_all, sizeof(__pyx_k_notify_all), 0, 0, 1, 1},
9375 {&__pyx_n_s_notify_links, __pyx_k_notify_links, sizeof(__pyx_k_notify_links), 0, 0, 1, 1},
9376 {&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
9377 {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1},
9378 {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
9379 {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
9380 {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1},
9381 {&__pyx_n_s_print_stack, __pyx_k_print_stack, sizeof(__pyx_k_print_stack), 0, 0, 1, 1},
9382 {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1},
9383 {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
9384 {&__pyx_n_s_rawlink, __pyx_k_rawlink, sizeof(__pyx_k_rawlink), 0, 0, 1, 1},
9385 {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1},
9386 {&__pyx_n_s_remove, __pyx_k_remove, sizeof(__pyx_k_remove), 0, 0, 1, 1},
9387 {&__pyx_n_s_run_callback, __pyx_k_run_callback, sizeof(__pyx_k_run_callback), 0, 0, 1, 1},
9388 {&__pyx_n_s_run_callback_threadsafe, __pyx_k_run_callback_threadsafe, sizeof(__pyx_k_run_callback_threadsafe), 0, 0, 1, 1},
9389 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
9390 {&__pyx_n_s_self_2, __pyx_k_self_2, sizeof(__pyx_k_self_2), 0, 0, 1, 1},
9391 {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1},
9392 {&__pyx_n_s_spec, __pyx_k_spec, sizeof(__pyx_k_spec), 0, 0, 1, 1},
9393 {&__pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_k_src_gevent__abstract_linkable_py, sizeof(__pyx_k_src_gevent__abstract_linkable_py), 0, 0, 1, 0},
9394 {&__pyx_n_s_start_new_or_dummy, __pyx_k_start_new_or_dummy, sizeof(__pyx_k_start_new_or_dummy), 0, 0, 1, 1},
9395 {&__pyx_n_s_stderr, __pyx_k_stderr, sizeof(__pyx_k_stderr), 0, 0, 1, 1},
9396 {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
9397 {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1},
9398 {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
9399 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
9400 {&__pyx_n_s_thread_ident, __pyx_k_thread_ident, sizeof(__pyx_k_thread_ident), 0, 0, 1, 1},
9401 {&__pyx_n_s_thread_mod_name, __pyx_k_thread_mod_name, sizeof(__pyx_k_thread_mod_name), 0, 0, 1, 1},
9402 {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
9403 {&__pyx_n_s_unlink, __pyx_k_unlink, sizeof(__pyx_k_unlink), 0, 0, 1, 1},
9404 {&__pyx_n_s_weakref, __pyx_k_weakref, sizeof(__pyx_k_weakref), 0, 0, 1, 1},
9405 #endif
9406 {0, 0, 0, 0, 0, 0, 0}
9407 };
9408 /* #### Code section: cached_builtins ### */
__Pyx_InitCachedBuiltins(void)9409 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
9410 __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 25, __pyx_L1_error)
9411 __pyx_builtin_NotImplementedError = __Pyx_GetBuiltinName(__pyx_n_s_NotImplementedError); if (!__pyx_builtin_NotImplementedError) __PYX_ERR(0, 135, __pyx_L1_error)
9412 __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 146, __pyx_L1_error)
9413 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 154, __pyx_L1_error)
9414 __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 257, __pyx_L1_error)
9415 __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 333, __pyx_L1_error)
9416 __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 409, __pyx_L1_error)
9417 return 0;
9418 __pyx_L1_error:;
9419 return -1;
9420 }
9421 /* #### Code section: cached_constants ### */
9422
__Pyx_InitCachedConstants(void)9423 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
9424 __Pyx_RefNannyDeclarations
9425 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
9426
9427 /* "src/gevent/_abstract_linkable.py":415
9428 * if not printed_tb:
9429 * printed_tb = True
9430 * print( # <<<<<<<<<<<<<<
9431 * 'gevent: error: '
9432 * 'This is a result of using gevent objects from multiple threads,',
9433 */
9434 __pyx_tuple__2 = PyTuple_Pack(2, __pyx_kp_s_gevent_error_This_is_a_result_of, __pyx_kp_s_and_is_a_bug_in_the_calling_code); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 415, __pyx_L1_error)
9435 __Pyx_GOTREF(__pyx_tuple__2);
9436 __Pyx_GIVEREF(__pyx_tuple__2);
9437
9438 /* "src/gevent/_abstract_linkable.py":487
9439 * resumed in this greenlet.
9440 * """
9441 * with Timeout._start_new_or_dummy(timeout) as timer: # Might release # <<<<<<<<<<<<<<
9442 * # We already checked above (_wait()) if we're ready()
9443 * try:
9444 */
9445 __pyx_tuple__4 = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 487, __pyx_L1_error)
9446 __Pyx_GOTREF(__pyx_tuple__4);
9447 __Pyx_GIVEREF(__pyx_tuple__4);
9448
9449 /* "src/gevent/_abstract_linkable.py":25
9450 * from gevent.timeout import Timeout
9451 *
9452 * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<<
9453 * locals()['greenlet_init'] = lambda: None
9454 *
9455 */
9456 __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 25, __pyx_L1_error)
9457 __Pyx_GOTREF(__pyx_tuple__5);
9458 __Pyx_GIVEREF(__pyx_tuple__5);
9459
9460 /* "src/gevent/_abstract_linkable.py":39
9461 * class _FakeNotifier(object):
9462 * __slots__ = (
9463 * 'pending', # <<<<<<<<<<<<<<
9464 * )
9465 *
9466 */
9467 __pyx_tuple__6 = PyTuple_Pack(1, __pyx_n_s_pending); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 39, __pyx_L1_error)
9468 __Pyx_GOTREF(__pyx_tuple__6);
9469 __Pyx_GIVEREF(__pyx_tuple__6);
9470
9471 /* "src/gevent/_abstract_linkable.py":81
9472 *
9473 * __slots__ = (
9474 * 'hub', # <<<<<<<<<<<<<<
9475 * '_links',
9476 * '_notifier',
9477 */
9478 __pyx_tuple__7 = PyTuple_Pack(5, __pyx_n_s_hub, __pyx_n_s_links, __pyx_n_s_notifier, __pyx_n_s_notify_all, __pyx_n_s_weakref); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 81, __pyx_L1_error)
9479 __Pyx_GOTREF(__pyx_tuple__7);
9480 __Pyx_GIVEREF(__pyx_tuple__7);
9481
9482 /* "src/gevent/_abstract_linkable.py":129
9483 * self.hub = hub
9484 *
9485 * def linkcount(self): # <<<<<<<<<<<<<<
9486 * # For testing: how many objects are linked to this one?
9487 * return len(self._links)
9488 */
9489 __pyx_tuple__8 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 129, __pyx_L1_error)
9490 __Pyx_GOTREF(__pyx_tuple__8);
9491 __Pyx_GIVEREF(__pyx_tuple__8);
9492 __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_linkcount, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 129, __pyx_L1_error)
9493
9494 /* "src/gevent/_abstract_linkable.py":133
9495 * return len(self._links)
9496 *
9497 * def ready(self): # <<<<<<<<<<<<<<
9498 * # Instances must define this
9499 * raise NotImplementedError
9500 */
9501 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 133, __pyx_L1_error)
9502 __Pyx_GOTREF(__pyx_tuple__10);
9503 __Pyx_GIVEREF(__pyx_tuple__10);
9504 __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_ready, 133, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 133, __pyx_L1_error)
9505
9506 /* "src/gevent/_abstract_linkable.py":137
9507 * raise NotImplementedError
9508 *
9509 * def rawlink(self, callback): # <<<<<<<<<<<<<<
9510 * """
9511 * Register a callback to call when this object is ready.
9512 */
9513 __pyx_tuple__12 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 137, __pyx_L1_error)
9514 __Pyx_GOTREF(__pyx_tuple__12);
9515 __Pyx_GIVEREF(__pyx_tuple__12);
9516 __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_rawlink, 137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 137, __pyx_L1_error)
9517
9518 /* "src/gevent/_abstract_linkable.py":150
9519 * self._check_and_notify()
9520 *
9521 * def unlink(self, callback): # <<<<<<<<<<<<<<
9522 * """Remove the callback set by :meth:`rawlink`"""
9523 * try:
9524 */
9525 __pyx_tuple__14 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_callback); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 150, __pyx_L1_error)
9526 __Pyx_GOTREF(__pyx_tuple__14);
9527 __Pyx_GIVEREF(__pyx_tuple__14);
9528 __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_unlink, 150, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) __PYX_ERR(0, 150, __pyx_L1_error)
9529
9530 /* "src/gevent/_abstract_linkable.py":287
9531 * return unswitched
9532 *
9533 * def _notify_links(self, arrived_while_waiting): # <<<<<<<<<<<<<<
9534 * # This method must hold the GIL, or be guarded with the lock that guards
9535 * # this object. Thus, while we are notifying objects, an object from another
9536 */
9537 __pyx_tuple__16 = PyTuple_Pack(2, __pyx_n_s_self_2, __pyx_n_s_arrived_while_waiting); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 287, __pyx_L1_error)
9538 __Pyx_GOTREF(__pyx_tuple__16);
9539 __Pyx_GIVEREF(__pyx_tuple__16);
9540 __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_notify_links, 287, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) __PYX_ERR(0, 287, __pyx_L1_error)
9541
9542 /* "src/gevent/_abstract_linkable.py":462
9543 * )
9544 *
9545 * def _acquire_lock_for_switch_in(self): # <<<<<<<<<<<<<<
9546 * return
9547 *
9548 */
9549 __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 462, __pyx_L1_error)
9550 __Pyx_GOTREF(__pyx_tuple__18);
9551 __Pyx_GIVEREF(__pyx_tuple__18);
9552 __pyx_codeobj__19 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__18, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_acquire_lock_for_switch_in, 462, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__19)) __PYX_ERR(0, 462, __pyx_L1_error)
9553
9554 /* "src/gevent/_abstract_linkable.py":465
9555 * return
9556 *
9557 * def _drop_lock_for_switch_out(self): # <<<<<<<<<<<<<<
9558 * return
9559 *
9560 */
9561 __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 465, __pyx_L1_error)
9562 __Pyx_GOTREF(__pyx_tuple__20);
9563 __Pyx_GIVEREF(__pyx_tuple__20);
9564 __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__20, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_drop_lock_for_switch_out, 465, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 465, __pyx_L1_error)
9565
9566 /* "src/gevent/_abstract_linkable.py":524
9567 * return self._wait_return_value(True, gotit)
9568 *
9569 * def _at_fork_reinit(self): # <<<<<<<<<<<<<<
9570 * """
9571 * This method was added in Python 3.9 and is called by logging.py
9572 */
9573 __pyx_tuple__22 = PyTuple_Pack(1, __pyx_n_s_self_2); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 524, __pyx_L1_error)
9574 __Pyx_GOTREF(__pyx_tuple__22);
9575 __Pyx_GIVEREF(__pyx_tuple__22);
9576 __pyx_codeobj__23 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__22, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__abstract_linkable_py, __pyx_n_s_at_fork_reinit, 524, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__23)) __PYX_ERR(0, 524, __pyx_L1_error)
9577 __Pyx_RefNannyFinishContext();
9578 return 0;
9579 __pyx_L1_error:;
9580 __Pyx_RefNannyFinishContext();
9581 return -1;
9582 }
9583 /* #### Code section: init_globals ### */
9584
__Pyx_InitGlobals(void)9585 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
9586 __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
9587 __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
9588 #if CYTHON_USE_MODULE_STATE
9589 if (__Pyx_InitString(__pyx_string_tab[0], &__pyx_n_s_) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9590 if (__Pyx_InitString(__pyx_string_tab[1], &__pyx_n_s_AbstractLinkable) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9591 if (__Pyx_InitString(__pyx_string_tab[2], &__pyx_n_s_AbstractLinkable__acquire_lock_f) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9592 if (__Pyx_InitString(__pyx_string_tab[3], &__pyx_n_s_AbstractLinkable__at_fork_reinit) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9593 if (__Pyx_InitString(__pyx_string_tab[4], &__pyx_n_s_AbstractLinkable__drop_lock_for) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9594 if (__Pyx_InitString(__pyx_string_tab[5], &__pyx_n_s_AbstractLinkable__notify_links) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9595 if (__Pyx_InitString(__pyx_string_tab[6], &__pyx_n_s_AbstractLinkable_linkcount) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9596 if (__Pyx_InitString(__pyx_string_tab[7], &__pyx_n_s_AbstractLinkable_rawlink) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9597 if (__Pyx_InitString(__pyx_string_tab[8], &__pyx_n_s_AbstractLinkable_ready) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9598 if (__Pyx_InitString(__pyx_string_tab[9], &__pyx_n_s_AbstractLinkable_unlink) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9599 if (__Pyx_InitString(__pyx_string_tab[10], &__pyx_n_s_AssertionError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9600 if (__Pyx_InitString(__pyx_string_tab[11], &__pyx_kp_s_Expected_callable_r) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9601 if (__Pyx_InitString(__pyx_string_tab[12], &__pyx_n_s_FakeNotifier) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9602 if (__Pyx_InitString(__pyx_string_tab[13], &__pyx_n_s_Hub) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9603 if (__Pyx_InitString(__pyx_string_tab[14], &__pyx_n_s_InvalidSwitchError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9604 if (__Pyx_InitString(__pyx_string_tab[15], &__pyx_n_s_InvalidThreadUseError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9605 if (__Pyx_InitString(__pyx_string_tab[16], &__pyx_kp_s_Invalid_switch_into_s_wait_r) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9606 if (__Pyx_InitString(__pyx_string_tab[17], &__pyx_n_s_NotImplementedError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9607 if (__Pyx_InitString(__pyx_string_tab[18], &__pyx_n_s_Timeout) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9608 if (__Pyx_InitString(__pyx_string_tab[19], &__pyx_n_s_TypeError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9609 if (__Pyx_InitString(__pyx_string_tab[20], &__pyx_n_s_ValueError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9610 if (__Pyx_InitString(__pyx_string_tab[21], &__pyx_n_s__24) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9611 if (__Pyx_InitString(__pyx_string_tab[22], &__pyx_n_s_acquire_lock_for_switch_in) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9612 if (__Pyx_InitString(__pyx_string_tab[23], &__pyx_n_s_all) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9613 if (__Pyx_InitString(__pyx_string_tab[24], &__pyx_n_s_allocate_lock) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9614 if (__Pyx_InitString(__pyx_string_tab[25], &__pyx_n_s_allocate_thread_lock) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9615 if (__Pyx_InitString(__pyx_string_tab[26], &__pyx_kp_s_and_is_a_bug_in_the_calling_code) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9616 if (__Pyx_InitString(__pyx_string_tab[27], &__pyx_n_s_append) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9617 if (__Pyx_InitString(__pyx_string_tab[28], &__pyx_n_s_args) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9618 if (__Pyx_InitString(__pyx_string_tab[29], &__pyx_n_s_arrived_while_waiting) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9619 if (__Pyx_InitString(__pyx_string_tab[30], &__pyx_n_s_asyncio_coroutines) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9620 if (__Pyx_InitString(__pyx_string_tab[31], &__pyx_n_s_at_fork_reinit) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9621 if (__Pyx_InitString(__pyx_string_tab[32], &__pyx_n_s_callback) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9622 if (__Pyx_InitString(__pyx_string_tab[33], &__pyx_n_s_class) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9623 if (__Pyx_InitString(__pyx_string_tab[34], &__pyx_n_s_cline_in_traceback) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9624 if (__Pyx_InitString(__pyx_string_tab[35], &__pyx_kp_s_crossing_thread_boundaries_is_n) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9625 if (__Pyx_InitString(__pyx_string_tab[36], &__pyx_n_s_dead) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9626 if (__Pyx_InitString(__pyx_string_tab[37], &__pyx_kp_u_disable) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9627 if (__Pyx_InitString(__pyx_string_tab[38], &__pyx_n_s_drop_lock_for_switch_out) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9628 if (__Pyx_InitString(__pyx_string_tab[39], &__pyx_kp_u_enable) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9629 if (__Pyx_InitString(__pyx_string_tab[40], &__pyx_n_s_enter) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9630 if (__Pyx_InitString(__pyx_string_tab[41], &__pyx_n_s_error) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9631 if (__Pyx_InitString(__pyx_string_tab[42], &__pyx_n_s_exc_info) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9632 if (__Pyx_InitString(__pyx_string_tab[43], &__pyx_n_s_exit) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9633 if (__Pyx_InitString(__pyx_string_tab[44], &__pyx_n_s_file) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9634 if (__Pyx_InitString(__pyx_string_tab[45], &__pyx_n_s_from) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9635 if (__Pyx_InitString(__pyx_string_tab[46], &__pyx_n_s_gc) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9636 if (__Pyx_InitString(__pyx_string_tab[47], &__pyx_kp_u_gc) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9637 if (__Pyx_InitString(__pyx_string_tab[48], &__pyx_n_s_get) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9638 if (__Pyx_InitString(__pyx_string_tab[49], &__pyx_n_s_get_hub_if_exists) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9639 if (__Pyx_InitString(__pyx_string_tab[50], &__pyx_n_s_get_hub_noargs) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9640 if (__Pyx_InitString(__pyx_string_tab[51], &__pyx_n_s_get_ident) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9641 if (__Pyx_InitString(__pyx_string_tab[52], &__pyx_n_s_get_objects) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9642 if (__Pyx_InitString(__pyx_string_tab[53], &__pyx_n_s_get_thread_ident) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9643 if (__Pyx_InitString(__pyx_string_tab[54], &__pyx_n_s_getcurrent) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9644 if (__Pyx_InitString(__pyx_string_tab[55], &__pyx_kp_s_gevent___abstract_linkable) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9645 if (__Pyx_InitString(__pyx_string_tab[56], &__pyx_n_s_gevent__compat) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9646 if (__Pyx_InitString(__pyx_string_tab[57], &__pyx_n_s_gevent__gevent_c_abstract_linkab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9647 if (__Pyx_InitString(__pyx_string_tab[58], &__pyx_n_s_gevent__hub_local) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9648 if (__Pyx_InitString(__pyx_string_tab[59], &__pyx_n_s_gevent__util) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9649 if (__Pyx_InitString(__pyx_string_tab[60], &__pyx_kp_s_gevent_error_This_is_a_result_of) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9650 if (__Pyx_InitString(__pyx_string_tab[61], &__pyx_kp_s_gevent_error_Unable_to_switch_to) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9651 if (__Pyx_InitString(__pyx_string_tab[62], &__pyx_n_s_gevent_exceptions) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9652 if (__Pyx_InitString(__pyx_string_tab[63], &__pyx_n_s_gevent_hub) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9653 if (__Pyx_InitString(__pyx_string_tab[64], &__pyx_n_s_gevent_timeout) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9654 if (__Pyx_InitString(__pyx_string_tab[65], &__pyx_n_s_greenlet) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9655 if (__Pyx_InitString(__pyx_string_tab[66], &__pyx_n_s_greenlet_error) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9656 if (__Pyx_InitString(__pyx_string_tab[67], &__pyx_n_s_greenlet_imported) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9657 if (__Pyx_InitString(__pyx_string_tab[68], &__pyx_n_s_greenlet_init) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9658 if (__Pyx_InitString(__pyx_string_tab[69], &__pyx_n_s_handle_error) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9659 if (__Pyx_InitString(__pyx_string_tab[70], &__pyx_n_s_hub) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9660 if (__Pyx_InitString(__pyx_string_tab[71], &__pyx_n_s_id) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9661 if (__Pyx_InitString(__pyx_string_tab[72], &__pyx_n_s_import) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9662 if (__Pyx_InitString(__pyx_string_tab[73], &__pyx_n_s_import_c_accel) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9663 if (__Pyx_InitString(__pyx_string_tab[74], &__pyx_n_s_initializing) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9664 if (__Pyx_InitString(__pyx_string_tab[75], &__pyx_n_s_is_coroutine) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9665 if (__Pyx_InitString(__pyx_string_tab[76], &__pyx_kp_u_isenabled) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9666 if (__Pyx_InitString(__pyx_string_tab[77], &__pyx_n_s_lambda) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9667 if (__Pyx_InitString(__pyx_string_tab[78], &__pyx_n_s_linkcount) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9668 if (__Pyx_InitString(__pyx_string_tab[79], &__pyx_n_s_links) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9669 if (__Pyx_InitString(__pyx_string_tab[80], &__pyx_n_s_loop) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9670 if (__Pyx_InitString(__pyx_string_tab[81], &__pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9671 if (__Pyx_InitString(__pyx_string_tab[82], &__pyx_n_s_name) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9672 if (__Pyx_InitString(__pyx_string_tab[83], &__pyx_n_s_notifier) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9673 if (__Pyx_InitString(__pyx_string_tab[84], &__pyx_n_s_notify_all) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9674 if (__Pyx_InitString(__pyx_string_tab[85], &__pyx_n_s_notify_links) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9675 if (__Pyx_InitString(__pyx_string_tab[86], &__pyx_n_s_parent) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9676 if (__Pyx_InitString(__pyx_string_tab[87], &__pyx_n_s_pending) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9677 if (__Pyx_InitString(__pyx_string_tab[88], &__pyx_n_s_pop) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9678 if (__Pyx_InitString(__pyx_string_tab[89], &__pyx_n_s_print) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9679 if (__Pyx_InitString(__pyx_string_tab[90], &__pyx_n_s_print_exc) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9680 if (__Pyx_InitString(__pyx_string_tab[91], &__pyx_n_s_print_stack) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9681 if (__Pyx_InitString(__pyx_string_tab[92], &__pyx_n_s_pyx_capi) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9682 if (__Pyx_InitString(__pyx_string_tab[93], &__pyx_n_s_pyx_vtable) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9683 if (__Pyx_InitString(__pyx_string_tab[94], &__pyx_n_s_rawlink) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9684 if (__Pyx_InitString(__pyx_string_tab[95], &__pyx_n_s_ready) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9685 if (__Pyx_InitString(__pyx_string_tab[96], &__pyx_n_s_remove) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9686 if (__Pyx_InitString(__pyx_string_tab[97], &__pyx_n_s_run_callback) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9687 if (__Pyx_InitString(__pyx_string_tab[98], &__pyx_n_s_run_callback_threadsafe) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9688 if (__Pyx_InitString(__pyx_string_tab[99], &__pyx_n_s_self) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9689 if (__Pyx_InitString(__pyx_string_tab[100], &__pyx_n_s_self_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9690 if (__Pyx_InitString(__pyx_string_tab[101], &__pyx_n_s_slots) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9691 if (__Pyx_InitString(__pyx_string_tab[102], &__pyx_n_s_spec) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9692 if (__Pyx_InitString(__pyx_string_tab[103], &__pyx_kp_s_src_gevent__abstract_linkable_py) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9693 if (__Pyx_InitString(__pyx_string_tab[104], &__pyx_n_s_start_new_or_dummy) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9694 if (__Pyx_InitString(__pyx_string_tab[105], &__pyx_n_s_stderr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9695 if (__Pyx_InitString(__pyx_string_tab[106], &__pyx_n_s_stop) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9696 if (__Pyx_InitString(__pyx_string_tab[107], &__pyx_n_s_switch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9697 if (__Pyx_InitString(__pyx_string_tab[108], &__pyx_n_s_sys) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9698 if (__Pyx_InitString(__pyx_string_tab[109], &__pyx_n_s_test) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9699 if (__Pyx_InitString(__pyx_string_tab[110], &__pyx_n_s_thread_ident) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9700 if (__Pyx_InitString(__pyx_string_tab[111], &__pyx_n_s_thread_mod_name) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9701 if (__Pyx_InitString(__pyx_string_tab[112], &__pyx_n_s_traceback) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9702 if (__Pyx_InitString(__pyx_string_tab[113], &__pyx_n_s_unlink) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9703 if (__Pyx_InitString(__pyx_string_tab[114], &__pyx_n_s_weakref) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9704 #endif
9705 #if !CYTHON_USE_MODULE_STATE
9706 if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
9707 #endif
9708 __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
9709 __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
9710 return 0;
9711 __pyx_L1_error:;
9712 return -1;
9713 }
9714 /* #### Code section: init_module ### */
9715
9716 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
9717 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
9718 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
9719 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
9720 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
9721 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
9722 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
9723
__Pyx_modinit_global_init_code(void)9724 static int __Pyx_modinit_global_init_code(void) {
9725 __Pyx_RefNannyDeclarations
9726 __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
9727 /*--- Global init code ---*/
9728 __pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError = Py_None; Py_INCREF(Py_None);
9729 __pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError = Py_None; Py_INCREF(Py_None);
9730 __pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout = Py_None; Py_INCREF(Py_None);
9731 __pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident = Py_None; Py_INCREF(Py_None);
9732 __pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects = Py_None; Py_INCREF(Py_None);
9733 __Pyx_RefNannyFinishContext();
9734 return 0;
9735 }
9736
__Pyx_modinit_variable_export_code(void)9737 static int __Pyx_modinit_variable_export_code(void) {
9738 __Pyx_RefNannyDeclarations
9739 int __pyx_lineno = 0;
9740 const char *__pyx_filename = NULL;
9741 int __pyx_clineno = 0;
9742 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
9743 /*--- Variable export code ---*/
9744 if (__Pyx_ExportVoidPtr(__pyx_n_s_InvalidSwitchError, (void *)&__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9745 if (__Pyx_ExportVoidPtr(__pyx_n_s_InvalidThreadUseError, (void *)&__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9746 if (__Pyx_ExportVoidPtr(__pyx_n_s_Timeout, (void *)&__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9747 if (__Pyx_ExportVoidPtr(__pyx_n_s_get_thread_ident, (void *)&__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9748 if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_27_gevent_c_abstract_linkable__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9749 if (__Pyx_ExportVoidPtr(__pyx_n_s_get_objects, (void *)&__pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9750 __Pyx_RefNannyFinishContext();
9751 return 0;
9752 __pyx_L1_error:;
9753 __Pyx_RefNannyFinishContext();
9754 return -1;
9755 }
9756
__Pyx_modinit_function_export_code(void)9757 static int __Pyx_modinit_function_export_code(void) {
9758 __Pyx_RefNannyDeclarations
9759 int __pyx_lineno = 0;
9760 const char *__pyx_filename = NULL;
9761 int __pyx_clineno = 0;
9762 __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
9763 /*--- Function export code ---*/
9764 if (__Pyx_ExportFunction("_init", (void (*)(void))__pyx_f_6gevent_27_gevent_c_abstract_linkable__init, "void (void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9765 if (__Pyx_ExportFunction("get_roots_and_hubs", (void (*)(void))__pyx_f_6gevent_27_gevent_c_abstract_linkable_get_roots_and_hubs, "PyObject *(void)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9766 __Pyx_RefNannyFinishContext();
9767 return 0;
9768 __pyx_L1_error:;
9769 __Pyx_RefNannyFinishContext();
9770 return -1;
9771 }
9772
__Pyx_modinit_type_init_code(void)9773 static int __Pyx_modinit_type_init_code(void) {
9774 __Pyx_RefNannyDeclarations
9775 PyObject *__pyx_t_1 = NULL;
9776 int __pyx_lineno = 0;
9777 const char *__pyx_filename = NULL;
9778 int __pyx_clineno = 0;
9779 __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
9780 /*--- Type init code ---*/
9781 __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 16, __pyx_L1_error)
9782 __Pyx_GOTREF(__pyx_t_1);
9783 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn);
9784 if (!__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet) __PYX_ERR(2, 16, __pyx_L1_error)
9785 #if CYTHON_USE_TYPE_SPECS
9786 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier_spec, NULL); if (unlikely(!__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier)) __PYX_ERR(0, 37, __pyx_L1_error)
9787 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier_spec, __pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
9788 #else
9789 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier = &__pyx_type_6gevent_27_gevent_c_abstract_linkable__FakeNotifier;
9790 #endif
9791 #if !CYTHON_COMPILING_IN_LIMITED_API
9792 #endif
9793 #if !CYTHON_USE_TYPE_SPECS
9794 if (__Pyx_PyType_Ready(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
9795 #endif
9796 #if PY_MAJOR_VERSION < 3
9797 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier->tp_print = 0;
9798 #endif
9799 #if !CYTHON_COMPILING_IN_LIMITED_API
9800 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier->tp_dictoffset && __pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier->tp_getattro == PyObject_GenericGetAttr)) {
9801 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier->tp_getattro = __Pyx_PyObject_GenericGetAttr;
9802 }
9803 #endif
9804 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FakeNotifier, (PyObject *) __pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier) < 0) __PYX_ERR(0, 37, __pyx_L1_error)
9805 __pyx_vtabptr_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable = &__pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;
9806 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable.linkcount = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_linkcount;
9807 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable.rawlink = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_rawlink;
9808 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable.ready = (int (*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_ready;
9809 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable.unlink = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_unlink;
9810 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._check_and_notify = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__check_and_notify;
9811 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._capture_hub = (struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__capture_hub;
9812 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._AbstractLinkable__wait_to_be_notified = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__wait_to_be_notified;
9813 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._quiet_unlink_all = (void (*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__quiet_unlink_all;
9814 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._switch_to_hub = (int (*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__switch_to_hub;
9815 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._notify_link_list = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_link_list;
9816 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._notify_links = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_links;
9817 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._handle_unswitched_notifications = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__handle_unswitched_notifications;
9818 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._AbstractLinkable__print_unswitched_warning = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__print_unswitched_warning;
9819 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._drop_lock_for_switch_out = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__drop_lock_for_switch_out;
9820 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._acquire_lock_for_switch_in = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__acquire_lock_for_switch_in;
9821 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._wait_core = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core;
9822 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._wait_return_value = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int, int))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_return_value;
9823 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._wait = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait;
9824 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._allocate_lock = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__allocate_lock;
9825 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._getcurrent = (PyGreenlet *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__getcurrent;
9826 __pyx_vtable_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable._get_thread_ident = (PyObject *(*)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *))__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__get_thread_ident;
9827 #if CYTHON_USE_TYPE_SPECS
9828 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable_spec, NULL); if (unlikely(!__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable)) __PYX_ERR(0, 58, __pyx_L1_error)
9829 if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable_spec, __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
9830 #else
9831 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable = &__pyx_type_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;
9832 #endif
9833 #if !CYTHON_COMPILING_IN_LIMITED_API
9834 #endif
9835 #if !CYTHON_USE_TYPE_SPECS
9836 if (__Pyx_PyType_Ready(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
9837 #endif
9838 #if PY_MAJOR_VERSION < 3
9839 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_print = 0;
9840 #endif
9841 #if !CYTHON_COMPILING_IN_LIMITED_API
9842 if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dictoffset && __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_getattro == PyObject_GenericGetAttr)) {
9843 __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_getattro = __Pyx_PyObject_GenericGetAttr;
9844 }
9845 #endif
9846 if (__Pyx_SetVtable(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_vtabptr_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
9847 #if !CYTHON_COMPILING_IN_LIMITED_API
9848 if (__Pyx_MergeVtables(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
9849 #endif
9850 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_AbstractLinkable, (PyObject *) __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
9851 if (__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_weaklistoffset == 0) __pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_weaklistoffset = offsetof(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __weakref__);
9852 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9853 __Pyx_RefNannyFinishContext();
9854 return 0;
9855 __pyx_L1_error:;
9856 __Pyx_XDECREF(__pyx_t_1);
9857 __Pyx_RefNannyFinishContext();
9858 return -1;
9859 }
9860
__Pyx_modinit_type_import_code(void)9861 static int __Pyx_modinit_type_import_code(void) {
9862 __Pyx_RefNannyDeclarations
9863 PyObject *__pyx_t_1 = NULL;
9864 PyObject *__pyx_t_2 = NULL;
9865 int __pyx_lineno = 0;
9866 const char *__pyx_filename = NULL;
9867 int __pyx_clineno = 0;
9868 __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
9869 /*--- Type import code ---*/
9870 __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
9871 __Pyx_GOTREF(__pyx_t_1);
9872 __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn);
9873 if (!__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error)
9874 __pyx_t_2 = PyImport_ImportModule("gevent._gevent_c_greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error)
9875 __Pyx_GOTREF(__pyx_t_2);
9876 __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet = __Pyx_ImportType(__pyx_t_2, "gevent._gevent_c_greenlet_primitives", "TrackedRawGreenlet", sizeof(struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet), __Pyx_ImportType_CheckSize_Warn);
9877 if (!__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error)
9878 __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop = __Pyx_ImportType(__pyx_t_2, "gevent._gevent_c_greenlet_primitives", "SwitchOutGreenletWithLoop", sizeof(struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop), __Pyx_ImportType_CheckSize_Warn);
9879 if (!__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error)
9880 __pyx_vtabptr_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop = (struct __pyx_vtabstruct_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop*)__Pyx_GetVtable(__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop); if (unlikely(!__pyx_vtabptr_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error)
9881 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9882 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9883 __Pyx_RefNannyFinishContext();
9884 return 0;
9885 __pyx_L1_error:;
9886 __Pyx_XDECREF(__pyx_t_1);
9887 __Pyx_XDECREF(__pyx_t_2);
9888 __Pyx_RefNannyFinishContext();
9889 return -1;
9890 }
9891
__Pyx_modinit_variable_import_code(void)9892 static int __Pyx_modinit_variable_import_code(void) {
9893 __Pyx_RefNannyDeclarations
9894 PyObject *__pyx_t_1 = NULL;
9895 int __pyx_lineno = 0;
9896 const char *__pyx_filename = NULL;
9897 int __pyx_clineno = 0;
9898 __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
9899 /*--- Variable import code ---*/
9900 __pyx_t_1 = PyImport_ImportModule("gevent._gevent_c_greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
9901 __Pyx_GOTREF(__pyx_t_1);
9902 if (__Pyx_ImportVoidPtr(__pyx_t_1, "get_objects", (void **)&__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_get_objects, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9903 if (__Pyx_ImportVoidPtr(__pyx_t_1, "wref", (void **)&__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_wref, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9904 if (__Pyx_ImportVoidPtr(__pyx_t_1, "BlockingSwitchOutError", (void **)&__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_BlockingSwitchOutError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9905 if (__Pyx_ImportVoidPtr(__pyx_t_1, "_greenlet_imported", (void **)&__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9906 if (__Pyx_ImportVoidPtr(__pyx_t_1, "_memoryview", (void **)&__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__memoryview, "PyTypeObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9907 if (__Pyx_ImportVoidPtr(__pyx_t_1, "_buffer", (void **)&__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__buffer, "PyTypeObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9908 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9909 __pyx_t_1 = PyImport_ImportModule("gevent._gevent_c_hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
9910 __Pyx_GOTREF(__pyx_t_1);
9911 if (__Pyx_ImportVoidPtr(__pyx_t_1, "_threadlocal", (void **)&__pyx_vp_6gevent_19_gevent_c_hub_local__threadlocal, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9912 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9913 __Pyx_RefNannyFinishContext();
9914 return 0;
9915 __pyx_L1_error:;
9916 __Pyx_XDECREF(__pyx_t_1);
9917 __Pyx_RefNannyFinishContext();
9918 return -1;
9919 }
9920
__Pyx_modinit_function_import_code(void)9921 static int __Pyx_modinit_function_import_code(void) {
9922 __Pyx_RefNannyDeclarations
9923 PyObject *__pyx_t_1 = NULL;
9924 int __pyx_lineno = 0;
9925 const char *__pyx_filename = NULL;
9926 int __pyx_clineno = 0;
9927 __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
9928 /*--- Function import code ---*/
9929 __pyx_t_1 = PyImport_ImportModule("gevent._gevent_c_hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
9930 __Pyx_GOTREF(__pyx_t_1);
9931 if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_if_exists", (void (**)(void))&__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_if_exists, "struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9932 if (__Pyx_ImportFunction(__pyx_t_1, "get_hub_noargs", (void (**)(void))&__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_noargs, "struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *(int __pyx_skip_dispatch)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
9933 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9934 __Pyx_RefNannyFinishContext();
9935 return 0;
9936 __pyx_L1_error:;
9937 __Pyx_XDECREF(__pyx_t_1);
9938 __Pyx_RefNannyFinishContext();
9939 return -1;
9940 }
9941
9942
9943 #if PY_MAJOR_VERSION >= 3
9944 #if CYTHON_PEP489_MULTI_PHASE_INIT
9945 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
9946 static int __pyx_pymod_exec__gevent_c_abstract_linkable(PyObject* module); /*proto*/
9947 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
9948 {Py_mod_create, (void*)__pyx_pymod_create},
9949 {Py_mod_exec, (void*)__pyx_pymod_exec__gevent_c_abstract_linkable},
9950 {0, NULL}
9951 };
9952 #endif
9953
9954 #ifdef __cplusplus
9955 namespace {
9956 struct PyModuleDef __pyx_moduledef =
9957 #else
9958 static struct PyModuleDef __pyx_moduledef =
9959 #endif
9960 {
9961 PyModuleDef_HEAD_INIT,
9962 "_gevent_c_abstract_linkable",
9963 __pyx_k_Internal_module_support_for_the, /* m_doc */
9964 #if CYTHON_PEP489_MULTI_PHASE_INIT
9965 0, /* m_size */
9966 #elif CYTHON_USE_MODULE_STATE
9967 sizeof(__pyx_mstate), /* m_size */
9968 #else
9969 -1, /* m_size */
9970 #endif
9971 __pyx_methods /* m_methods */,
9972 #if CYTHON_PEP489_MULTI_PHASE_INIT
9973 __pyx_moduledef_slots, /* m_slots */
9974 #else
9975 NULL, /* m_reload */
9976 #endif
9977 #if CYTHON_USE_MODULE_STATE
9978 __pyx_m_traverse, /* m_traverse */
9979 __pyx_m_clear, /* m_clear */
9980 NULL /* m_free */
9981 #else
9982 NULL, /* m_traverse */
9983 NULL, /* m_clear */
9984 NULL /* m_free */
9985 #endif
9986 };
9987 #ifdef __cplusplus
9988 } /* anonymous namespace */
9989 #endif
9990 #endif
9991
9992 #ifndef CYTHON_NO_PYINIT_EXPORT
9993 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
9994 #elif PY_MAJOR_VERSION < 3
9995 #ifdef __cplusplus
9996 #define __Pyx_PyMODINIT_FUNC extern "C" void
9997 #else
9998 #define __Pyx_PyMODINIT_FUNC void
9999 #endif
10000 #else
10001 #ifdef __cplusplus
10002 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
10003 #else
10004 #define __Pyx_PyMODINIT_FUNC PyObject *
10005 #endif
10006 #endif
10007
10008
10009 #if PY_MAJOR_VERSION < 3
10010 __Pyx_PyMODINIT_FUNC init_gevent_c_abstract_linkable(void) CYTHON_SMALL_CODE; /*proto*/
init_gevent_c_abstract_linkable(void)10011 __Pyx_PyMODINIT_FUNC init_gevent_c_abstract_linkable(void)
10012 #else
10013 __Pyx_PyMODINIT_FUNC PyInit__gevent_c_abstract_linkable(void) CYTHON_SMALL_CODE; /*proto*/
10014 __Pyx_PyMODINIT_FUNC PyInit__gevent_c_abstract_linkable(void)
10015 #if CYTHON_PEP489_MULTI_PHASE_INIT
10016 {
10017 return PyModuleDef_Init(&__pyx_moduledef);
10018 }
10019 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
10020 #if PY_VERSION_HEX >= 0x030700A1
10021 static PY_INT64_T main_interpreter_id = -1;
10022 PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
10023 if (main_interpreter_id == -1) {
10024 main_interpreter_id = current_id;
10025 return (unlikely(current_id == -1)) ? -1 : 0;
10026 } else if (unlikely(main_interpreter_id != current_id))
10027 #else
10028 static PyInterpreterState *main_interpreter = NULL;
10029 PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
10030 if (!main_interpreter) {
10031 main_interpreter = current_interpreter;
10032 } else if (unlikely(main_interpreter != current_interpreter))
10033 #endif
10034 {
10035 PyErr_SetString(
10036 PyExc_ImportError,
10037 "Interpreter change detected - this module can only be loaded into one interpreter per process.");
10038 return -1;
10039 }
10040 return 0;
10041 }
10042 #if CYTHON_COMPILING_IN_LIMITED_API
10043 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
10044 #else
10045 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
10046 #endif
10047 {
10048 PyObject *value = PyObject_GetAttrString(spec, from_name);
10049 int result = 0;
10050 if (likely(value)) {
10051 if (allow_none || value != Py_None) {
10052 #if CYTHON_COMPILING_IN_LIMITED_API
10053 result = PyModule_AddObject(module, to_name, value);
10054 #else
10055 result = PyDict_SetItemString(moddict, to_name, value);
10056 #endif
10057 }
10058 Py_DECREF(value);
10059 } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
10060 PyErr_Clear();
10061 } else {
10062 result = -1;
10063 }
10064 return result;
10065 }
10066 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
10067 PyObject *module = NULL, *moddict, *modname;
10068 CYTHON_UNUSED_VAR(def);
10069 if (__Pyx_check_single_interpreter())
10070 return NULL;
10071 if (__pyx_m)
10072 return __Pyx_NewRef(__pyx_m);
10073 modname = PyObject_GetAttrString(spec, "name");
10074 if (unlikely(!modname)) goto bad;
10075 module = PyModule_NewObject(modname);
10076 Py_DECREF(modname);
10077 if (unlikely(!module)) goto bad;
10078 #if CYTHON_COMPILING_IN_LIMITED_API
10079 moddict = module;
10080 #else
10081 moddict = PyModule_GetDict(module);
10082 if (unlikely(!moddict)) goto bad;
10083 #endif
10084 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
10085 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
10086 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
10087 if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
10088 return module;
10089 bad:
10090 Py_XDECREF(module);
10091 return NULL;
10092 }
10093
10094
10095 static CYTHON_SMALL_CODE int __pyx_pymod_exec__gevent_c_abstract_linkable(PyObject *__pyx_pyinit_module)
10096 #endif
10097 #endif
10098 {
10099 PyObject *__pyx_t_1 = NULL;
10100 PyObject *__pyx_t_2 = NULL;
10101 PyObject *__pyx_t_3 = NULL;
10102 int __pyx_lineno = 0;
10103 const char *__pyx_filename = NULL;
10104 int __pyx_clineno = 0;
10105 __Pyx_RefNannyDeclarations
10106 #if CYTHON_PEP489_MULTI_PHASE_INIT
10107 if (__pyx_m) {
10108 if (__pyx_m == __pyx_pyinit_module) return 0;
10109 PyErr_SetString(PyExc_RuntimeError, "Module '_gevent_c_abstract_linkable' has already been imported. Re-initialisation is not supported.");
10110 return -1;
10111 }
10112 #elif PY_MAJOR_VERSION >= 3
10113 if (__pyx_m) return __Pyx_NewRef(__pyx_m);
10114 #endif
10115 /*--- Module creation code ---*/
10116 #if CYTHON_PEP489_MULTI_PHASE_INIT
10117 __pyx_m = __pyx_pyinit_module;
10118 Py_INCREF(__pyx_m);
10119 #else
10120 #if PY_MAJOR_VERSION < 3
10121 __pyx_m = Py_InitModule4("_gevent_c_abstract_linkable", __pyx_methods, __pyx_k_Internal_module_support_for_the, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
10122 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
10123 #elif CYTHON_COMPILING_IN_LIMITED_API
10124 __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
10125 __Pyx_GOTREF(__pyx_t_1);
10126 if (unlikely((PyState_AddModule(__pyx_t_1, &__pyx_moduledef) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
10127 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10128 #else
10129 __pyx_m = PyModule_Create(&__pyx_moduledef);
10130 if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
10131 #endif
10132 #endif
10133 __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
10134 Py_INCREF(__pyx_d);
10135 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
10136 Py_INCREF(__pyx_b);
10137 __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
10138 Py_INCREF(__pyx_cython_runtime);
10139 if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
10140 #if CYTHON_REFNANNY
10141 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
10142 if (!__Pyx_RefNanny) {
10143 PyErr_Clear();
10144 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
10145 if (!__Pyx_RefNanny)
10146 Py_FatalError("failed to import 'refnanny' module");
10147 }
10148 #endif
10149 __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__gevent_c_abstract_linkable(void)", 0);
10150 if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10151 #ifdef __Pxy_PyFrame_Initialize_Offsets
10152 __Pxy_PyFrame_Initialize_Offsets();
10153 #endif
10154 __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
10155 __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
10156 __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
10157 #ifdef __Pyx_CyFunction_USED
10158 if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10159 #endif
10160 #ifdef __Pyx_FusedFunction_USED
10161 if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10162 #endif
10163 #ifdef __Pyx_Coroutine_USED
10164 if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10165 #endif
10166 #ifdef __Pyx_Generator_USED
10167 if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10168 #endif
10169 #ifdef __Pyx_AsyncGen_USED
10170 if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10171 #endif
10172 #ifdef __Pyx_StopAsyncIteration_USED
10173 if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10174 #endif
10175 /*--- Library function declarations ---*/
10176 /*--- Threads initialization code ---*/
10177 #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
10178 PyEval_InitThreads();
10179 #endif
10180 /*--- Initialize various global constants etc. ---*/
10181 if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10182 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
10183 if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10184 #endif
10185 if (__pyx_module_is_main_gevent___gevent_c_abstract_linkable) {
10186 if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10187 }
10188 #if PY_MAJOR_VERSION >= 3
10189 {
10190 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
10191 if (!PyDict_GetItemString(modules, "gevent._gevent_c_abstract_linkable")) {
10192 if (unlikely((PyDict_SetItemString(modules, "gevent._gevent_c_abstract_linkable", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
10193 }
10194 }
10195 #endif
10196 /*--- Builtin init code ---*/
10197 if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10198 /*--- Constants init code ---*/
10199 if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10200 /*--- Global type/function init code ---*/
10201 (void)__Pyx_modinit_global_init_code();
10202 if (unlikely((__Pyx_modinit_variable_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
10203 if (unlikely((__Pyx_modinit_function_export_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
10204 if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
10205 if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
10206 if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
10207 if (unlikely((__Pyx_modinit_function_import_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
10208 /*--- Execution code ---*/
10209 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
10210 if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10211 #endif
10212
10213 /* "src/gevent/_abstract_linkable.py":11
10214 * from __future__ import print_function
10215 *
10216 * import sys # <<<<<<<<<<<<<<
10217 * from gc import get_objects
10218 *
10219 */
10220 __pyx_t_1 = __Pyx_ImportDottedModule(__pyx_n_s_sys, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
10221 __Pyx_GOTREF(__pyx_t_1);
10222 if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
10223 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10224
10225 /* "src/gevent/_abstract_linkable.py":12
10226 *
10227 * import sys
10228 * from gc import get_objects # <<<<<<<<<<<<<<
10229 *
10230 * from greenlet import greenlet
10231 */
10232 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
10233 __Pyx_GOTREF(__pyx_t_1);
10234 __Pyx_INCREF(__pyx_n_s_get_objects);
10235 __Pyx_GIVEREF(__pyx_n_s_get_objects);
10236 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_objects);
10237 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gc, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
10238 __Pyx_GOTREF(__pyx_t_2);
10239 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10240 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_objects); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
10241 __Pyx_GOTREF(__pyx_t_1);
10242 __Pyx_INCREF(__pyx_t_1);
10243 __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects);
10244 __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects, __pyx_t_1);
10245 __Pyx_GIVEREF(__pyx_t_1);
10246 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10247 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10248
10249 /* "src/gevent/_abstract_linkable.py":14
10250 * from gc import get_objects
10251 *
10252 * from greenlet import greenlet # <<<<<<<<<<<<<<
10253 * from greenlet import error as greenlet_error
10254 *
10255 */
10256 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
10257 __Pyx_GOTREF(__pyx_t_2);
10258 __Pyx_INCREF(__pyx_n_s_greenlet);
10259 __Pyx_GIVEREF(__pyx_n_s_greenlet);
10260 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_greenlet);
10261 __pyx_t_1 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
10262 __Pyx_GOTREF(__pyx_t_1);
10263 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10264 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10265
10266 /* "src/gevent/_abstract_linkable.py":15
10267 *
10268 * from greenlet import greenlet
10269 * from greenlet import error as greenlet_error # <<<<<<<<<<<<<<
10270 *
10271 * from gevent._compat import thread_mod_name
10272 */
10273 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
10274 __Pyx_GOTREF(__pyx_t_1);
10275 __Pyx_INCREF(__pyx_n_s_error);
10276 __Pyx_GIVEREF(__pyx_n_s_error);
10277 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_error);
10278 __pyx_t_2 = __Pyx_Import(__pyx_n_s_greenlet, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
10279 __Pyx_GOTREF(__pyx_t_2);
10280 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10281 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
10282 __Pyx_GOTREF(__pyx_t_1);
10283 if (PyDict_SetItem(__pyx_d, __pyx_n_s_greenlet_error, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
10284 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10285 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10286
10287 /* "src/gevent/_abstract_linkable.py":17
10288 * from greenlet import error as greenlet_error
10289 *
10290 * from gevent._compat import thread_mod_name # <<<<<<<<<<<<<<
10291 * from gevent._hub_local import get_hub_noargs as get_hub
10292 * from gevent._hub_local import get_hub_if_exists
10293 */
10294 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
10295 __Pyx_GOTREF(__pyx_t_2);
10296 __Pyx_INCREF(__pyx_n_s_thread_mod_name);
10297 __Pyx_GIVEREF(__pyx_n_s_thread_mod_name);
10298 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_thread_mod_name);
10299 __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__compat, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
10300 __Pyx_GOTREF(__pyx_t_1);
10301 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10302 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
10303 __Pyx_GOTREF(__pyx_t_2);
10304 if (PyDict_SetItem(__pyx_d, __pyx_n_s_thread_mod_name, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
10305 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10306 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10307
10308 /* "src/gevent/_abstract_linkable.py":18
10309 *
10310 * from gevent._compat import thread_mod_name
10311 * from gevent._hub_local import get_hub_noargs as get_hub # <<<<<<<<<<<<<<
10312 * from gevent._hub_local import get_hub_if_exists
10313 *
10314 */
10315 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
10316 __Pyx_GOTREF(__pyx_t_1);
10317 __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
10318 __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
10319 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs);
10320 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
10321 __Pyx_GOTREF(__pyx_t_2);
10322 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10323 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 18, __pyx_L1_error)
10324 __Pyx_GOTREF(__pyx_t_1);
10325 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
10326 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10327 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10328
10329 /* "src/gevent/_abstract_linkable.py":19
10330 * from gevent._compat import thread_mod_name
10331 * from gevent._hub_local import get_hub_noargs as get_hub
10332 * from gevent._hub_local import get_hub_if_exists # <<<<<<<<<<<<<<
10333 *
10334 * from gevent.exceptions import InvalidSwitchError
10335 */
10336 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
10337 __Pyx_GOTREF(__pyx_t_2);
10338 __Pyx_INCREF(__pyx_n_s_get_hub_if_exists);
10339 __Pyx_GIVEREF(__pyx_n_s_get_hub_if_exists);
10340 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_get_hub_if_exists);
10341 __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
10342 __Pyx_GOTREF(__pyx_t_1);
10343 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10344 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_get_hub_if_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
10345 __Pyx_GOTREF(__pyx_t_2);
10346 if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_if_exists, __pyx_t_2) < 0) __PYX_ERR(0, 19, __pyx_L1_error)
10347 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10348 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10349
10350 /* "src/gevent/_abstract_linkable.py":21
10351 * from gevent._hub_local import get_hub_if_exists
10352 *
10353 * from gevent.exceptions import InvalidSwitchError # <<<<<<<<<<<<<<
10354 * from gevent.exceptions import InvalidThreadUseError
10355 * from gevent.timeout import Timeout
10356 */
10357 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
10358 __Pyx_GOTREF(__pyx_t_1);
10359 __Pyx_INCREF(__pyx_n_s_InvalidSwitchError);
10360 __Pyx_GIVEREF(__pyx_n_s_InvalidSwitchError);
10361 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_InvalidSwitchError);
10362 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
10363 __Pyx_GOTREF(__pyx_t_2);
10364 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10365 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InvalidSwitchError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
10366 __Pyx_GOTREF(__pyx_t_1);
10367 __Pyx_INCREF(__pyx_t_1);
10368 __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError);
10369 __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError, __pyx_t_1);
10370 __Pyx_GIVEREF(__pyx_t_1);
10371 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10372 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10373
10374 /* "src/gevent/_abstract_linkable.py":22
10375 *
10376 * from gevent.exceptions import InvalidSwitchError
10377 * from gevent.exceptions import InvalidThreadUseError # <<<<<<<<<<<<<<
10378 * from gevent.timeout import Timeout
10379 *
10380 */
10381 __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
10382 __Pyx_GOTREF(__pyx_t_2);
10383 __Pyx_INCREF(__pyx_n_s_InvalidThreadUseError);
10384 __Pyx_GIVEREF(__pyx_n_s_InvalidThreadUseError);
10385 PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_InvalidThreadUseError);
10386 __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 22, __pyx_L1_error)
10387 __Pyx_GOTREF(__pyx_t_1);
10388 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10389 __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_InvalidThreadUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __pyx_L1_error)
10390 __Pyx_GOTREF(__pyx_t_2);
10391 __Pyx_INCREF(__pyx_t_2);
10392 __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError);
10393 __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError, __pyx_t_2);
10394 __Pyx_GIVEREF(__pyx_t_2);
10395 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10396 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10397
10398 /* "src/gevent/_abstract_linkable.py":23
10399 * from gevent.exceptions import InvalidSwitchError
10400 * from gevent.exceptions import InvalidThreadUseError
10401 * from gevent.timeout import Timeout # <<<<<<<<<<<<<<
10402 *
10403 * locals()['getcurrent'] = __import__('greenlet').getcurrent
10404 */
10405 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
10406 __Pyx_GOTREF(__pyx_t_1);
10407 __Pyx_INCREF(__pyx_n_s_Timeout);
10408 __Pyx_GIVEREF(__pyx_n_s_Timeout);
10409 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Timeout);
10410 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent_timeout, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
10411 __Pyx_GOTREF(__pyx_t_2);
10412 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10413 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_Timeout); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
10414 __Pyx_GOTREF(__pyx_t_1);
10415 __Pyx_INCREF(__pyx_t_1);
10416 __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout);
10417 __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout, __pyx_t_1);
10418 __Pyx_GIVEREF(__pyx_t_1);
10419 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10420 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10421
10422 /* "src/gevent/_abstract_linkable.py":25
10423 * from gevent.timeout import Timeout
10424 *
10425 * locals()['getcurrent'] = __import__('greenlet').getcurrent # <<<<<<<<<<<<<<
10426 * locals()['greenlet_init'] = lambda: None
10427 *
10428 */
10429 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
10430 __Pyx_GOTREF(__pyx_t_2);
10431 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 25, __pyx_L1_error)
10432 __Pyx_GOTREF(__pyx_t_1);
10433 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10434 __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
10435 __Pyx_GOTREF(__pyx_t_2);
10436 if (unlikely((PyDict_SetItem(__pyx_t_2, __pyx_n_s_getcurrent, __pyx_t_1) < 0))) __PYX_ERR(0, 25, __pyx_L1_error)
10437 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10438 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10439
10440 /* "src/gevent/_abstract_linkable.py":26
10441 *
10442 * locals()['getcurrent'] = __import__('greenlet').getcurrent
10443 * locals()['greenlet_init'] = lambda: None # <<<<<<<<<<<<<<
10444 *
10445 * __all__ = [
10446 */
10447 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 26, __pyx_L1_error)
10448 __Pyx_GOTREF(__pyx_t_1);
10449 __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
10450 __Pyx_GOTREF(__pyx_t_2);
10451 if (unlikely((PyDict_SetItem(__pyx_t_2, __pyx_n_s_greenlet_init, __pyx_t_1) < 0))) __PYX_ERR(0, 26, __pyx_L1_error)
10452 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10453 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10454
10455 /* "src/gevent/_abstract_linkable.py":28
10456 * locals()['greenlet_init'] = lambda: None
10457 *
10458 * __all__ = [ # <<<<<<<<<<<<<<
10459 * 'AbstractLinkable',
10460 * ]
10461 */
10462 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 28, __pyx_L1_error)
10463 __Pyx_GOTREF(__pyx_t_1);
10464 __Pyx_INCREF(__pyx_n_s_AbstractLinkable);
10465 __Pyx_GIVEREF(__pyx_n_s_AbstractLinkable);
10466 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_AbstractLinkable);
10467 if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
10468 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10469
10470 /* "src/gevent/_abstract_linkable.py":34
10471 * # Need the real get_ident. We're imported early enough during monkey-patching
10472 * # that we can be sure nothing is monkey patched yet.
10473 * _get_thread_ident = __import__(thread_mod_name).get_ident # <<<<<<<<<<<<<<
10474 * _allocate_thread_lock = __import__(thread_mod_name).allocate_lock
10475 *
10476 */
10477 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
10478 __Pyx_GOTREF(__pyx_t_1);
10479 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin___import__, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
10480 __Pyx_GOTREF(__pyx_t_2);
10481 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10482 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
10483 __Pyx_GOTREF(__pyx_t_1);
10484 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10485 __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident);
10486 __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident, __pyx_t_1);
10487 __Pyx_GIVEREF(__pyx_t_1);
10488 __pyx_t_1 = 0;
10489
10490 /* "src/gevent/_abstract_linkable.py":35
10491 * # that we can be sure nothing is monkey patched yet.
10492 * _get_thread_ident = __import__(thread_mod_name).get_ident
10493 * _allocate_thread_lock = __import__(thread_mod_name).allocate_lock # <<<<<<<<<<<<<<
10494 *
10495 * class _FakeNotifier(object):
10496 */
10497 __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_thread_mod_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
10498 __Pyx_GOTREF(__pyx_t_1);
10499 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin___import__, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 35, __pyx_L1_error)
10500 __Pyx_GOTREF(__pyx_t_2);
10501 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10502 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_allocate_lock); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
10503 __Pyx_GOTREF(__pyx_t_1);
10504 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10505 if (PyDict_SetItem(__pyx_d, __pyx_n_s_allocate_thread_lock, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
10506 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10507
10508 /* "src/gevent/_abstract_linkable.py":39
10509 * class _FakeNotifier(object):
10510 * __slots__ = (
10511 * 'pending', # <<<<<<<<<<<<<<
10512 * )
10513 *
10514 */
10515 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier->tp_dict, __pyx_n_s_slots, __pyx_tuple__6) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
10516 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier);
10517
10518 /* "src/gevent/_abstract_linkable.py":81
10519 *
10520 * __slots__ = (
10521 * 'hub', # <<<<<<<<<<<<<<
10522 * '_links',
10523 * '_notifier',
10524 */
10525 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_slots, __pyx_tuple__7) < 0) __PYX_ERR(0, 80, __pyx_L1_error)
10526 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10527
10528 /* "src/gevent/_abstract_linkable.py":129
10529 * self.hub = hub
10530 *
10531 * def linkcount(self): # <<<<<<<<<<<<<<
10532 * # For testing: how many objects are linked to this one?
10533 * return len(self._links)
10534 */
10535 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_linkcount, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
10536 __Pyx_GOTREF(__pyx_t_1);
10537 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_linkcount, __pyx_t_1) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
10538 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10539 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10540
10541 /* "src/gevent/_abstract_linkable.py":133
10542 * return len(self._links)
10543 *
10544 * def ready(self): # <<<<<<<<<<<<<<
10545 * # Instances must define this
10546 * raise NotImplementedError
10547 */
10548 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_ready, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
10549 __Pyx_GOTREF(__pyx_t_1);
10550 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_ready, __pyx_t_1) < 0) __PYX_ERR(0, 133, __pyx_L1_error)
10551 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10552 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10553
10554 /* "src/gevent/_abstract_linkable.py":137
10555 * raise NotImplementedError
10556 *
10557 * def rawlink(self, callback): # <<<<<<<<<<<<<<
10558 * """
10559 * Register a callback to call when this object is ready.
10560 */
10561 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_rawlink, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
10562 __Pyx_GOTREF(__pyx_t_1);
10563 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_rawlink, __pyx_t_1) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
10564 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10565 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10566
10567 /* "src/gevent/_abstract_linkable.py":150
10568 * self._check_and_notify()
10569 *
10570 * def unlink(self, callback): # <<<<<<<<<<<<<<
10571 * """Remove the callback set by :meth:`rawlink`"""
10572 * try:
10573 */
10574 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable_unlink, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
10575 __Pyx_GOTREF(__pyx_t_1);
10576 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_unlink, __pyx_t_1) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
10577 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10578 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10579
10580 /* "src/gevent/_abstract_linkable.py":287
10581 * return unswitched
10582 *
10583 * def _notify_links(self, arrived_while_waiting): # <<<<<<<<<<<<<<
10584 * # This method must hold the GIL, or be guarded with the lock that guards
10585 * # this object. Thus, while we are notifying objects, an object from another
10586 */
10587 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable__notify_links, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
10588 __Pyx_GOTREF(__pyx_t_1);
10589 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_notify_links, __pyx_t_1) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
10590 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10591 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10592
10593 /* "src/gevent/_abstract_linkable.py":462
10594 * )
10595 *
10596 * def _acquire_lock_for_switch_in(self): # <<<<<<<<<<<<<<
10597 * return
10598 *
10599 */
10600 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable__acquire_lock_f, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, ((PyObject *)__pyx_codeobj__19)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
10601 __Pyx_GOTREF(__pyx_t_1);
10602 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_acquire_lock_for_switch_in, __pyx_t_1) < 0) __PYX_ERR(0, 462, __pyx_L1_error)
10603 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10604 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10605
10606 /* "src/gevent/_abstract_linkable.py":465
10607 * return
10608 *
10609 * def _drop_lock_for_switch_out(self): # <<<<<<<<<<<<<<
10610 * return
10611 *
10612 */
10613 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable__drop_lock_for, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
10614 __Pyx_GOTREF(__pyx_t_1);
10615 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_drop_lock_for_switch_out, __pyx_t_1) < 0) __PYX_ERR(0, 465, __pyx_L1_error)
10616 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10617 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10618
10619 /* "src/gevent/_abstract_linkable.py":468
10620 * return
10621 *
10622 * def _wait_core(self, timeout, catch=Timeout): # <<<<<<<<<<<<<<
10623 * """
10624 * The core of the wait implementation, handling switching and
10625 */
10626 __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout);
10627 __pyx_k__3 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout;
10628 __Pyx_GIVEREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout);
10629
10630 /* "src/gevent/_abstract_linkable.py":524
10631 * return self._wait_return_value(True, gotit)
10632 *
10633 * def _at_fork_reinit(self): # <<<<<<<<<<<<<<
10634 * """
10635 * This method was added in Python 3.9 and is called by logging.py
10636 */
10637 __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_AbstractLinkable__at_fork_reinit, NULL, __pyx_n_s_gevent__gevent_c_abstract_linkab, __pyx_d, ((PyObject *)__pyx_codeobj__23)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 524, __pyx_L1_error)
10638 __Pyx_GOTREF(__pyx_t_1);
10639 if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable->tp_dict, __pyx_n_s_at_fork_reinit, __pyx_t_1) < 0) __PYX_ERR(0, 524, __pyx_L1_error)
10640 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10641 PyType_Modified(__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable);
10642
10643 /* "src/gevent/_abstract_linkable.py":542
10644 * greenlet_init() # pylint:disable=undefined-variable
10645 *
10646 * _init() # <<<<<<<<<<<<<<
10647 *
10648 *
10649 */
10650 __pyx_f_6gevent_27_gevent_c_abstract_linkable__init();
10651
10652 /* "src/gevent/_abstract_linkable.py":545
10653 *
10654 *
10655 * from gevent._util import import_c_accel # <<<<<<<<<<<<<<
10656 * import_c_accel(globals(), 'gevent.__abstract_linkable')
10657 */
10658 __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error)
10659 __Pyx_GOTREF(__pyx_t_1);
10660 __Pyx_INCREF(__pyx_n_s_import_c_accel);
10661 __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
10662 PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
10663 __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
10664 __Pyx_GOTREF(__pyx_t_2);
10665 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10666 __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error)
10667 __Pyx_GOTREF(__pyx_t_1);
10668 if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 545, __pyx_L1_error)
10669 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10670 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10671
10672 /* "src/gevent/_abstract_linkable.py":546
10673 *
10674 * from gevent._util import import_c_accel
10675 * import_c_accel(globals(), 'gevent.__abstract_linkable') # <<<<<<<<<<<<<<
10676 */
10677 __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
10678 __Pyx_GOTREF(__pyx_t_2);
10679 __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
10680 __Pyx_GOTREF(__pyx_t_1);
10681 __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 546, __pyx_L1_error)
10682 __Pyx_GOTREF(__pyx_t_3);
10683 __Pyx_GIVEREF(__pyx_t_1);
10684 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
10685 __Pyx_INCREF(__pyx_kp_s_gevent___abstract_linkable);
10686 __Pyx_GIVEREF(__pyx_kp_s_gevent___abstract_linkable);
10687 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_gevent___abstract_linkable);
10688 __pyx_t_1 = 0;
10689 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
10690 __Pyx_GOTREF(__pyx_t_1);
10691 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10692 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10693 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10694
10695 /* "src/gevent/_abstract_linkable.py":1
10696 * # -*- coding: utf-8 -*- # <<<<<<<<<<<<<<
10697 * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
10698 * """
10699 */
10700 __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
10701 __Pyx_GOTREF(__pyx_t_1);
10702 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
10703 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10704
10705 /* "gevent/_gevent_c_abstract_linkable.pxd":28
10706 * return PyGreenlet_GetCurrent()
10707 *
10708 * cdef inline void greenlet_init(): # <<<<<<<<<<<<<<
10709 * global _greenlet_imported
10710 * if not _greenlet_imported:
10711 */
10712
10713 /*--- Wrapped vars code ---*/
10714
10715 goto __pyx_L0;
10716 __pyx_L1_error:;
10717 __Pyx_XDECREF(__pyx_t_1);
10718 __Pyx_XDECREF(__pyx_t_2);
10719 __Pyx_XDECREF(__pyx_t_3);
10720 if (__pyx_m) {
10721 if (__pyx_d) {
10722 __Pyx_AddTraceback("init gevent._gevent_c_abstract_linkable", __pyx_clineno, __pyx_lineno, __pyx_filename);
10723 }
10724 #if !CYTHON_COMPILING_IN_LIMITED_API
10725 Py_CLEAR(__pyx_m);
10726 #endif
10727 } else if (!PyErr_Occurred()) {
10728 PyErr_SetString(PyExc_ImportError, "init gevent._gevent_c_abstract_linkable");
10729 }
10730 __pyx_L0:;
10731 __Pyx_RefNannyFinishContext();
10732 #if CYTHON_PEP489_MULTI_PHASE_INIT
10733 return (__pyx_m != NULL) ? 0 : -1;
10734 #elif PY_MAJOR_VERSION >= 3
10735 return __pyx_m;
10736 #else
10737 return;
10738 #endif
10739 }
10740 /* #### Code section: cleanup_globals ### */
10741 /* #### Code section: cleanup_module ### */
10742 /* #### Code section: main_method ### */
10743 /* #### Code section: utility_code_def ### */
10744
10745 /* --- Runtime support code --- */
10746 /* Refnanny */
10747 #if CYTHON_REFNANNY
__Pyx_RefNannyImportAPI(const char * modname)10748 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
10749 PyObject *m = NULL, *p = NULL;
10750 void *r = NULL;
10751 m = PyImport_ImportModule(modname);
10752 if (!m) goto end;
10753 p = PyObject_GetAttrString(m, "RefNannyAPI");
10754 if (!p) goto end;
10755 r = PyLong_AsVoidPtr(p);
10756 end:
10757 Py_XDECREF(p);
10758 Py_XDECREF(m);
10759 return (__Pyx_RefNannyAPIStruct *)r;
10760 }
10761 #endif
10762
10763 /* PyErrExceptionMatches */
10764 #if CYTHON_FAST_THREAD_STATE
__Pyx_PyErr_ExceptionMatchesTuple(PyObject * exc_type,PyObject * tuple)10765 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
10766 Py_ssize_t i, n;
10767 n = PyTuple_GET_SIZE(tuple);
10768 #if PY_MAJOR_VERSION >= 3
10769 for (i=0; i<n; i++) {
10770 if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
10771 }
10772 #endif
10773 for (i=0; i<n; i++) {
10774 if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
10775 }
10776 return 0;
10777 }
__Pyx_PyErr_ExceptionMatchesInState(PyThreadState * tstate,PyObject * err)10778 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
10779 PyObject *exc_type = tstate->curexc_type;
10780 if (exc_type == err) return 1;
10781 if (unlikely(!exc_type)) return 0;
10782 if (unlikely(PyTuple_Check(err)))
10783 return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
10784 return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
10785 }
10786 #endif
10787
10788 /* PyErrFetchRestore */
10789 #if CYTHON_FAST_THREAD_STATE
__Pyx_ErrRestoreInState(PyThreadState * tstate,PyObject * type,PyObject * value,PyObject * tb)10790 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
10791 PyObject *tmp_type, *tmp_value, *tmp_tb;
10792 tmp_type = tstate->curexc_type;
10793 tmp_value = tstate->curexc_value;
10794 tmp_tb = tstate->curexc_traceback;
10795 tstate->curexc_type = type;
10796 tstate->curexc_value = value;
10797 tstate->curexc_traceback = tb;
10798 Py_XDECREF(tmp_type);
10799 Py_XDECREF(tmp_value);
10800 Py_XDECREF(tmp_tb);
10801 }
__Pyx_ErrFetchInState(PyThreadState * tstate,PyObject ** type,PyObject ** value,PyObject ** tb)10802 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
10803 *type = tstate->curexc_type;
10804 *value = tstate->curexc_value;
10805 *tb = tstate->curexc_traceback;
10806 tstate->curexc_type = 0;
10807 tstate->curexc_value = 0;
10808 tstate->curexc_traceback = 0;
10809 }
10810 #endif
10811
10812 /* PyObjectGetAttrStr */
10813 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_GetAttrStr(PyObject * obj,PyObject * attr_name)10814 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
10815 PyTypeObject* tp = Py_TYPE(obj);
10816 if (likely(tp->tp_getattro))
10817 return tp->tp_getattro(obj, attr_name);
10818 #if PY_MAJOR_VERSION < 3
10819 if (likely(tp->tp_getattr))
10820 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
10821 #endif
10822 return PyObject_GetAttr(obj, attr_name);
10823 }
10824 #endif
10825
10826 /* PyObjectGetAttrStrNoError */
__Pyx_PyObject_GetAttrStr_ClearAttributeError(void)10827 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
10828 __Pyx_PyThreadState_declare
10829 __Pyx_PyThreadState_assign
10830 if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
10831 __Pyx_PyErr_Clear();
10832 }
__Pyx_PyObject_GetAttrStrNoError(PyObject * obj,PyObject * attr_name)10833 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
10834 PyObject *result;
10835 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
10836 PyTypeObject* tp = Py_TYPE(obj);
10837 if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
10838 return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
10839 }
10840 #endif
10841 result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
10842 if (unlikely(!result)) {
10843 __Pyx_PyObject_GetAttrStr_ClearAttributeError();
10844 }
10845 return result;
10846 }
10847
10848 /* GetBuiltinName */
__Pyx_GetBuiltinName(PyObject * name)10849 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
10850 PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
10851 if (unlikely(!result) && !PyErr_Occurred()) {
10852 PyErr_Format(PyExc_NameError,
10853 #if PY_MAJOR_VERSION >= 3
10854 "name '%U' is not defined", name);
10855 #else
10856 "name '%.200s' is not defined", PyString_AS_STRING(name));
10857 #endif
10858 }
10859 return result;
10860 }
10861
10862 /* TupleAndListFromArray */
10863 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_copy_object_array(PyObject * const * CYTHON_RESTRICT src,PyObject ** CYTHON_RESTRICT dest,Py_ssize_t length)10864 static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
10865 PyObject *v;
10866 Py_ssize_t i;
10867 for (i = 0; i < length; i++) {
10868 v = dest[i] = src[i];
10869 Py_INCREF(v);
10870 }
10871 }
10872 static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject * const * src,Py_ssize_t n)10873 __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
10874 {
10875 PyObject *res;
10876 if (n <= 0) {
10877 Py_INCREF(__pyx_empty_tuple);
10878 return __pyx_empty_tuple;
10879 }
10880 res = PyTuple_New(n);
10881 if (unlikely(res == NULL)) return NULL;
10882 __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
10883 return res;
10884 }
10885 static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject * const * src,Py_ssize_t n)10886 __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
10887 {
10888 PyObject *res;
10889 if (n <= 0) {
10890 return PyList_New(0);
10891 }
10892 res = PyList_New(n);
10893 if (unlikely(res == NULL)) return NULL;
10894 __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
10895 return res;
10896 }
10897 #endif
10898
10899 /* BytesEquals */
10900 #include "src/gevent/_generated_include/BytesEquals_impl_e6e00372871fe30fd34336b41036f3e015446a55.h"
10901 /* UnicodeEquals */
10902 #include "src/gevent/_generated_include/UnicodeEquals_impl_59ff4e630bc7eaefcae1e033587e8b97b0bf7eb8.h"
10903 /* fastcall */
10904 #if CYTHON_METH_FASTCALL
__Pyx_GetKwValue_FASTCALL(PyObject * kwnames,PyObject * const * kwvalues,PyObject * s)10905 static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
10906 {
10907 Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
10908 for (i = 0; i < n; i++)
10909 {
10910 if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
10911 }
10912 for (i = 0; i < n; i++)
10913 {
10914 int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
10915 if (unlikely(eq != 0)) {
10916 if (unlikely(eq < 0)) return NULL; // error
10917 return kwvalues[i];
10918 }
10919 }
10920 return NULL; // not found (no exception set)
10921 }
10922 #endif
10923
10924 /* RaiseArgTupleInvalid */
__Pyx_RaiseArgtupleInvalid(const char * func_name,int exact,Py_ssize_t num_min,Py_ssize_t num_max,Py_ssize_t num_found)10925 static void __Pyx_RaiseArgtupleInvalid(
10926 const char* func_name,
10927 int exact,
10928 Py_ssize_t num_min,
10929 Py_ssize_t num_max,
10930 Py_ssize_t num_found)
10931 {
10932 Py_ssize_t num_expected;
10933 const char *more_or_less;
10934 if (num_found < num_min) {
10935 num_expected = num_min;
10936 more_or_less = "at least";
10937 } else {
10938 num_expected = num_max;
10939 more_or_less = "at most";
10940 }
10941 if (exact) {
10942 more_or_less = "exactly";
10943 }
10944 PyErr_Format(PyExc_TypeError,
10945 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
10946 func_name, more_or_less, num_expected,
10947 (num_expected == 1) ? "" : "s", num_found);
10948 }
10949
10950 /* KeywordStringCheck */
10951 #include "src/gevent/_generated_include/KeywordStringCheck_impl_252e62d37981bae38b6f1be1e6a865eab6859afb.h"
10952 /* Import */
__Pyx_Import(PyObject * name,PyObject * from_list,int level)10953 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
10954 PyObject *module = 0;
10955 PyObject *empty_dict = 0;
10956 PyObject *empty_list = 0;
10957 #if PY_MAJOR_VERSION < 3
10958 PyObject *py_import;
10959 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
10960 if (unlikely(!py_import))
10961 goto bad;
10962 if (!from_list) {
10963 empty_list = PyList_New(0);
10964 if (unlikely(!empty_list))
10965 goto bad;
10966 from_list = empty_list;
10967 }
10968 #endif
10969 empty_dict = PyDict_New();
10970 if (unlikely(!empty_dict))
10971 goto bad;
10972 {
10973 #if PY_MAJOR_VERSION >= 3
10974 if (level == -1) {
10975 if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
10976 #if CYTHON_COMPILING_IN_LIMITED_API
10977 module = PyImport_ImportModuleLevelObject(
10978 name, empty_dict, empty_dict, from_list, 1);
10979 #else
10980 module = PyImport_ImportModuleLevelObject(
10981 name, __pyx_d, empty_dict, from_list, 1);
10982 #endif
10983 if (unlikely(!module)) {
10984 if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
10985 goto bad;
10986 PyErr_Clear();
10987 }
10988 }
10989 level = 0;
10990 }
10991 #endif
10992 if (!module) {
10993 #if PY_MAJOR_VERSION < 3
10994 PyObject *py_level = PyInt_FromLong(level);
10995 if (unlikely(!py_level))
10996 goto bad;
10997 module = PyObject_CallFunctionObjArgs(py_import,
10998 name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
10999 Py_DECREF(py_level);
11000 #else
11001 #if CYTHON_COMPILING_IN_LIMITED_API
11002 module = PyImport_ImportModuleLevelObject(
11003 name, empty_dict, empty_dict, from_list, level);
11004 #else
11005 module = PyImport_ImportModuleLevelObject(
11006 name, __pyx_d, empty_dict, from_list, level);
11007 #endif
11008 #endif
11009 }
11010 }
11011 bad:
11012 Py_XDECREF(empty_dict);
11013 Py_XDECREF(empty_list);
11014 #if PY_MAJOR_VERSION < 3
11015 Py_XDECREF(py_import);
11016 #endif
11017 return module;
11018 }
11019
11020 /* ImportFrom */
__Pyx_ImportFrom(PyObject * module,PyObject * name)11021 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
11022 PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
11023 if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
11024 PyErr_Format(PyExc_ImportError,
11025 #if PY_MAJOR_VERSION < 3
11026 "cannot import name %.230s", PyString_AS_STRING(name));
11027 #else
11028 "cannot import name %S", name);
11029 #endif
11030 }
11031 return value;
11032 }
11033
11034 /* PyFunctionFastCall */
11035 #include "src/gevent/_generated_include/PyFunctionFastCall_impl_23aa93c516a67d08413dd8d375c3fa410709cf67.h"
11036 /* PyObjectCall */
11037 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_Call(PyObject * func,PyObject * arg,PyObject * kw)11038 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
11039 PyObject *result;
11040 ternaryfunc call = Py_TYPE(func)->tp_call;
11041 if (unlikely(!call))
11042 return PyObject_Call(func, arg, kw);
11043 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
11044 return NULL;
11045 result = (*call)(func, arg, kw);
11046 Py_LeaveRecursiveCall();
11047 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
11048 PyErr_SetString(
11049 PyExc_SystemError,
11050 "NULL result without error in PyObject_Call");
11051 }
11052 return result;
11053 }
11054 #endif
11055
11056 /* PyObjectCallMethO */
11057 #if CYTHON_COMPILING_IN_CPYTHON
__Pyx_PyObject_CallMethO(PyObject * func,PyObject * arg)11058 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
11059 PyObject *self, *result;
11060 PyCFunction cfunc;
11061 cfunc = PyCFunction_GET_FUNCTION(func);
11062 self = PyCFunction_GET_SELF(func);
11063 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
11064 return NULL;
11065 result = cfunc(self, arg);
11066 Py_LeaveRecursiveCall();
11067 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
11068 PyErr_SetString(
11069 PyExc_SystemError,
11070 "NULL result without error in PyObject_Call");
11071 }
11072 return result;
11073 }
11074 #endif
11075
11076 /* PyObjectFastCall */
11077 #include "src/gevent/_generated_include/PyObjectFastCall_impl_f6ad1ccc7f137e4637d2bbaa621a6295ceb3138b.h"
11078 /* RaiseDoubleKeywords */
__Pyx_RaiseDoubleKeywordsError(const char * func_name,PyObject * kw_name)11079 static void __Pyx_RaiseDoubleKeywordsError(
11080 const char* func_name,
11081 PyObject* kw_name)
11082 {
11083 PyErr_Format(PyExc_TypeError,
11084 #if PY_MAJOR_VERSION >= 3
11085 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
11086 #else
11087 "%s() got multiple values for keyword argument '%s'", func_name,
11088 PyString_AsString(kw_name));
11089 #endif
11090 }
11091
11092 /* ParseKeywords */
11093 #include "src/gevent/_generated_include/ParseKeywords_impl_416cf95624aff4d68f7f7d25051933788f0cbf29.h"
11094 /* ExtTypeTest */
__Pyx_TypeTest(PyObject * obj,PyTypeObject * type)11095 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
11096 __Pyx_TypeName obj_type_name;
11097 __Pyx_TypeName type_name;
11098 if (unlikely(!type)) {
11099 PyErr_SetString(PyExc_SystemError, "Missing type object");
11100 return 0;
11101 }
11102 if (likely(__Pyx_TypeCheck(obj, type)))
11103 return 1;
11104 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
11105 type_name = __Pyx_PyType_GetName(type);
11106 PyErr_Format(PyExc_TypeError,
11107 "Cannot convert " __Pyx_FMT_TYPENAME " to " __Pyx_FMT_TYPENAME,
11108 obj_type_name, type_name);
11109 __Pyx_DECREF_TypeName(obj_type_name);
11110 __Pyx_DECREF_TypeName(type_name);
11111 return 0;
11112 }
11113
11114 /* PyDictVersioning */
11115 #include "src/gevent/_generated_include/PyDictVersioning_impl_5d2c788aa0ccc0a3db24046a954a7d21f6726dad.h"
11116 /* RaiseException */
11117 #include "src/gevent/_generated_include/RaiseException_impl_3d83931eda35d9cd87499155215b87def94a2b0f.h"
11118 /* WriteUnraisableException */
11119 #include "src/gevent/_generated_include/WriteUnraisableException_impl_1725cd7412be95c6bc307f608caeec0e77209ff2.h"
11120 /* PyObjectCallOneArg */
__Pyx_PyObject_CallOneArg(PyObject * func,PyObject * arg)11121 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
11122 PyObject *args[2] = {NULL, arg};
11123 return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
11124 }
11125
11126 /* GetTopmostException */
11127 #if CYTHON_USE_EXC_INFO_STACK
11128 static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState * tstate)11129 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
11130 {
11131 _PyErr_StackItem *exc_info = tstate->exc_info;
11132 while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
11133 exc_info->previous_item != NULL)
11134 {
11135 exc_info = exc_info->previous_item;
11136 }
11137 return exc_info;
11138 }
11139 #endif
11140
11141 /* SaveResetException */
11142 #include "src/gevent/_generated_include/SaveResetException_impl_aedbf2748eb5b27c9f4cebc299037ac835fcf451.h"
11143 /* GetModuleGlobalName */
11144 #include "src/gevent/_generated_include/GetModuleGlobalName_impl_b42bab931ba3745b018435df793919dd990408d3.h"
11145 /* GetException */
11146 #include "src/gevent/_generated_include/GetException_impl_c515116ac859b567f8675f64eac308e9ac5196e2.h"
11147 /* SwapException */
11148 #include "src/gevent/_generated_include/SwapException_impl_59bda2db869a22e8e71fecade8d489392900a947.h"
11149 /* GetItemInt */
11150 #include "src/gevent/_generated_include/GetItemInt_impl_7e4cf5b23081c67c512b5769aad99623e914619a.h"
11151 /* PyObjectCall2Args */
__Pyx_PyObject_Call2Args(PyObject * function,PyObject * arg1,PyObject * arg2)11152 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
11153 PyObject *args[3] = {NULL, arg1, arg2};
11154 return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
11155 }
11156
11157 /* PyObjectGetMethod */
11158 #include "src/gevent/_generated_include/PyObjectGetMethod_impl_f81ea88f63d5a33ae3a4a01c93a48a3e30be5db1.h"
11159 /* PyObjectCallMethod1 */
__Pyx__PyObject_CallMethod1(PyObject * method,PyObject * arg)11160 static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
11161 PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
11162 Py_DECREF(method);
11163 return result;
11164 }
__Pyx_PyObject_CallMethod1(PyObject * obj,PyObject * method_name,PyObject * arg)11165 static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
11166 PyObject *method = NULL, *result;
11167 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
11168 if (likely(is_method)) {
11169 result = __Pyx_PyObject_Call2Args(method, obj, arg);
11170 Py_DECREF(method);
11171 return result;
11172 }
11173 if (unlikely(!method)) return NULL;
11174 return __Pyx__PyObject_CallMethod1(method, arg);
11175 }
11176
11177 /* pop_index */
__Pyx__PyObject_PopNewIndex(PyObject * L,PyObject * py_ix)11178 static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
11179 PyObject *r;
11180 if (unlikely(!py_ix)) return NULL;
11181 r = __Pyx__PyObject_PopIndex(L, py_ix);
11182 Py_DECREF(py_ix);
11183 return r;
11184 }
__Pyx__PyObject_PopIndex(PyObject * L,PyObject * py_ix)11185 static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
11186 return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix);
11187 }
11188 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
__Pyx__PyList_PopIndex(PyObject * L,PyObject * py_ix,Py_ssize_t ix)11189 static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
11190 Py_ssize_t size = PyList_GET_SIZE(L);
11191 if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
11192 Py_ssize_t cix = ix;
11193 if (cix < 0) {
11194 cix += size;
11195 }
11196 if (likely(__Pyx_is_valid_index(cix, size))) {
11197 PyObject* v = PyList_GET_ITEM(L, cix);
11198 __Pyx_SET_SIZE(L, Py_SIZE(L) - 1);
11199 size -= 1;
11200 memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
11201 return v;
11202 }
11203 }
11204 if (py_ix == Py_None) {
11205 return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix));
11206 } else {
11207 return __Pyx__PyObject_PopIndex(L, py_ix);
11208 }
11209 }
11210 #endif
11211
11212 /* pyfrozenset_new */
__Pyx_PyFrozenSet_New(PyObject * it)11213 static CYTHON_INLINE PyObject* __Pyx_PyFrozenSet_New(PyObject* it) {
11214 if (it) {
11215 PyObject* result;
11216 #if CYTHON_COMPILING_IN_PYPY
11217 PyObject* args;
11218 args = PyTuple_Pack(1, it);
11219 if (unlikely(!args))
11220 return NULL;
11221 result = PyObject_Call((PyObject*)&PyFrozenSet_Type, args, NULL);
11222 Py_DECREF(args);
11223 return result;
11224 #else
11225 if (PyFrozenSet_CheckExact(it)) {
11226 Py_INCREF(it);
11227 return it;
11228 }
11229 result = PyFrozenSet_New(it);
11230 if (unlikely(!result))
11231 return NULL;
11232 if ((PY_VERSION_HEX >= 0x031000A1) || likely(PySet_GET_SIZE(result)))
11233 return result;
11234 Py_DECREF(result);
11235 #endif
11236 }
11237 #if CYTHON_USE_TYPE_SLOTS
11238 return PyFrozenSet_Type.tp_new(&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
11239 #else
11240 return PyObject_Call((PyObject*)&PyFrozenSet_Type, __pyx_empty_tuple, NULL);
11241 #endif
11242 }
11243
11244 /* PySetContains */
__Pyx_PySet_ContainsUnhashable(PyObject * set,PyObject * key)11245 static int __Pyx_PySet_ContainsUnhashable(PyObject *set, PyObject *key) {
11246 int result = -1;
11247 if (PySet_Check(key) && PyErr_ExceptionMatches(PyExc_TypeError)) {
11248 PyObject *tmpkey;
11249 PyErr_Clear();
11250 tmpkey = __Pyx_PyFrozenSet_New(key);
11251 if (tmpkey != NULL) {
11252 result = PySet_Contains(set, tmpkey);
11253 Py_DECREF(tmpkey);
11254 }
11255 }
11256 return result;
11257 }
__Pyx_PySet_ContainsTF(PyObject * key,PyObject * set,int eq)11258 static CYTHON_INLINE int __Pyx_PySet_ContainsTF(PyObject* key, PyObject* set, int eq) {
11259 int result = PySet_Contains(set, key);
11260 if (unlikely(result < 0)) {
11261 result = __Pyx_PySet_ContainsUnhashable(set, key);
11262 }
11263 return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
11264 }
11265
11266 /* FastTypeChecks */
11267 #include "src/gevent/_generated_include/FastTypeChecks_impl_eb0c244bcedc6e568c1b81c159a26dc4457239fd.h"
11268 /* ImportDottedModule */
11269 #if PY_MAJOR_VERSION >= 3
__Pyx__ImportDottedModule_Error(PyObject * name,PyObject * parts_tuple,Py_ssize_t count)11270 static PyObject *__Pyx__ImportDottedModule_Error(PyObject *name, PyObject *parts_tuple, Py_ssize_t count) {
11271 PyObject *partial_name = NULL, *slice = NULL, *sep = NULL;
11272 if (unlikely(PyErr_Occurred())) {
11273 PyErr_Clear();
11274 }
11275 if (likely(PyTuple_GET_SIZE(parts_tuple) == count)) {
11276 partial_name = name;
11277 } else {
11278 slice = PySequence_GetSlice(parts_tuple, 0, count);
11279 if (unlikely(!slice))
11280 goto bad;
11281 sep = PyUnicode_FromStringAndSize(".", 1);
11282 if (unlikely(!sep))
11283 goto bad;
11284 partial_name = PyUnicode_Join(sep, slice);
11285 }
11286 PyErr_Format(
11287 #if PY_MAJOR_VERSION < 3
11288 PyExc_ImportError,
11289 "No module named '%s'", PyString_AS_STRING(partial_name));
11290 #else
11291 #if PY_VERSION_HEX >= 0x030600B1
11292 PyExc_ModuleNotFoundError,
11293 #else
11294 PyExc_ImportError,
11295 #endif
11296 "No module named '%U'", partial_name);
11297 #endif
11298 bad:
11299 Py_XDECREF(sep);
11300 Py_XDECREF(slice);
11301 Py_XDECREF(partial_name);
11302 return NULL;
11303 }
11304 #endif
11305 #if PY_MAJOR_VERSION >= 3
__Pyx__ImportDottedModule_Lookup(PyObject * name)11306 static PyObject *__Pyx__ImportDottedModule_Lookup(PyObject *name) {
11307 PyObject *imported_module;
11308 #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
11309 PyObject *modules = PyImport_GetModuleDict();
11310 if (unlikely(!modules))
11311 return NULL;
11312 imported_module = __Pyx_PyDict_GetItemStr(modules, name);
11313 Py_XINCREF(imported_module);
11314 #else
11315 imported_module = PyImport_GetModule(name);
11316 #endif
11317 return imported_module;
11318 }
11319 #endif
__Pyx__ImportDottedModule(PyObject * name,PyObject * parts_tuple)11320 static PyObject *__Pyx__ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
11321 #if PY_MAJOR_VERSION < 3
11322 PyObject *module, *from_list, *star = __pyx_n_s_;
11323 CYTHON_UNUSED_VAR(parts_tuple);
11324 from_list = PyList_New(1);
11325 if (unlikely(!from_list))
11326 return NULL;
11327 Py_INCREF(star);
11328 PyList_SET_ITEM(from_list, 0, star);
11329 module = __Pyx_Import(name, from_list, 0);
11330 Py_DECREF(from_list);
11331 return module;
11332 #else
11333 Py_ssize_t i, nparts;
11334 PyObject *imported_module;
11335 PyObject *module = __Pyx_Import(name, NULL, 0);
11336 if (!parts_tuple || unlikely(!module))
11337 return module;
11338 imported_module = __Pyx__ImportDottedModule_Lookup(name);
11339 if (likely(imported_module)) {
11340 Py_DECREF(module);
11341 return imported_module;
11342 }
11343 PyErr_Clear();
11344 nparts = PyTuple_GET_SIZE(parts_tuple);
11345 for (i=1; i < nparts && module; i++) {
11346 PyObject *part, *submodule;
11347 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11348 part = PyTuple_GET_ITEM(parts_tuple, i);
11349 #else
11350 part = PySequence_ITEM(parts_tuple, i);
11351 #endif
11352 submodule = __Pyx_PyObject_GetAttrStrNoError(module, part);
11353 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
11354 Py_DECREF(part);
11355 #endif
11356 Py_DECREF(module);
11357 module = submodule;
11358 }
11359 if (likely(module))
11360 return module;
11361 return __Pyx__ImportDottedModule_Error(name, parts_tuple, i);
11362 #endif
11363 }
__Pyx_ImportDottedModule(PyObject * name,PyObject * parts_tuple)11364 static PyObject *__Pyx_ImportDottedModule(PyObject *name, PyObject *parts_tuple) {
11365 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030400B1
11366 PyObject *module = __Pyx__ImportDottedModule_Lookup(name);
11367 if (likely(module)) {
11368 PyObject *spec = __Pyx_PyObject_GetAttrStrNoError(module, __pyx_n_s_spec);
11369 if (likely(spec)) {
11370 PyObject *unsafe = __Pyx_PyObject_GetAttrStrNoError(spec, __pyx_n_s_initializing);
11371 if (likely(!unsafe || !__Pyx_PyObject_IsTrue(unsafe))) {
11372 Py_DECREF(spec);
11373 spec = NULL;
11374 }
11375 Py_XDECREF(unsafe);
11376 }
11377 if (likely(!spec)) {
11378 PyErr_Clear();
11379 return module;
11380 }
11381 Py_DECREF(spec);
11382 Py_DECREF(module);
11383 } else if (PyErr_Occurred()) {
11384 PyErr_Clear();
11385 }
11386 #endif
11387 return __Pyx__ImportDottedModule(name, parts_tuple);
11388 }
11389
11390 /* ArgTypeTest */
__Pyx__ArgTypeTest(PyObject * obj,PyTypeObject * type,const char * name,int exact)11391 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
11392 {
11393 __Pyx_TypeName type_name;
11394 __Pyx_TypeName obj_type_name;
11395 if (unlikely(!type)) {
11396 PyErr_SetString(PyExc_SystemError, "Missing type object");
11397 return 0;
11398 }
11399 else if (exact) {
11400 #if PY_MAJOR_VERSION == 2
11401 if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
11402 #endif
11403 }
11404 else {
11405 if (likely(__Pyx_TypeCheck(obj, type))) return 1;
11406 }
11407 type_name = __Pyx_PyType_GetName(type);
11408 obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
11409 PyErr_Format(PyExc_TypeError,
11410 "Argument '%.200s' has incorrect type (expected " __Pyx_FMT_TYPENAME
11411 ", got " __Pyx_FMT_TYPENAME ")", name, type_name, obj_type_name);
11412 __Pyx_DECREF_TypeName(type_name);
11413 __Pyx_DECREF_TypeName(obj_type_name);
11414 return 0;
11415 }
11416
11417 /* GetAttr3 */
__Pyx_GetAttr3Default(PyObject * d)11418 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
11419 __Pyx_PyThreadState_declare
11420 __Pyx_PyThreadState_assign
11421 if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
11422 return NULL;
11423 __Pyx_PyErr_Clear();
11424 Py_INCREF(d);
11425 return d;
11426 }
__Pyx_GetAttr3(PyObject * o,PyObject * n,PyObject * d)11427 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
11428 PyObject *r;
11429 #if CYTHON_USE_TYPE_SLOTS
11430 if (likely(PyString_Check(n))) {
11431 r = __Pyx_PyObject_GetAttrStrNoError(o, n);
11432 if (unlikely(!r) && likely(!PyErr_Occurred())) {
11433 r = __Pyx_NewRef(d);
11434 }
11435 return r;
11436 }
11437 #endif
11438 r = PyObject_GetAttr(o, n);
11439 return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
11440 }
11441
11442 /* GetAttr */
__Pyx_GetAttr(PyObject * o,PyObject * n)11443 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
11444 #if CYTHON_USE_TYPE_SLOTS
11445 #if PY_MAJOR_VERSION >= 3
11446 if (likely(PyUnicode_Check(n)))
11447 #else
11448 if (likely(PyString_Check(n)))
11449 #endif
11450 return __Pyx_PyObject_GetAttrStr(o, n);
11451 #endif
11452 return PyObject_GetAttr(o, n);
11453 }
11454
11455 /* HasAttr */
__Pyx_HasAttr(PyObject * o,PyObject * n)11456 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
11457 PyObject *r;
11458 if (unlikely(!__Pyx_PyBaseString_Check(n))) {
11459 PyErr_SetString(PyExc_TypeError,
11460 "hasattr(): attribute name must be string");
11461 return -1;
11462 }
11463 r = __Pyx_GetAttr(o, n);
11464 if (!r) {
11465 PyErr_Clear();
11466 return 0;
11467 } else {
11468 Py_DECREF(r);
11469 return 1;
11470 }
11471 }
11472
11473 /* UnpackUnboundCMethod */
__Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction * target)11474 static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
11475 PyObject *method;
11476 method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
11477 if (unlikely(!method))
11478 return -1;
11479 target->method = method;
11480 #if CYTHON_COMPILING_IN_CPYTHON
11481 #if PY_MAJOR_VERSION >= 3
11482 if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
11483 #endif
11484 {
11485 PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
11486 target->func = descr->d_method->ml_meth;
11487 target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
11488 }
11489 #endif
11490 return 0;
11491 }
11492
11493 /* CallUnboundCMethod1 */
11494 #include "src/gevent/_generated_include/CallUnboundCMethod1_impl_fab7d7ac824a4c97b4ee62d9db89dbe08674c5d1.h"
11495 /* CallUnboundCMethod2 */
11496 #include "src/gevent/_generated_include/CallUnboundCMethod2_impl_fbf20154a134f91c0ea75485c517b4d72ee7cc48.h"
11497 /* dict_getitem_default */
__Pyx_PyDict_GetItemDefault(PyObject * d,PyObject * key,PyObject * default_value)11498 static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
11499 PyObject* value;
11500 #if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
11501 value = PyDict_GetItemWithError(d, key);
11502 if (unlikely(!value)) {
11503 if (unlikely(PyErr_Occurred()))
11504 return NULL;
11505 value = default_value;
11506 }
11507 Py_INCREF(value);
11508 if ((1));
11509 #else
11510 if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
11511 value = PyDict_GetItem(d, key);
11512 if (unlikely(!value)) {
11513 value = default_value;
11514 }
11515 Py_INCREF(value);
11516 }
11517 #endif
11518 else {
11519 if (default_value == Py_None)
11520 value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
11521 else
11522 value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
11523 }
11524 return value;
11525 }
11526
11527 /* append */
__Pyx_PyObject_Append(PyObject * L,PyObject * x)11528 static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
11529 if (likely(PyList_CheckExact(L))) {
11530 if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
11531 } else {
11532 PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
11533 if (unlikely(!retval))
11534 return -1;
11535 Py_DECREF(retval);
11536 }
11537 return 0;
11538 }
11539
11540 /* PyObjectLookupSpecial */
11541 #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
__Pyx__PyObject_LookupSpecial(PyObject * obj,PyObject * attr_name,int with_error)11542 static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
11543 PyObject *res;
11544 PyTypeObject *tp = Py_TYPE(obj);
11545 #if PY_MAJOR_VERSION < 3
11546 if (unlikely(PyInstance_Check(obj)))
11547 return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
11548 #endif
11549 res = _PyType_Lookup(tp, attr_name);
11550 if (likely(res)) {
11551 descrgetfunc f = Py_TYPE(res)->tp_descr_get;
11552 if (!f) {
11553 Py_INCREF(res);
11554 } else {
11555 res = f(res, obj, (PyObject *)tp);
11556 }
11557 } else if (with_error) {
11558 PyErr_SetObject(PyExc_AttributeError, attr_name);
11559 }
11560 return res;
11561 }
11562 #endif
11563
11564 /* TypeImport */
11565 #include "src/gevent/_generated_include/TypeImport_impl_2a4fd5b6753492bf016ba4bb4b7299ed55d65264.h"
11566 /* FixUpExtensionType */
11567 #include "src/gevent/_generated_include/FixUpExtensionType_impl_e09b5d95f7f6bf74eadfc9d9daa7398d83997a66.h"
11568 /* PyObjectCallNoArg */
__Pyx_PyObject_CallNoArg(PyObject * func)11569 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
11570 PyObject *arg = NULL;
11571 return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
11572 }
11573
11574 /* PyObjectCallMethod0 */
__Pyx_PyObject_CallMethod0(PyObject * obj,PyObject * method_name)11575 static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
11576 PyObject *method = NULL, *result = NULL;
11577 int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
11578 if (likely(is_method)) {
11579 result = __Pyx_PyObject_CallOneArg(method, obj);
11580 Py_DECREF(method);
11581 return result;
11582 }
11583 if (unlikely(!method)) goto bad;
11584 result = __Pyx_PyObject_CallNoArg(method);
11585 Py_DECREF(method);
11586 bad:
11587 return result;
11588 }
11589
11590 /* ValidateBasesTuple */
11591 #include "src/gevent/_generated_include/ValidateBasesTuple_impl_40f2fe614c5d84eada7de9c48d621c087cfc83fa.h"
11592 /* PyType_Ready */
__Pyx_PyType_Ready(PyTypeObject * t)11593 static int __Pyx_PyType_Ready(PyTypeObject *t) {
11594 #if CYTHON_USE_TYPE_SPECS || !(CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API) || defined(PYSTON_MAJOR_VERSION)
11595 (void)__Pyx_PyObject_CallMethod0;
11596 #if CYTHON_USE_TYPE_SPECS
11597 (void)__Pyx_validate_bases_tuple;
11598 #endif
11599 return PyType_Ready(t);
11600 #else
11601 int r;
11602 if (t->tp_bases && unlikely(__Pyx_validate_bases_tuple(t->tp_name, t->tp_dictoffset, t->tp_bases) == -1))
11603 return -1;
11604 #if PY_VERSION_HEX >= 0x03050000
11605 {
11606 int gc_was_enabled;
11607 #if PY_VERSION_HEX >= 0x030A00b1
11608 gc_was_enabled = PyGC_Disable();
11609 (void)__Pyx_PyObject_CallMethod0;
11610 #else
11611 PyObject *ret, *py_status;
11612 PyObject *gc = NULL;
11613 #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
11614 gc = PyImport_GetModule(__pyx_kp_u_gc);
11615 #endif
11616 if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
11617 if (unlikely(!gc)) return -1;
11618 py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
11619 if (unlikely(!py_status)) {
11620 Py_DECREF(gc);
11621 return -1;
11622 }
11623 gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
11624 Py_DECREF(py_status);
11625 if (gc_was_enabled > 0) {
11626 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
11627 if (unlikely(!ret)) {
11628 Py_DECREF(gc);
11629 return -1;
11630 }
11631 Py_DECREF(ret);
11632 } else if (unlikely(gc_was_enabled == -1)) {
11633 Py_DECREF(gc);
11634 return -1;
11635 }
11636 #endif
11637 t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
11638 #else
11639 (void)__Pyx_PyObject_CallMethod0;
11640 #endif
11641 r = PyType_Ready(t);
11642 #if PY_VERSION_HEX >= 0x03050000
11643 t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
11644 #if PY_VERSION_HEX >= 0x030A00b1
11645 if (gc_was_enabled)
11646 PyGC_Enable();
11647 #else
11648 if (gc_was_enabled) {
11649 PyObject *tp, *v, *tb;
11650 PyErr_Fetch(&tp, &v, &tb);
11651 ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
11652 if (likely(ret || r == -1)) {
11653 Py_XDECREF(ret);
11654 PyErr_Restore(tp, v, tb);
11655 } else {
11656 Py_XDECREF(tp);
11657 Py_XDECREF(v);
11658 Py_XDECREF(tb);
11659 r = -1;
11660 }
11661 }
11662 Py_DECREF(gc);
11663 #endif
11664 }
11665 #endif
11666 return r;
11667 #endif
11668 }
11669
11670 /* PyObject_GenericGetAttrNoDict */
11671 #include "src/gevent/_generated_include/PyObject_GenericGetAttrNoDict_impl_d33db3ae867714150b16aa58dd6936ad5a7d632f.h"
11672 /* PyObject_GenericGetAttr */
11673 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
__Pyx_PyObject_GenericGetAttr(PyObject * obj,PyObject * attr_name)11674 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
11675 if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
11676 return PyObject_GenericGetAttr(obj, attr_name);
11677 }
11678 return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
11679 }
11680 #endif
11681
11682 /* SetVTable */
__Pyx_SetVtable(PyTypeObject * type,void * vtable)11683 static int __Pyx_SetVtable(PyTypeObject *type, void *vtable) {
11684 PyObject *ob = PyCapsule_New(vtable, 0, 0);
11685 if (unlikely(!ob))
11686 goto bad;
11687 #if CYTHON_COMPILING_IN_LIMITED_API
11688 if (unlikely(PyObject_SetAttr((PyObject *) type, __pyx_n_s_pyx_vtable, ob) < 0))
11689 #else
11690 if (unlikely(PyDict_SetItem(type->tp_dict, __pyx_n_s_pyx_vtable, ob) < 0))
11691 #endif
11692 goto bad;
11693 Py_DECREF(ob);
11694 return 0;
11695 bad:
11696 Py_XDECREF(ob);
11697 return -1;
11698 }
11699
11700 /* GetVTable */
__Pyx_GetVtable(PyTypeObject * type)11701 static void* __Pyx_GetVtable(PyTypeObject *type) {
11702 void* ptr;
11703 #if CYTHON_COMPILING_IN_LIMITED_API
11704 PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
11705 #else
11706 PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
11707 #endif
11708 if (!ob)
11709 goto bad;
11710 ptr = PyCapsule_GetPointer(ob, 0);
11711 if (!ptr && !PyErr_Occurred())
11712 PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
11713 Py_DECREF(ob);
11714 return ptr;
11715 bad:
11716 Py_XDECREF(ob);
11717 return NULL;
11718 }
11719
11720 /* MergeVTables */
11721 #include "src/gevent/_generated_include/MergeVTables_impl_29949c70f2006953e8904d016998bf08a455f227.h"
11722 /* FetchCommonType */
11723 #include "src/gevent/_generated_include/FetchCommonType_impl_6075d632cab9f7f885689e5a11eba5f62db0a30d.h"
11724 /* PyVectorcallFastCallDict */
11725 #include "src/gevent/_generated_include/PyVectorcallFastCallDict_impl_a784fa498711d4b5f063c2459e516cae2c90113c.h"
11726 /* CythonFunctionShared */
__Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject * f,PyObject * classobj)11727 static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
11728 #if PY_VERSION_HEX < 0x030900B1
11729 __Pyx_Py_XDECREF_SET(
11730 __Pyx_CyFunction_GetClassObj(f),
11731 ((classobj) ? __Pyx_NewRef(classobj) : NULL));
11732 #else
11733 __Pyx_Py_XDECREF_SET(
11734 ((PyCMethodObject *) (f))->mm_class,
11735 (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
11736 #endif
11737 }
11738 static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject * op,void * closure)11739 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
11740 {
11741 CYTHON_UNUSED_VAR(closure);
11742 if (unlikely(op->func_doc == NULL)) {
11743 if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
11744 #if PY_MAJOR_VERSION >= 3
11745 op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
11746 #else
11747 op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
11748 #endif
11749 if (unlikely(op->func_doc == NULL))
11750 return NULL;
11751 } else {
11752 Py_INCREF(Py_None);
11753 return Py_None;
11754 }
11755 }
11756 Py_INCREF(op->func_doc);
11757 return op->func_doc;
11758 }
11759 static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject * op,PyObject * value,void * context)11760 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
11761 {
11762 CYTHON_UNUSED_VAR(context);
11763 if (value == NULL) {
11764 value = Py_None;
11765 }
11766 Py_INCREF(value);
11767 __Pyx_Py_XDECREF_SET(op->func_doc, value);
11768 return 0;
11769 }
11770 static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject * op,void * context)11771 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
11772 {
11773 CYTHON_UNUSED_VAR(context);
11774 if (unlikely(op->func_name == NULL)) {
11775 #if PY_MAJOR_VERSION >= 3
11776 op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
11777 #else
11778 op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
11779 #endif
11780 if (unlikely(op->func_name == NULL))
11781 return NULL;
11782 }
11783 Py_INCREF(op->func_name);
11784 return op->func_name;
11785 }
11786 static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject * op,PyObject * value,void * context)11787 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
11788 {
11789 CYTHON_UNUSED_VAR(context);
11790 #if PY_MAJOR_VERSION >= 3
11791 if (unlikely(value == NULL || !PyUnicode_Check(value)))
11792 #else
11793 if (unlikely(value == NULL || !PyString_Check(value)))
11794 #endif
11795 {
11796 PyErr_SetString(PyExc_TypeError,
11797 "__name__ must be set to a string object");
11798 return -1;
11799 }
11800 Py_INCREF(value);
11801 __Pyx_Py_XDECREF_SET(op->func_name, value);
11802 return 0;
11803 }
11804 static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject * op,void * context)11805 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
11806 {
11807 CYTHON_UNUSED_VAR(context);
11808 Py_INCREF(op->func_qualname);
11809 return op->func_qualname;
11810 }
11811 static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject * op,PyObject * value,void * context)11812 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
11813 {
11814 CYTHON_UNUSED_VAR(context);
11815 #if PY_MAJOR_VERSION >= 3
11816 if (unlikely(value == NULL || !PyUnicode_Check(value)))
11817 #else
11818 if (unlikely(value == NULL || !PyString_Check(value)))
11819 #endif
11820 {
11821 PyErr_SetString(PyExc_TypeError,
11822 "__qualname__ must be set to a string object");
11823 return -1;
11824 }
11825 Py_INCREF(value);
11826 __Pyx_Py_XDECREF_SET(op->func_qualname, value);
11827 return 0;
11828 }
11829 static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject * op,void * context)11830 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
11831 {
11832 CYTHON_UNUSED_VAR(context);
11833 if (unlikely(op->func_dict == NULL)) {
11834 op->func_dict = PyDict_New();
11835 if (unlikely(op->func_dict == NULL))
11836 return NULL;
11837 }
11838 Py_INCREF(op->func_dict);
11839 return op->func_dict;
11840 }
11841 static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject * op,PyObject * value,void * context)11842 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
11843 {
11844 CYTHON_UNUSED_VAR(context);
11845 if (unlikely(value == NULL)) {
11846 PyErr_SetString(PyExc_TypeError,
11847 "function's dictionary may not be deleted");
11848 return -1;
11849 }
11850 if (unlikely(!PyDict_Check(value))) {
11851 PyErr_SetString(PyExc_TypeError,
11852 "setting function's dictionary to a non-dict");
11853 return -1;
11854 }
11855 Py_INCREF(value);
11856 __Pyx_Py_XDECREF_SET(op->func_dict, value);
11857 return 0;
11858 }
11859 static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject * op,void * context)11860 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
11861 {
11862 CYTHON_UNUSED_VAR(context);
11863 Py_INCREF(op->func_globals);
11864 return op->func_globals;
11865 }
11866 static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject * op,void * context)11867 __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
11868 {
11869 CYTHON_UNUSED_VAR(op);
11870 CYTHON_UNUSED_VAR(context);
11871 Py_INCREF(Py_None);
11872 return Py_None;
11873 }
11874 static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject * op,void * context)11875 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
11876 {
11877 PyObject* result = (op->func_code) ? op->func_code : Py_None;
11878 CYTHON_UNUSED_VAR(context);
11879 Py_INCREF(result);
11880 return result;
11881 }
11882 static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject * op)11883 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
11884 int result = 0;
11885 PyObject *res = op->defaults_getter((PyObject *) op);
11886 if (unlikely(!res))
11887 return -1;
11888 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11889 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
11890 Py_INCREF(op->defaults_tuple);
11891 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
11892 Py_INCREF(op->defaults_kwdict);
11893 #else
11894 op->defaults_tuple = PySequence_ITEM(res, 0);
11895 if (unlikely(!op->defaults_tuple)) result = -1;
11896 else {
11897 op->defaults_kwdict = PySequence_ITEM(res, 1);
11898 if (unlikely(!op->defaults_kwdict)) result = -1;
11899 }
11900 #endif
11901 Py_DECREF(res);
11902 return result;
11903 }
11904 static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject * op,PyObject * value,void * context)11905 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
11906 CYTHON_UNUSED_VAR(context);
11907 if (!value) {
11908 value = Py_None;
11909 } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
11910 PyErr_SetString(PyExc_TypeError,
11911 "__defaults__ must be set to a tuple object");
11912 return -1;
11913 }
11914 Py_INCREF(value);
11915 __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
11916 return 0;
11917 }
11918 static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject * op,void * context)11919 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
11920 PyObject* result = op->defaults_tuple;
11921 CYTHON_UNUSED_VAR(context);
11922 if (unlikely(!result)) {
11923 if (op->defaults_getter) {
11924 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
11925 result = op->defaults_tuple;
11926 } else {
11927 result = Py_None;
11928 }
11929 }
11930 Py_INCREF(result);
11931 return result;
11932 }
11933 static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject * op,PyObject * value,void * context)11934 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
11935 CYTHON_UNUSED_VAR(context);
11936 if (!value) {
11937 value = Py_None;
11938 } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
11939 PyErr_SetString(PyExc_TypeError,
11940 "__kwdefaults__ must be set to a dict object");
11941 return -1;
11942 }
11943 Py_INCREF(value);
11944 __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
11945 return 0;
11946 }
11947 static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject * op,void * context)11948 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
11949 PyObject* result = op->defaults_kwdict;
11950 CYTHON_UNUSED_VAR(context);
11951 if (unlikely(!result)) {
11952 if (op->defaults_getter) {
11953 if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
11954 result = op->defaults_kwdict;
11955 } else {
11956 result = Py_None;
11957 }
11958 }
11959 Py_INCREF(result);
11960 return result;
11961 }
11962 static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject * op,PyObject * value,void * context)11963 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
11964 CYTHON_UNUSED_VAR(context);
11965 if (!value || value == Py_None) {
11966 value = NULL;
11967 } else if (unlikely(!PyDict_Check(value))) {
11968 PyErr_SetString(PyExc_TypeError,
11969 "__annotations__ must be set to a dict object");
11970 return -1;
11971 }
11972 Py_XINCREF(value);
11973 __Pyx_Py_XDECREF_SET(op->func_annotations, value);
11974 return 0;
11975 }
11976 static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject * op,void * context)11977 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
11978 PyObject* result = op->func_annotations;
11979 CYTHON_UNUSED_VAR(context);
11980 if (unlikely(!result)) {
11981 result = PyDict_New();
11982 if (unlikely(!result)) return NULL;
11983 op->func_annotations = result;
11984 }
11985 Py_INCREF(result);
11986 return result;
11987 }
11988 static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject * op,void * context)11989 __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
11990 int is_coroutine;
11991 CYTHON_UNUSED_VAR(context);
11992 if (op->func_is_coroutine) {
11993 return __Pyx_NewRef(op->func_is_coroutine);
11994 }
11995 is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
11996 #if PY_VERSION_HEX >= 0x03050000
11997 if (is_coroutine) {
11998 PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
11999 fromlist = PyList_New(1);
12000 if (unlikely(!fromlist)) return NULL;
12001 Py_INCREF(marker);
12002 PyList_SET_ITEM(fromlist, 0, marker);
12003 module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
12004 Py_DECREF(fromlist);
12005 if (unlikely(!module)) goto ignore;
12006 op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
12007 Py_DECREF(module);
12008 if (likely(op->func_is_coroutine)) {
12009 return __Pyx_NewRef(op->func_is_coroutine);
12010 }
12011 ignore:
12012 PyErr_Clear();
12013 }
12014 #endif
12015 op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
12016 return __Pyx_NewRef(op->func_is_coroutine);
12017 }
12018 static PyGetSetDef __pyx_CyFunction_getsets[] = {
12019 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
12020 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
12021 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
12022 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
12023 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
12024 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
12025 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
12026 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
12027 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
12028 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
12029 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
12030 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
12031 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
12032 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
12033 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
12034 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
12035 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
12036 {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
12037 {0, 0, 0, 0, 0}
12038 };
12039 static PyMemberDef __pyx_CyFunction_members[] = {
12040 {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
12041 #if CYTHON_USE_TYPE_SPECS
12042 {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
12043 #if CYTHON_METH_FASTCALL
12044 #if CYTHON_BACKPORT_VECTORCALL
12045 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
12046 #else
12047 {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
12048 #endif
12049 #endif
12050 #if PY_VERSION_HEX < 0x030500A0
12051 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
12052 #else
12053 {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
12054 #endif
12055 #endif
12056 {0, 0, 0, 0, 0}
12057 };
12058 static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject * m,PyObject * args)12059 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
12060 {
12061 CYTHON_UNUSED_VAR(args);
12062 #if PY_MAJOR_VERSION >= 3
12063 Py_INCREF(m->func_qualname);
12064 return m->func_qualname;
12065 #else
12066 return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
12067 #endif
12068 }
12069 static PyMethodDef __pyx_CyFunction_methods[] = {
12070 {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
12071 {0, 0, 0, 0}
12072 };
12073 #if PY_VERSION_HEX < 0x030500A0
12074 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
12075 #else
12076 #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
12077 #endif
__Pyx_CyFunction_Init(__pyx_CyFunctionObject * op,PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)12078 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
12079 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
12080 PyCFunctionObject *cf = (PyCFunctionObject*) op;
12081 if (unlikely(op == NULL))
12082 return NULL;
12083 op->flags = flags;
12084 __Pyx_CyFunction_weakreflist(op) = NULL;
12085 cf->m_ml = ml;
12086 cf->m_self = (PyObject *) op;
12087 Py_XINCREF(closure);
12088 op->func_closure = closure;
12089 Py_XINCREF(module);
12090 cf->m_module = module;
12091 op->func_dict = NULL;
12092 op->func_name = NULL;
12093 Py_INCREF(qualname);
12094 op->func_qualname = qualname;
12095 op->func_doc = NULL;
12096 #if PY_VERSION_HEX < 0x030900B1
12097 op->func_classobj = NULL;
12098 #else
12099 ((PyCMethodObject*)op)->mm_class = NULL;
12100 #endif
12101 op->func_globals = globals;
12102 Py_INCREF(op->func_globals);
12103 Py_XINCREF(code);
12104 op->func_code = code;
12105 op->defaults_pyobjects = 0;
12106 op->defaults_size = 0;
12107 op->defaults = NULL;
12108 op->defaults_tuple = NULL;
12109 op->defaults_kwdict = NULL;
12110 op->defaults_getter = NULL;
12111 op->func_annotations = NULL;
12112 op->func_is_coroutine = NULL;
12113 #if CYTHON_METH_FASTCALL
12114 switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
12115 case METH_NOARGS:
12116 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
12117 break;
12118 case METH_O:
12119 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
12120 break;
12121 case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
12122 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
12123 break;
12124 case METH_FASTCALL | METH_KEYWORDS:
12125 __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
12126 break;
12127 case METH_VARARGS | METH_KEYWORDS:
12128 __Pyx_CyFunction_func_vectorcall(op) = NULL;
12129 break;
12130 default:
12131 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
12132 Py_DECREF(op);
12133 return NULL;
12134 }
12135 #endif
12136 return (PyObject *) op;
12137 }
12138 static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject * m)12139 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
12140 {
12141 Py_CLEAR(m->func_closure);
12142 Py_CLEAR(((PyCFunctionObject*)m)->m_module);
12143 Py_CLEAR(m->func_dict);
12144 Py_CLEAR(m->func_name);
12145 Py_CLEAR(m->func_qualname);
12146 Py_CLEAR(m->func_doc);
12147 Py_CLEAR(m->func_globals);
12148 Py_CLEAR(m->func_code);
12149 #if PY_VERSION_HEX < 0x030900B1
12150 Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
12151 #else
12152 {
12153 PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
12154 ((PyCMethodObject *) (m))->mm_class = NULL;
12155 Py_XDECREF(cls);
12156 }
12157 #endif
12158 Py_CLEAR(m->defaults_tuple);
12159 Py_CLEAR(m->defaults_kwdict);
12160 Py_CLEAR(m->func_annotations);
12161 Py_CLEAR(m->func_is_coroutine);
12162 if (m->defaults) {
12163 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
12164 int i;
12165 for (i = 0; i < m->defaults_pyobjects; i++)
12166 Py_XDECREF(pydefaults[i]);
12167 PyObject_Free(m->defaults);
12168 m->defaults = NULL;
12169 }
12170 return 0;
12171 }
__Pyx__CyFunction_dealloc(__pyx_CyFunctionObject * m)12172 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
12173 {
12174 if (__Pyx_CyFunction_weakreflist(m) != NULL)
12175 PyObject_ClearWeakRefs((PyObject *) m);
12176 __Pyx_CyFunction_clear(m);
12177 __Pyx_PyHeapTypeObject_GC_Del(m);
12178 }
__Pyx_CyFunction_dealloc(__pyx_CyFunctionObject * m)12179 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
12180 {
12181 PyObject_GC_UnTrack(m);
12182 __Pyx__CyFunction_dealloc(m);
12183 }
__Pyx_CyFunction_traverse(__pyx_CyFunctionObject * m,visitproc visit,void * arg)12184 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
12185 {
12186 Py_VISIT(m->func_closure);
12187 Py_VISIT(((PyCFunctionObject*)m)->m_module);
12188 Py_VISIT(m->func_dict);
12189 Py_VISIT(m->func_name);
12190 Py_VISIT(m->func_qualname);
12191 Py_VISIT(m->func_doc);
12192 Py_VISIT(m->func_globals);
12193 Py_VISIT(m->func_code);
12194 Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
12195 Py_VISIT(m->defaults_tuple);
12196 Py_VISIT(m->defaults_kwdict);
12197 Py_VISIT(m->func_is_coroutine);
12198 if (m->defaults) {
12199 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
12200 int i;
12201 for (i = 0; i < m->defaults_pyobjects; i++)
12202 Py_VISIT(pydefaults[i]);
12203 }
12204 return 0;
12205 }
12206 static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject * op)12207 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
12208 {
12209 #if PY_MAJOR_VERSION >= 3
12210 return PyUnicode_FromFormat("<cyfunction %U at %p>",
12211 op->func_qualname, (void *)op);
12212 #else
12213 return PyString_FromFormat("<cyfunction %s at %p>",
12214 PyString_AsString(op->func_qualname), (void *)op);
12215 #endif
12216 }
__Pyx_CyFunction_CallMethod(PyObject * func,PyObject * self,PyObject * arg,PyObject * kw)12217 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
12218 PyCFunctionObject* f = (PyCFunctionObject*)func;
12219 PyCFunction meth = f->m_ml->ml_meth;
12220 Py_ssize_t size;
12221 switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
12222 case METH_VARARGS:
12223 if (likely(kw == NULL || PyDict_Size(kw) == 0))
12224 return (*meth)(self, arg);
12225 break;
12226 case METH_VARARGS | METH_KEYWORDS:
12227 return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
12228 case METH_NOARGS:
12229 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
12230 size = PyTuple_GET_SIZE(arg);
12231 if (likely(size == 0))
12232 return (*meth)(self, NULL);
12233 PyErr_Format(PyExc_TypeError,
12234 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
12235 f->m_ml->ml_name, size);
12236 return NULL;
12237 }
12238 break;
12239 case METH_O:
12240 if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
12241 size = PyTuple_GET_SIZE(arg);
12242 if (likely(size == 1)) {
12243 PyObject *result, *arg0;
12244 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
12245 arg0 = PyTuple_GET_ITEM(arg, 0);
12246 #else
12247 arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
12248 #endif
12249 result = (*meth)(self, arg0);
12250 #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
12251 Py_DECREF(arg0);
12252 #endif
12253 return result;
12254 }
12255 PyErr_Format(PyExc_TypeError,
12256 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
12257 f->m_ml->ml_name, size);
12258 return NULL;
12259 }
12260 break;
12261 default:
12262 PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
12263 return NULL;
12264 }
12265 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
12266 f->m_ml->ml_name);
12267 return NULL;
12268 }
__Pyx_CyFunction_Call(PyObject * func,PyObject * arg,PyObject * kw)12269 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
12270 return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
12271 }
__Pyx_CyFunction_CallAsMethod(PyObject * func,PyObject * args,PyObject * kw)12272 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
12273 PyObject *result;
12274 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
12275 #if CYTHON_METH_FASTCALL
12276 __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
12277 if (vc) {
12278 #if CYTHON_ASSUME_SAFE_MACROS
12279 return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
12280 #else
12281 (void) &__Pyx_PyVectorcall_FastCallDict;
12282 return PyVectorcall_Call(func, args, kw);
12283 #endif
12284 }
12285 #endif
12286 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
12287 Py_ssize_t argc;
12288 PyObject *new_args;
12289 PyObject *self;
12290 argc = PyTuple_GET_SIZE(args);
12291 new_args = PyTuple_GetSlice(args, 1, argc);
12292 if (unlikely(!new_args))
12293 return NULL;
12294 self = PyTuple_GetItem(args, 0);
12295 if (unlikely(!self)) {
12296 Py_DECREF(new_args);
12297 return NULL;
12298 }
12299 result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
12300 Py_DECREF(new_args);
12301 } else {
12302 result = __Pyx_CyFunction_Call(func, args, kw);
12303 }
12304 return result;
12305 }
12306 #if CYTHON_METH_FASTCALL
__Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject * cyfunc,Py_ssize_t nargs,PyObject * kwnames)12307 static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
12308 {
12309 int ret = 0;
12310 if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
12311 if (unlikely(nargs < 1)) {
12312 PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
12313 ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
12314 return -1;
12315 }
12316 ret = 1;
12317 }
12318 if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
12319 PyErr_Format(PyExc_TypeError,
12320 "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
12321 return -1;
12322 }
12323 return ret;
12324 }
__Pyx_CyFunction_Vectorcall_NOARGS(PyObject * func,PyObject * const * args,size_t nargsf,PyObject * kwnames)12325 static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
12326 {
12327 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
12328 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
12329 #if CYTHON_BACKPORT_VECTORCALL
12330 Py_ssize_t nargs = (Py_ssize_t)nargsf;
12331 #else
12332 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
12333 #endif
12334 PyObject *self;
12335 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
12336 case 1:
12337 self = args[0];
12338 args += 1;
12339 nargs -= 1;
12340 break;
12341 case 0:
12342 self = ((PyCFunctionObject*)cyfunc)->m_self;
12343 break;
12344 default:
12345 return NULL;
12346 }
12347 if (unlikely(nargs != 0)) {
12348 PyErr_Format(PyExc_TypeError,
12349 "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
12350 def->ml_name, nargs);
12351 return NULL;
12352 }
12353 return def->ml_meth(self, NULL);
12354 }
__Pyx_CyFunction_Vectorcall_O(PyObject * func,PyObject * const * args,size_t nargsf,PyObject * kwnames)12355 static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
12356 {
12357 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
12358 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
12359 #if CYTHON_BACKPORT_VECTORCALL
12360 Py_ssize_t nargs = (Py_ssize_t)nargsf;
12361 #else
12362 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
12363 #endif
12364 PyObject *self;
12365 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
12366 case 1:
12367 self = args[0];
12368 args += 1;
12369 nargs -= 1;
12370 break;
12371 case 0:
12372 self = ((PyCFunctionObject*)cyfunc)->m_self;
12373 break;
12374 default:
12375 return NULL;
12376 }
12377 if (unlikely(nargs != 1)) {
12378 PyErr_Format(PyExc_TypeError,
12379 "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
12380 def->ml_name, nargs);
12381 return NULL;
12382 }
12383 return def->ml_meth(self, args[0]);
12384 }
__Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject * func,PyObject * const * args,size_t nargsf,PyObject * kwnames)12385 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
12386 {
12387 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
12388 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
12389 #if CYTHON_BACKPORT_VECTORCALL
12390 Py_ssize_t nargs = (Py_ssize_t)nargsf;
12391 #else
12392 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
12393 #endif
12394 PyObject *self;
12395 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
12396 case 1:
12397 self = args[0];
12398 args += 1;
12399 nargs -= 1;
12400 break;
12401 case 0:
12402 self = ((PyCFunctionObject*)cyfunc)->m_self;
12403 break;
12404 default:
12405 return NULL;
12406 }
12407 return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
12408 }
__Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject * func,PyObject * const * args,size_t nargsf,PyObject * kwnames)12409 static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
12410 {
12411 __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
12412 PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
12413 PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
12414 #if CYTHON_BACKPORT_VECTORCALL
12415 Py_ssize_t nargs = (Py_ssize_t)nargsf;
12416 #else
12417 Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
12418 #endif
12419 PyObject *self;
12420 switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
12421 case 1:
12422 self = args[0];
12423 args += 1;
12424 nargs -= 1;
12425 break;
12426 case 0:
12427 self = ((PyCFunctionObject*)cyfunc)->m_self;
12428 break;
12429 default:
12430 return NULL;
12431 }
12432 return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, nargs, kwnames);
12433 }
12434 #endif
12435 #if CYTHON_USE_TYPE_SPECS
12436 static PyType_Slot __pyx_CyFunctionType_slots[] = {
12437 {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
12438 {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
12439 {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
12440 {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
12441 {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
12442 {Py_tp_methods, (void *)__pyx_CyFunction_methods},
12443 {Py_tp_members, (void *)__pyx_CyFunction_members},
12444 {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
12445 {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
12446 {0, 0},
12447 };
12448 static PyType_Spec __pyx_CyFunctionType_spec = {
12449 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
12450 sizeof(__pyx_CyFunctionObject),
12451 0,
12452 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
12453 Py_TPFLAGS_METHOD_DESCRIPTOR |
12454 #endif
12455 #ifdef _Py_TPFLAGS_HAVE_VECTORCALL
12456 _Py_TPFLAGS_HAVE_VECTORCALL |
12457 #endif
12458 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
12459 __pyx_CyFunctionType_slots
12460 };
12461 #else
12462 static PyTypeObject __pyx_CyFunctionType_type = {
12463 PyVarObject_HEAD_INIT(0, 0)
12464 __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
12465 sizeof(__pyx_CyFunctionObject),
12466 0,
12467 (destructor) __Pyx_CyFunction_dealloc,
12468 #if !CYTHON_METH_FASTCALL
12469 0,
12470 #elif CYTHON_BACKPORT_VECTORCALL
12471 (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
12472 #else
12473 offsetof(PyCFunctionObject, vectorcall),
12474 #endif
12475 0,
12476 0,
12477 #if PY_MAJOR_VERSION < 3
12478 0,
12479 #else
12480 0,
12481 #endif
12482 (reprfunc) __Pyx_CyFunction_repr,
12483 0,
12484 0,
12485 0,
12486 0,
12487 __Pyx_CyFunction_CallAsMethod,
12488 0,
12489 0,
12490 0,
12491 0,
12492 #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
12493 Py_TPFLAGS_METHOD_DESCRIPTOR |
12494 #endif
12495 #ifdef _Py_TPFLAGS_HAVE_VECTORCALL
12496 _Py_TPFLAGS_HAVE_VECTORCALL |
12497 #endif
12498 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
12499 0,
12500 (traverseproc) __Pyx_CyFunction_traverse,
12501 (inquiry) __Pyx_CyFunction_clear,
12502 0,
12503 #if PY_VERSION_HEX < 0x030500A0
12504 offsetof(__pyx_CyFunctionObject, func_weakreflist),
12505 #else
12506 offsetof(PyCFunctionObject, m_weakreflist),
12507 #endif
12508 0,
12509 0,
12510 __pyx_CyFunction_methods,
12511 __pyx_CyFunction_members,
12512 __pyx_CyFunction_getsets,
12513 0,
12514 0,
12515 __Pyx_PyMethod_New,
12516 0,
12517 offsetof(__pyx_CyFunctionObject, func_dict),
12518 0,
12519 0,
12520 0,
12521 0,
12522 0,
12523 0,
12524 0,
12525 0,
12526 0,
12527 0,
12528 0,
12529 0,
12530 #if PY_VERSION_HEX >= 0x030400a1
12531 0,
12532 #endif
12533 #if PY_VERSION_HEX >= 0x030800b1
12534 0,
12535 #endif
12536 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
12537 0,
12538 #endif
12539 #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
12540 0,
12541 #endif
12542 };
12543 #endif
__pyx_CyFunction_init(PyObject * module)12544 static int __pyx_CyFunction_init(PyObject *module) {
12545 #if CYTHON_USE_TYPE_SPECS
12546 __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
12547 #else
12548 (void) module;
12549 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
12550 #endif
12551 if (unlikely(__pyx_CyFunctionType == NULL)) {
12552 return -1;
12553 }
12554 return 0;
12555 }
__Pyx_CyFunction_InitDefaults(PyObject * func,size_t size,int pyobjects)12556 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
12557 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12558 m->defaults = PyObject_Malloc(size);
12559 if (unlikely(!m->defaults))
12560 return PyErr_NoMemory();
12561 memset(m->defaults, 0, size);
12562 m->defaults_pyobjects = pyobjects;
12563 m->defaults_size = size;
12564 return m->defaults;
12565 }
__Pyx_CyFunction_SetDefaultsTuple(PyObject * func,PyObject * tuple)12566 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
12567 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12568 m->defaults_tuple = tuple;
12569 Py_INCREF(tuple);
12570 }
__Pyx_CyFunction_SetDefaultsKwDict(PyObject * func,PyObject * dict)12571 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
12572 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12573 m->defaults_kwdict = dict;
12574 Py_INCREF(dict);
12575 }
__Pyx_CyFunction_SetAnnotationsDict(PyObject * func,PyObject * dict)12576 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
12577 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
12578 m->func_annotations = dict;
12579 Py_INCREF(dict);
12580 }
12581
12582 /* CythonFunction */
__Pyx_CyFunction_New(PyMethodDef * ml,int flags,PyObject * qualname,PyObject * closure,PyObject * module,PyObject * globals,PyObject * code)12583 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
12584 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
12585 PyObject *op = __Pyx_CyFunction_Init(
12586 PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
12587 ml, flags, qualname, closure, module, globals, code
12588 );
12589 if (likely(op)) {
12590 PyObject_GC_Track(op);
12591 }
12592 return op;
12593 }
12594
12595 /* Globals */
__Pyx_Globals(void)12596 static PyObject* __Pyx_Globals(void) {
12597 return __Pyx_NewRef(__pyx_d);
12598 }
12599
12600 /* CLineInTraceback */
12601 #ifndef CYTHON_CLINE_IN_TRACEBACK
__Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState * tstate,int c_line)12602 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
12603 PyObject *use_cline;
12604 PyObject *ptype, *pvalue, *ptraceback;
12605 #if CYTHON_COMPILING_IN_CPYTHON
12606 PyObject **cython_runtime_dict;
12607 #endif
12608 if (unlikely(!__pyx_cython_runtime)) {
12609 return c_line;
12610 }
12611 __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
12612 #if CYTHON_COMPILING_IN_CPYTHON
12613 cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
12614 if (likely(cython_runtime_dict)) {
12615 __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
12616 use_cline, *cython_runtime_dict,
12617 __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
12618 } else
12619 #endif
12620 {
12621 PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
12622 if (use_cline_obj) {
12623 use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
12624 Py_DECREF(use_cline_obj);
12625 } else {
12626 PyErr_Clear();
12627 use_cline = NULL;
12628 }
12629 }
12630 if (!use_cline) {
12631 c_line = 0;
12632 PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
12633 }
12634 else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
12635 c_line = 0;
12636 }
12637 __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
12638 return c_line;
12639 }
12640 #endif
12641
12642 /* CodeObjectCache */
12643 #include "src/gevent/_generated_include/CodeObjectCache_impl_9806d8691f0647604c43940c16bcbdf8b5ddae48.h"
12644 /* AddTraceback */
12645 #include "src/gevent/_generated_include/AddTraceback_impl_b5c78188883744b3dfae78a4f03fe3ccce2f3e32.h"
12646 /* CIntToPy */
12647 #include "src/gevent/_generated_include/CIntToPy_impl_bd16f81653b1c9396fb8980b62edabfda564b1c8.h"
12648 /* FormatTypeName */
12649 #if CYTHON_COMPILING_IN_LIMITED_API
12650 static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject * tp)12651 __Pyx_PyType_GetName(PyTypeObject* tp)
12652 {
12653 PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
12654 __pyx_n_s_name);
12655 if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
12656 PyErr_Clear();
12657 Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__24));
12658 }
12659 return name;
12660 }
12661 #endif
12662
12663 /* CIntFromPyVerify */
12664 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
12665 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
12666 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
12667 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
12668 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
12669 {\
12670 func_type value = func_value;\
12671 if (sizeof(target_type) < sizeof(func_type)) {\
12672 if (unlikely(value != (func_type) (target_type) value)) {\
12673 func_type zero = 0;\
12674 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
12675 return (target_type) -1;\
12676 if (is_unsigned && unlikely(value < zero))\
12677 goto raise_neg_overflow;\
12678 else\
12679 goto raise_overflow;\
12680 }\
12681 }\
12682 return (target_type) value;\
12683 }
12684
12685 /* CIntFromPy */
12686 #include "src/gevent/_generated_include/CIntFromPy_impl_4e022c4adc51b46435fd7a8fc780519d33fc4d51.h"
12687 /* CIntFromPy */
12688 #include "src/gevent/_generated_include/CIntFromPy_impl_1acd853eb242f2a14b63ea0b7665ba0aef1c09de.h"
12689 /* CheckBinaryVersion */
__Pyx_check_binary_version(void)12690 static int __Pyx_check_binary_version(void) {
12691 char ctversion[4], rtversion[4];
12692 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
12693 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
12694 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
12695 char message[200];
12696 PyOS_snprintf(message, sizeof(message),
12697 "compiletime version %s of module '%.100s' "
12698 "does not match runtime version %s",
12699 ctversion, __Pyx_MODULE_NAME, rtversion);
12700 return PyErr_WarnEx(NULL, message, 1);
12701 }
12702 return 0;
12703 }
12704
12705 /* PyObjectSetAttrStr */
12706 #if CYTHON_USE_TYPE_SLOTS
__Pyx_PyObject_SetAttrStr(PyObject * obj,PyObject * attr_name,PyObject * value)12707 static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
12708 PyTypeObject* tp = Py_TYPE(obj);
12709 if (likely(tp->tp_setattro))
12710 return tp->tp_setattro(obj, attr_name, value);
12711 #if PY_MAJOR_VERSION < 3
12712 if (likely(tp->tp_setattr))
12713 return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
12714 #endif
12715 return PyObject_SetAttr(obj, attr_name, value);
12716 }
12717 #endif
12718
12719 /* VoidPtrExport */
__Pyx_ExportVoidPtr(PyObject * name,void * p,const char * sig)12720 static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
12721 PyObject *d;
12722 PyObject *cobj = 0;
12723 d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
12724 Py_XINCREF(d);
12725 if (!d) {
12726 d = PyDict_New();
12727 if (!d)
12728 goto bad;
12729 if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0)
12730 goto bad;
12731 }
12732 cobj = PyCapsule_New(p, sig, 0);
12733 if (!cobj)
12734 goto bad;
12735 if (PyDict_SetItem(d, name, cobj) < 0)
12736 goto bad;
12737 Py_DECREF(cobj);
12738 Py_DECREF(d);
12739 return 0;
12740 bad:
12741 Py_XDECREF(cobj);
12742 Py_XDECREF(d);
12743 return -1;
12744 }
12745
12746 /* FunctionExport */
__Pyx_ExportFunction(const char * name,void (* f)(void),const char * sig)12747 static int __Pyx_ExportFunction(const char *name, void (*f)(void), const char *sig) {
12748 PyObject *d = 0;
12749 PyObject *cobj = 0;
12750 union {
12751 void (*fp)(void);
12752 void *p;
12753 } tmp;
12754 d = PyObject_GetAttrString(__pyx_m, (char *)"__pyx_capi__");
12755 if (!d) {
12756 PyErr_Clear();
12757 d = PyDict_New();
12758 if (!d)
12759 goto bad;
12760 Py_INCREF(d);
12761 if (PyModule_AddObject(__pyx_m, (char *)"__pyx_capi__", d) < 0)
12762 goto bad;
12763 }
12764 tmp.fp = f;
12765 cobj = PyCapsule_New(tmp.p, sig, 0);
12766 if (!cobj)
12767 goto bad;
12768 if (PyDict_SetItemString(d, name, cobj) < 0)
12769 goto bad;
12770 Py_DECREF(cobj);
12771 Py_DECREF(d);
12772 return 0;
12773 bad:
12774 Py_XDECREF(cobj);
12775 Py_XDECREF(d);
12776 return -1;
12777 }
12778
12779 /* VoidPtrImport */
12780 #ifndef __PYX_HAVE_RT_ImportVoidPtr
12781 #define __PYX_HAVE_RT_ImportVoidPtr
__Pyx_ImportVoidPtr(PyObject * module,const char * name,void ** p,const char * sig)12782 static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
12783 PyObject *d = 0;
12784 PyObject *cobj = 0;
12785 d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
12786 if (!d)
12787 goto bad;
12788 cobj = PyDict_GetItemString(d, name);
12789 if (!cobj) {
12790 PyErr_Format(PyExc_ImportError,
12791 "%.200s does not export expected C variable %.200s",
12792 PyModule_GetName(module), name);
12793 goto bad;
12794 }
12795 if (!PyCapsule_IsValid(cobj, sig)) {
12796 PyErr_Format(PyExc_TypeError,
12797 "C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
12798 PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
12799 goto bad;
12800 }
12801 *p = PyCapsule_GetPointer(cobj, sig);
12802 if (!(*p))
12803 goto bad;
12804 Py_DECREF(d);
12805 return 0;
12806 bad:
12807 Py_XDECREF(d);
12808 return -1;
12809 }
12810 #endif
12811
12812 /* FunctionImport */
12813 #include "src/gevent/_generated_include/FunctionImport_impl_d1678083a4ac2cd86d7acbe656654e542e33839d.h"
12814 /* InitStrings */
12815 #include "src/gevent/_generated_include/InitStrings_impl_d88d4d6dd5d0fce8587ddcc8c2c64ec7a0161e7c.h"
__Pyx_PyUnicode_FromString(const char * c_str)12816 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
12817 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
12818 }
__Pyx_PyObject_AsString(PyObject * o)12819 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
12820 Py_ssize_t ignore;
12821 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
12822 }
12823 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
12824 #if !CYTHON_PEP393_ENABLED
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)12825 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12826 char* defenc_c;
12827 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
12828 if (!defenc) return NULL;
12829 defenc_c = PyBytes_AS_STRING(defenc);
12830 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12831 {
12832 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
12833 char* c;
12834 for (c = defenc_c; c < end; c++) {
12835 if ((unsigned char) (*c) >= 128) {
12836 PyUnicode_AsASCIIString(o);
12837 return NULL;
12838 }
12839 }
12840 }
12841 #endif
12842 *length = PyBytes_GET_SIZE(defenc);
12843 return defenc_c;
12844 }
12845 #else
__Pyx_PyUnicode_AsStringAndSize(PyObject * o,Py_ssize_t * length)12846 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12847 if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
12848 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12849 if (likely(PyUnicode_IS_ASCII(o))) {
12850 *length = PyUnicode_GET_LENGTH(o);
12851 return PyUnicode_AsUTF8(o);
12852 } else {
12853 PyUnicode_AsASCIIString(o);
12854 return NULL;
12855 }
12856 #else
12857 return PyUnicode_AsUTF8AndSize(o, length);
12858 #endif
12859 }
12860 #endif
12861 #endif
__Pyx_PyObject_AsStringAndSize(PyObject * o,Py_ssize_t * length)12862 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
12863 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
12864 if (
12865 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
12866 __Pyx_sys_getdefaultencoding_not_ascii &&
12867 #endif
12868 PyUnicode_Check(o)) {
12869 return __Pyx_PyUnicode_AsStringAndSize(o, length);
12870 } else
12871 #endif
12872 #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
12873 if (PyByteArray_Check(o)) {
12874 *length = PyByteArray_GET_SIZE(o);
12875 return PyByteArray_AS_STRING(o);
12876 } else
12877 #endif
12878 {
12879 char* result;
12880 int r = PyBytes_AsStringAndSize(o, &result, length);
12881 if (unlikely(r < 0)) {
12882 return NULL;
12883 } else {
12884 return result;
12885 }
12886 }
12887 }
__Pyx_PyObject_IsTrue(PyObject * x)12888 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
12889 int is_true = x == Py_True;
12890 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
12891 else return PyObject_IsTrue(x);
12892 }
__Pyx_PyObject_IsTrueAndDecref(PyObject * x)12893 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
12894 int retval;
12895 if (unlikely(!x)) return -1;
12896 retval = __Pyx_PyObject_IsTrue(x);
12897 Py_DECREF(x);
12898 return retval;
12899 }
__Pyx_PyNumber_IntOrLongWrongResultType(PyObject * result,const char * type_name)12900 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
12901 __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
12902 #if PY_MAJOR_VERSION >= 3
12903 if (PyLong_Check(result)) {
12904 if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
12905 "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
12906 "The ability to return an instance of a strict subclass of int is deprecated, "
12907 "and may be removed in a future version of Python.",
12908 result_type_name)) {
12909 __Pyx_DECREF_TypeName(result_type_name);
12910 Py_DECREF(result);
12911 return NULL;
12912 }
12913 __Pyx_DECREF_TypeName(result_type_name);
12914 return result;
12915 }
12916 #endif
12917 PyErr_Format(PyExc_TypeError,
12918 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
12919 type_name, type_name, result_type_name);
12920 __Pyx_DECREF_TypeName(result_type_name);
12921 Py_DECREF(result);
12922 return NULL;
12923 }
__Pyx_PyNumber_IntOrLong(PyObject * x)12924 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
12925 #if CYTHON_USE_TYPE_SLOTS
12926 PyNumberMethods *m;
12927 #endif
12928 const char *name = NULL;
12929 PyObject *res = NULL;
12930 #if PY_MAJOR_VERSION < 3
12931 if (likely(PyInt_Check(x) || PyLong_Check(x)))
12932 #else
12933 if (likely(PyLong_Check(x)))
12934 #endif
12935 return __Pyx_NewRef(x);
12936 #if CYTHON_USE_TYPE_SLOTS
12937 m = Py_TYPE(x)->tp_as_number;
12938 #if PY_MAJOR_VERSION < 3
12939 if (m && m->nb_int) {
12940 name = "int";
12941 res = m->nb_int(x);
12942 }
12943 else if (m && m->nb_long) {
12944 name = "long";
12945 res = m->nb_long(x);
12946 }
12947 #else
12948 if (likely(m && m->nb_int)) {
12949 name = "int";
12950 res = m->nb_int(x);
12951 }
12952 #endif
12953 #else
12954 if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
12955 res = PyNumber_Int(x);
12956 }
12957 #endif
12958 if (likely(res)) {
12959 #if PY_MAJOR_VERSION < 3
12960 if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
12961 #else
12962 if (unlikely(!PyLong_CheckExact(res))) {
12963 #endif
12964 return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
12965 }
12966 }
12967 else if (!PyErr_Occurred()) {
12968 PyErr_SetString(PyExc_TypeError,
12969 "an integer is required");
12970 }
12971 return res;
12972 }
12973 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
12974 Py_ssize_t ival;
12975 PyObject *x;
12976 #if PY_MAJOR_VERSION < 3
12977 if (likely(PyInt_CheckExact(b))) {
12978 if (sizeof(Py_ssize_t) >= sizeof(long))
12979 return PyInt_AS_LONG(b);
12980 else
12981 return PyInt_AsSsize_t(b);
12982 }
12983 #endif
12984 if (likely(PyLong_CheckExact(b))) {
12985 #if CYTHON_USE_PYLONG_INTERNALS
12986 const digit* digits = ((PyLongObject*)b)->ob_digit;
12987 const Py_ssize_t size = Py_SIZE(b);
12988 if (likely(__Pyx_sst_abs(size) <= 1)) {
12989 ival = likely(size) ? digits[0] : 0;
12990 if (size == -1) ival = -ival;
12991 return ival;
12992 } else {
12993 switch (size) {
12994 case 2:
12995 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
12996 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
12997 }
12998 break;
12999 case -2:
13000 if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
13001 return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13002 }
13003 break;
13004 case 3:
13005 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13006 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13007 }
13008 break;
13009 case -3:
13010 if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
13011 return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13012 }
13013 break;
13014 case 4:
13015 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13016 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13017 }
13018 break;
13019 case -4:
13020 if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
13021 return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
13022 }
13023 break;
13024 }
13025 }
13026 #endif
13027 return PyLong_AsSsize_t(b);
13028 }
13029 x = PyNumber_Index(b);
13030 if (!x) return -1;
13031 ival = PyInt_AsSsize_t(x);
13032 Py_DECREF(x);
13033 return ival;
13034 }
13035 static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
13036 if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
13037 return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
13038 #if PY_MAJOR_VERSION < 3
13039 } else if (likely(PyInt_CheckExact(o))) {
13040 return PyInt_AS_LONG(o);
13041 #endif
13042 } else {
13043 Py_ssize_t ival;
13044 PyObject *x;
13045 x = PyNumber_Index(o);
13046 if (!x) return -1;
13047 ival = PyInt_AsLong(x);
13048 Py_DECREF(x);
13049 return ival;
13050 }
13051 }
13052 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
13053 return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
13054 }
13055 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
13056 return PyInt_FromSize_t(ival);
13057 }
13058
13059
13060 /* #### Code section: end ### */
13061 #endif /* Py_PYTHON_H */
13062