/* Generated by Cython 0.29.32 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "src/gevent/_gevent_c_waiter.pxd"
        ],
        "include_dirs": [
            "/recipe-sysroot/usr/include/python3.10"
        ],
        "name": "gevent._gevent_c_waiter",
        "sources": [
            "src/gevent/_waiter.py"
        ]
    },
    "module_name": "gevent._gevent_c_waiter"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_32"
#define CYTHON_HEX_VERSION 0x001D20F0
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_HEX >= 0x07030900)
  #endif
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  #endif
#elif defined(PY_NOGIL)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_NOGIL 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #ifndef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_NOGIL 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #if PY_VERSION_HEX >= 0x030B00A4
    #undef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 0
  #elif !defined(CYTHON_FAST_THREAD_STATE)
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL (PY_VERSION_HEX < 0x030A0000)
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #if PY_VERSION_HEX >= 0x030B00A4
    #undef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK 0
  #elif !defined(CYTHON_USE_EXC_INFO_STACK)
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
  #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
    #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #if PY_MAJOR_VERSION < 3
    #include "longintrepr.h"
  #endif
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030B00A1
    static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int k, int l, int s, int f,
                                                    PyObject *code, PyObject *c, PyObject* n, PyObject *v,
                                                    PyObject *fv, PyObject *cell, PyObject* fn,
                                                    PyObject *name, int fline, PyObject *lnos) {
        PyObject *kwds=NULL, *argcount=NULL, *posonlyargcount=NULL, *kwonlyargcount=NULL;
        PyObject *nlocals=NULL, *stacksize=NULL, *flags=NULL, *replace=NULL, *call_result=NULL, *empty=NULL;
        const char *fn_cstr=NULL;
        const char *name_cstr=NULL;
        PyCodeObject* co=NULL;
        PyObject *type, *value, *traceback;
        PyErr_Fetch(&type, &value, &traceback);
        if (!(kwds=PyDict_New())) goto end;
        if (!(argcount=PyLong_FromLong(a))) goto end;
        if (PyDict_SetItemString(kwds, "co_argcount", argcount) != 0) goto end;
        if (!(posonlyargcount=PyLong_FromLong(0))) goto end;
        if (PyDict_SetItemString(kwds, "co_posonlyargcount", posonlyargcount) != 0) goto end;
        if (!(kwonlyargcount=PyLong_FromLong(k))) goto end;
        if (PyDict_SetItemString(kwds, "co_kwonlyargcount", kwonlyargcount) != 0) goto end;
        if (!(nlocals=PyLong_FromLong(l))) goto end;
        if (PyDict_SetItemString(kwds, "co_nlocals", nlocals) != 0) goto end;
        if (!(stacksize=PyLong_FromLong(s))) goto end;
        if (PyDict_SetItemString(kwds, "co_stacksize", stacksize) != 0) goto end;
        if (!(flags=PyLong_FromLong(f))) goto end;
        if (PyDict_SetItemString(kwds, "co_flags", flags) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_code", code) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_consts", c) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_names", n) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_varnames", v) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_freevars", fv) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_cellvars", cell) != 0) goto end;
        if (PyDict_SetItemString(kwds, "co_linetable", lnos) != 0) goto end;
        if (!(fn_cstr=PyUnicode_AsUTF8AndSize(fn, NULL))) goto end;
        if (!(name_cstr=PyUnicode_AsUTF8AndSize(name, NULL))) goto end;
        if (!(co = PyCode_NewEmpty(fn_cstr, name_cstr, fline))) goto end;
        if (!(replace = PyObject_GetAttrString((PyObject*)co, "replace"))) goto cleanup_code_too;
        if (!(empty = PyTuple_New(0))) goto cleanup_code_too; // unfortunately __pyx_empty_tuple isn't available here
        if (!(call_result = PyObject_Call(replace, empty, kwds))) goto cleanup_code_too;
        Py_XDECREF((PyObject*)co);
        co = (PyCodeObject*)call_result;
        call_result = NULL;
        if (0) {
            cleanup_code_too:
            Py_XDECREF((PyObject*)co);
            co = NULL;
        }
        end:
        Py_XDECREF(kwds);
        Py_XDECREF(argcount);
        Py_XDECREF(posonlyargcount);
        Py_XDECREF(kwonlyargcount);
        Py_XDECREF(nlocals);
        Py_XDECREF(stacksize);
        Py_XDECREF(replace);
        Py_XDECREF(call_result);
        Py_XDECREF(empty);
        if (type) {
            PyErr_Restore(type, value, traceback);
        }
        return co;
    }
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #endif
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#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))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #if !defined(_USE_MATH_DEFINES)
    #define _USE_MATH_DEFINES
  #endif
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__gevent___gevent_c_waiter
#define __PYX_HAVE_API__gevent___gevent_c_waiter
/* Early includes */
#include "greenlet/greenlet.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;


static const char *__pyx_f[] = {
  "src/gevent/_waiter.py",
  "src/gevent/_gevent_c_greenlet_primitives.pxd",
  "src/gevent/_gevent_c_waiter.pxd",
};

/*--- Type declarations ---*/
struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet;
struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop;
struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter;
struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter;

/* "gevent/_gevent_c_greenlet_primitives.pxd":37
 *     return PyGreenlet_Switch(self, NULL, NULL)
 * 
 * cdef class TrackedRawGreenlet(greenlet):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet {
  PyGreenlet __pyx_base;
};


/* "gevent/_gevent_c_greenlet_primitives.pxd":40
 *     pass
 * 
 * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet):             # <<<<<<<<<<<<<<
 *     cdef public loop
 * 
 */
struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop {
  struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet __pyx_base;
  struct __pyx_vtabstruct_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtab;
  PyObject *loop;
};


/* "gevent/_gevent_c_waiter.pxd":33
 *         _greenlet_imported = True
 * 
 * cdef class Waiter:             # <<<<<<<<<<<<<<
 *     cdef readonly SwitchOutGreenletWithLoop hub
 *     cdef readonly greenlet greenlet
 */
struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter {
  PyObject_HEAD
  struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_Waiter *__pyx_vtab;
  struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *hub;
  PyGreenlet *greenlet;
  PyObject *value;
  PyObject *_exception;
};


/* "gevent/_gevent_c_waiter.pxd":47
 * @cython.final
 * @cython.internal
 * cdef class MultipleWaiter(Waiter):             # <<<<<<<<<<<<<<
 *     cdef list _values
 */
struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter {
  struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter __pyx_base;
  PyObject *_values;
};



/* "gevent/_gevent_c_greenlet_primitives.pxd":40
 *     pass
 * 
 * cdef class SwitchOutGreenletWithLoop(TrackedRawGreenlet):             # <<<<<<<<<<<<<<
 *     cdef public loop
 * 
 */

struct __pyx_vtabstruct_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop {
  PyObject *(*__pyx_switch)(struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch);
  PyObject *(*switch_out)(struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_vtabptr_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop;


/* "src/gevent/_waiter.py":27
 * 
 * 
 * class Waiter(object):             # <<<<<<<<<<<<<<
 *     """
 *     A low level communication utility for greenlets.
 */

struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_Waiter {
  PyObject *(*get)(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *, int __pyx_skip_dispatch);
  PyObject *(*clear)(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_Waiter *__pyx_vtabptr_6gevent_16_gevent_c_waiter_Waiter;


/* "src/gevent/_waiter.py":169
 * 
 * 
 * class MultipleWaiter(Waiter):             # <<<<<<<<<<<<<<
 *     """
 *     An internal extension of Waiter that can be used if multiple objects
 */

struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_MultipleWaiter {
  struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_Waiter __pyx_base;
};
static struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_vtabptr_6gevent_16_gevent_c_waiter_MultipleWaiter;

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#include "src/gevent/_generated_include/Refnanny_proto_15ced6153cf557fd1cdb04df076266c4.h"
/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* PyDictVersioning.proto */
#include "src/gevent/_generated_include/PyDictVersioning_proto_8a09770275fbc6b86fe19cd4867a8b98.h"
/* PyFunctionFastCall.proto */
#include "src/gevent/_generated_include/PyFunctionFastCall_proto_3d389cf56351dc4790395d3a0ff4d420.h"
/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#include "src/gevent/_generated_include/PyErrFetchRestore_proto_f5b608c9d62e186919b043c0bda58a65.h"
/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* pop_index.proto */
#include "src/gevent/_generated_include/pop_index_proto_29dbd732b507c9b25ab2ec5dd4490f93.h"
/* TypeImport.proto */
#ifndef __PYX_HAVE_RT_ImportType_proto
#define __PYX_HAVE_RT_ImportType_proto
enum __Pyx_ImportType_CheckSize {
   __Pyx_ImportType_CheckSize_Error = 0,
   __Pyx_ImportType_CheckSize_Warn = 1,
   __Pyx_ImportType_CheckSize_Ignore = 2
};
static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
#endif

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyObject *dict);

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunctionShared.proto */
#include "src/gevent/_generated_include/CythonFunctionShared_proto_afd4def0d49c59c274a509a473d2edc2.h"
/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* GetModuleGlobalName.proto */
#include "src/gevent/_generated_include/GetModuleGlobalName_proto_6c1f1b712d98e8ec6a52d32f9e4c07ba.h"
/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* Globals.proto */
static PyObject* __Pyx_Globals(void);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* GCCDiagnostics.proto */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* VoidPtrExport.proto */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig);

/* VoidPtrImport.proto */
static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig);

/* FunctionImport.proto */
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static PyObject *__pyx_f_6gevent_16_gevent_c_waiter_6Waiter_clear(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6gevent_16_gevent_c_waiter_6Waiter_get(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6gevent_16_gevent_c_waiter_14MultipleWaiter_get(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch); /* proto*/

/* Module declarations from 'cython' */

/* Module declarations from 'greenlet' */

/* Module declarations from 'gevent._gevent_c_greenlet_primitives' */
static PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet = 0;
static PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet = 0;
static PyTypeObject *__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop = 0;
static PyObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_get_objects = 0;
#define __pyx_v_6gevent_29_gevent_c_greenlet_primitives_get_objects (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_get_objects)
static PyObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_wref = 0;
#define __pyx_v_6gevent_29_gevent_c_greenlet_primitives_wref (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_wref)
static PyObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_BlockingSwitchOutError = 0;
#define __pyx_v_6gevent_29_gevent_c_greenlet_primitives_BlockingSwitchOutError (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives_BlockingSwitchOutError)
static int *__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported = 0;
#define __pyx_v_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported)
static PyTypeObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__memoryview = 0;
#define __pyx_v_6gevent_29_gevent_c_greenlet_primitives__memoryview (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__memoryview)
static PyTypeObject **__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__buffer = 0;
#define __pyx_v_6gevent_29_gevent_c_greenlet_primitives__buffer (*__pyx_vp_6gevent_29_gevent_c_greenlet_primitives__buffer)

/* Module declarations from 'gevent._gevent_c_hub_local' */
static PyObject **__pyx_vp_6gevent_19_gevent_c_hub_local__threadlocal = 0;
#define __pyx_v_6gevent_19_gevent_c_hub_local__threadlocal (*__pyx_vp_6gevent_19_gevent_c_hub_local__threadlocal)
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*/

/* Module declarations from 'gevent._gevent_c_waiter' */
static PyTypeObject *__pyx_ptype_6gevent_16_gevent_c_waiter_greenlet = 0;
static PyTypeObject *__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter = 0;
static PyTypeObject *__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter = 0;
static PyObject *__pyx_v_6gevent_16_gevent_c_waiter_sys = 0;
static PyObject *__pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError = 0;
static int __pyx_v_6gevent_16_gevent_c_waiter__greenlet_imported;
static PyObject *__pyx_v_6gevent_16_gevent_c_waiter__NONE = 0;
static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_16_gevent_c_waiter_getcurrent(void); /*proto*/
static CYTHON_INLINE void __pyx_f_6gevent_16_gevent_c_waiter_greenlet_init(void); /*proto*/
#define __Pyx_MODULE_NAME "gevent._gevent_c_waiter"
extern int __pyx_module_is_main_gevent___gevent_c_waiter;
int __pyx_module_is_main_gevent___gevent_c_waiter = 0;

/* Implementation of 'gevent._gevent_c_waiter' */
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_AssertionError;
static const char __pyx_k_all[] = "__all__";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_hub[] = "hub";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_NONE[] = "_NONE";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_ready[] = "ready";
static const char __pyx_k_slots[] = "__slots__";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_Waiter[] = "Waiter";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_init_2[] = "_init";
static const char __pyx_k_lambda[] = "<lambda>";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_source[] = "source";
static const char __pyx_k_switch[] = "switch";
static const char __pyx_k_values[] = "_values";
static const char __pyx_k_exc_info[] = "exc_info";
static const char __pyx_k_greenlet[] = "greenlet";
static const char __pyx_k_pyx_capi[] = "__pyx_capi__";
static const char __pyx_k_exception[] = "exception";
static const char __pyx_k_Waiter_get[] = "Waiter.get";
static const char __pyx_k_getcurrent[] = "getcurrent";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_successful[] = "successful";
static const char __pyx_k_throw_args[] = "throw_args";
static const char __pyx_k_exception_2[] = "_exception";
static const char __pyx_k_switch_args[] = "switch_args";
static const char __pyx_k_Waiter_clear[] = "Waiter.clear";
static const char __pyx_k_Waiter_ready[] = "Waiter.ready";
static const char __pyx_k_Waiter_throw[] = "Waiter.throw";
static const char __pyx_k_gevent__util[] = "gevent._util";
static const char __pyx_k_handle_error[] = "handle_error";
static const char __pyx_k_s_greenlet_s[] = "<%s greenlet=%s>";
static const char __pyx_k_Waiter_switch[] = "Waiter.switch";
static const char __pyx_k_greenlet_init[] = "greenlet_init";
static const char __pyx_k_AssertionError[] = "AssertionError";
static const char __pyx_k_MultipleWaiter[] = "MultipleWaiter";
static const char __pyx_k_get_hub_noargs[] = "get_hub_noargs";
static const char __pyx_k_import_c_accel[] = "import_c_accel";
static const char __pyx_k_gevent___waiter[] = "gevent.__waiter";
static const char __pyx_k_Waiter_successful[] = "Waiter.successful";
static const char __pyx_k_gevent__hub_local[] = "gevent._hub_local";
static const char __pyx_k_gevent_exceptions[] = "gevent.exceptions";
static const char __pyx_k_greenlet_imported[] = "_greenlet_imported";
static const char __pyx_k_MultipleWaiter_get[] = "MultipleWaiter.get";
static const char __pyx_k_Waiter_switch_args[] = "Waiter.switch_args";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_s_greenlet_s_value_r[] = "<%s greenlet=%s value=%r>";
static const char __pyx_k_MultipleWaiter_switch[] = "MultipleWaiter.switch";
static const char __pyx_k_src_gevent__waiter_py[] = "src/gevent/_waiter.py";
static const char __pyx_k_gevent__gevent_c_waiter[] = "gevent._gevent_c_waiter";
static const char __pyx_k_s_greenlet_s_exc_info_r[] = "<%s greenlet=%s exc_info=%r>";
static const char __pyx_k_ConcurrentObjectUseError[] = "ConcurrentObjectUseError";
static const char __pyx_k_Low_level_waiting_primitives[] = "\nLow-level waiting primitives.\n\n";
static const char __pyx_k_Can_only_use_Waiter_switch_metho[] = "Can only use Waiter.switch method from the Hub greenlet";
static const char __pyx_k_This_Waiter_is_already_used_by_r[] = "This Waiter is already used by %r";
static PyObject *__pyx_n_s_AssertionError;
static PyObject *__pyx_kp_s_Can_only_use_Waiter_switch_metho;
static PyObject *__pyx_n_s_ConcurrentObjectUseError;
static PyObject *__pyx_n_s_MultipleWaiter;
static PyObject *__pyx_n_s_MultipleWaiter_get;
static PyObject *__pyx_n_s_MultipleWaiter_switch;
static PyObject *__pyx_n_s_NONE;
static PyObject *__pyx_kp_s_This_Waiter_is_already_used_by_r;
static PyObject *__pyx_n_s_Waiter;
static PyObject *__pyx_n_s_Waiter_clear;
static PyObject *__pyx_n_s_Waiter_get;
static PyObject *__pyx_n_s_Waiter_ready;
static PyObject *__pyx_n_s_Waiter_successful;
static PyObject *__pyx_n_s_Waiter_switch;
static PyObject *__pyx_n_s_Waiter_switch_args;
static PyObject *__pyx_n_s_Waiter_throw;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_exc_info;
static PyObject *__pyx_n_s_exception;
static PyObject *__pyx_n_s_exception_2;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_hub_noargs;
static PyObject *__pyx_n_s_getcurrent;
static PyObject *__pyx_kp_s_gevent___waiter;
static PyObject *__pyx_n_s_gevent__gevent_c_waiter;
static PyObject *__pyx_n_s_gevent__hub_local;
static PyObject *__pyx_n_s_gevent__util;
static PyObject *__pyx_n_s_gevent_exceptions;
static PyObject *__pyx_n_s_greenlet;
static PyObject *__pyx_n_s_greenlet_imported;
static PyObject *__pyx_n_s_greenlet_init;
static PyObject *__pyx_n_s_handle_error;
static PyObject *__pyx_n_s_hub;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_import_c_accel;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_init_2;
static PyObject *__pyx_n_s_lambda;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_pyx_capi;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_ready;
static PyObject *__pyx_kp_s_s_greenlet_s;
static PyObject *__pyx_kp_s_s_greenlet_s_exc_info_r;
static PyObject *__pyx_kp_s_s_greenlet_s_value_r;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_slots;
static PyObject *__pyx_n_s_source;
static PyObject *__pyx_kp_s_src_gevent__waiter_py;
static PyObject *__pyx_n_s_successful;
static PyObject *__pyx_n_s_switch;
static PyObject *__pyx_n_s_switch_args;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_throw_args;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_lambda_funcdef_6gevent_16_gevent_c_waiter_lambda(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter___init__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_2clear(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_4__str__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_6ready(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8successful(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8exc_info___get__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_10switch(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_12switch_args(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_14throw(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_throw_args); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_16get(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_18__call__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_source); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_3hub___get__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8greenlet___get__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_5value___get__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter___init__(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_hub); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter_2switch(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter_4get(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter__init(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_tp_new_6gevent_16_gevent_c_waiter_Waiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_16_gevent_c_waiter_MultipleWaiter(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_codeobj__4;
static PyObject *__pyx_codeobj__6;
static PyObject *__pyx_codeobj__8;
static PyObject *__pyx_codeobj__10;
static PyObject *__pyx_codeobj__12;
static PyObject *__pyx_codeobj__14;
static PyObject *__pyx_codeobj__16;
static PyObject *__pyx_codeobj__18;
static PyObject *__pyx_codeobj__20;
static PyObject *__pyx_codeobj__21;
/* Late includes */

/* "src/gevent/_waiter.py":24
 * 
 * locals()['getcurrent'] = __import__('greenlet').getcurrent
 * locals()['greenlet_init'] = lambda: None             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_2lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_2lambda, METH_NOARGS, 0};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_2lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
  __pyx_r = __pyx_lambda_funcdef_6gevent_16_gevent_c_waiter_lambda(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_lambda_funcdef_6gevent_16_gevent_c_waiter_lambda(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lambda", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":73
 *     __slots__ = ['hub', 'greenlet', 'value', '_exception']
 * 
 *     def __init__(self, hub=None):             # <<<<<<<<<<<<<<
 *         self.hub = get_hub() if hub is None else hub
 *         self.greenlet = None
 */

/* Python wrapper */
static int __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_hub = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_hub = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter___init__(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self), __pyx_v_hub);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter___init__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_hub) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "src/gevent/_waiter.py":74
 * 
 *     def __init__(self, hub=None):
 *         self.hub = get_hub() if hub is None else hub             # <<<<<<<<<<<<<<
 *         self.greenlet = None
 *         self.value = None
 */
  __pyx_t_2 = (__pyx_v_hub == Py_None);
  if ((__pyx_t_2 != 0)) {
    __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
  } else {
    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, 74, __pyx_L1_error)
    __Pyx_INCREF(__pyx_v_hub);
    __pyx_t_1 = __pyx_v_hub;
  }
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->hub);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->hub));
  __pyx_v_self->hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":75
 *     def __init__(self, hub=None):
 *         self.hub = get_hub() if hub is None else hub
 *         self.greenlet = None             # <<<<<<<<<<<<<<
 *         self.value = None
 *         self._exception = _NONE
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->greenlet);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
  __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);

  /* "src/gevent/_waiter.py":76
 *         self.hub = get_hub() if hub is None else hub
 *         self.greenlet = None
 *         self.value = None             # <<<<<<<<<<<<<<
 *         self._exception = _NONE
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->value);
  __Pyx_DECREF(__pyx_v_self->value);
  __pyx_v_self->value = Py_None;

  /* "src/gevent/_waiter.py":77
 *         self.greenlet = None
 *         self.value = None
 *         self._exception = _NONE             # <<<<<<<<<<<<<<
 * 
 *     def clear(self):
 */
  __Pyx_INCREF(__pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __Pyx_GIVEREF(__pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __Pyx_GOTREF(__pyx_v_self->_exception);
  __Pyx_DECREF(__pyx_v_self->_exception);
  __pyx_v_self->_exception = __pyx_v_6gevent_16_gevent_c_waiter__NONE;

  /* "src/gevent/_waiter.py":73
 *     __slots__ = ['hub', 'greenlet', 'value', '_exception']
 * 
 *     def __init__(self, hub=None):             # <<<<<<<<<<<<<<
 *         self.hub = get_hub() if hub is None else hub
 *         self.greenlet = None
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":79
 *         self._exception = _NONE
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self.greenlet = None
 *         self.value = None
 */

static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6gevent_16_gevent_c_waiter_6Waiter_clear(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3clear)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "src/gevent/_waiter.py":80
 * 
 *     def clear(self):
 *         self.greenlet = None             # <<<<<<<<<<<<<<
 *         self.value = None
 *         self._exception = _NONE
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->greenlet);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
  __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);

  /* "src/gevent/_waiter.py":81
 *     def clear(self):
 *         self.greenlet = None
 *         self.value = None             # <<<<<<<<<<<<<<
 *         self._exception = _NONE
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->value);
  __Pyx_DECREF(__pyx_v_self->value);
  __pyx_v_self->value = Py_None;

  /* "src/gevent/_waiter.py":82
 *         self.greenlet = None
 *         self.value = None
 *         self._exception = _NONE             # <<<<<<<<<<<<<<
 * 
 *     def __str__(self):
 */
  __Pyx_INCREF(__pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __Pyx_GIVEREF(__pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __Pyx_GOTREF(__pyx_v_self->_exception);
  __Pyx_DECREF(__pyx_v_self->_exception);
  __pyx_v_self->_exception = __pyx_v_6gevent_16_gevent_c_waiter__NONE;

  /* "src/gevent/_waiter.py":79
 *         self._exception = _NONE
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self.greenlet = None
 *         self.value = None
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_2clear[] = "Waiter.clear(self)";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_3clear = {"clear", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3clear, METH_NOARGS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_2clear};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_2clear(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_2clear(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_16_gevent_c_waiter_6Waiter_clear(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":84
 *         self._exception = _NONE
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if self._exception is _NONE:
 *             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_5__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_5__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_4__str__(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_4__str__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "src/gevent/_waiter.py":85
 * 
 *     def __str__(self):
 *         if self._exception is _NONE:             # <<<<<<<<<<<<<<
 *             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
 *         if self._exception is None:
 */
  __pyx_t_1 = (__pyx_v_self->_exception == __pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "src/gevent/_waiter.py":86
 *     def __str__(self):
 *         if self._exception is _NONE:
 *             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)             # <<<<<<<<<<<<<<
 *         if self._exception is None:
 *             return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet));
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "src/gevent/_waiter.py":85
 * 
 *     def __str__(self):
 *         if self._exception is _NONE:             # <<<<<<<<<<<<<<
 *             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
 *         if self._exception is None:
 */
  }

  /* "src/gevent/_waiter.py":87
 *         if self._exception is _NONE:
 *             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
 *         if self._exception is None:             # <<<<<<<<<<<<<<
 *             return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value)
 *         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
 */
  __pyx_t_2 = (__pyx_v_self->_exception == Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "src/gevent/_waiter.py":88
 *             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
 *         if self._exception is None:
 *             return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value)             # <<<<<<<<<<<<<<
 *         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
    PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_v_self->greenlet));
    __Pyx_INCREF(__pyx_v_self->value);
    __Pyx_GIVEREF(__pyx_v_self->value);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_self->value);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_value_r, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "src/gevent/_waiter.py":87
 *         if self._exception is _NONE:
 *             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
 *         if self._exception is None:             # <<<<<<<<<<<<<<
 *             return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value)
 *         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
 */
  }

  /* "src/gevent/_waiter.py":89
 *         if self._exception is None:
 *             return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value)
 *         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)             # <<<<<<<<<<<<<<
 * 
 *     def ready(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_exc_info); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_v_self->greenlet));
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_greenlet_s_exc_info_r, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "src/gevent/_waiter.py":84
 *         self._exception = _NONE
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 *         if self._exception is _NONE:
 *             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":91
 *         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
 * 
 *     def ready(self):             # <<<<<<<<<<<<<<
 *         """Return true if and only if it holds a value or an exception"""
 *         return self._exception is not _NONE
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_6ready[] = "Waiter.ready(self)\nReturn true if and only if it holds a value or an exception";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_7ready = {"ready", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_7ready, METH_NOARGS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_6ready};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ready (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_6ready(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_6ready(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("ready", 0);

  /* "src/gevent/_waiter.py":93
 *     def ready(self):
 *         """Return true if and only if it holds a value or an exception"""
 *         return self._exception is not _NONE             # <<<<<<<<<<<<<<
 * 
 *     def successful(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/gevent/_waiter.py":91
 *         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
 * 
 *     def ready(self):             # <<<<<<<<<<<<<<
 *         """Return true if and only if it holds a value or an exception"""
 *         return self._exception is not _NONE
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":95
 *         return self._exception is not _NONE
 * 
 *     def successful(self):             # <<<<<<<<<<<<<<
 *         """Return true if and only if it is ready and holds a value"""
 *         return self._exception is None
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_8successful[] = "Waiter.successful(self)\nReturn true if and only if it is ready and holds a value";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_9successful = {"successful", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_9successful, METH_NOARGS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_8successful};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("successful (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8successful(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8successful(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("successful", 0);

  /* "src/gevent/_waiter.py":97
 *     def successful(self):
 *         """Return true if and only if it is ready and holds a value"""
 *         return self._exception is None             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__pyx_v_self->_exception == Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 97, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "src/gevent/_waiter.py":95
 *         return self._exception is not _NONE
 * 
 *     def successful(self):             # <<<<<<<<<<<<<<
 *         """Return true if and only if it is ready and holds a value"""
 *         return self._exception is None
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.successful", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":100
 * 
 *     @property
 *     def exc_info(self):             # <<<<<<<<<<<<<<
 *         "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``."
 *         if self._exception is not _NONE:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_8exc_info_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8exc_info___get__(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8exc_info___get__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "src/gevent/_waiter.py":102
 *     def exc_info(self):
 *         "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``."
 *         if self._exception is not _NONE:             # <<<<<<<<<<<<<<
 *             return self._exception
 * 
 */
  __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "src/gevent/_waiter.py":103
 *         "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``."
 *         if self._exception is not _NONE:
 *             return self._exception             # <<<<<<<<<<<<<<
 * 
 *     def switch(self, value):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->_exception);
    __pyx_r = __pyx_v_self->_exception;
    goto __pyx_L0;

    /* "src/gevent/_waiter.py":102
 *     def exc_info(self):
 *         "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``."
 *         if self._exception is not _NONE:             # <<<<<<<<<<<<<<
 *             return self._exception
 * 
 */
  }

  /* "src/gevent/_waiter.py":100
 * 
 *     @property
 *     def exc_info(self):             # <<<<<<<<<<<<<<
 *         "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``."
 *         if self._exception is not _NONE:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":105
 *             return self._exception
 * 
 *     def switch(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Switch to the greenlet if one's available. Otherwise store the
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_10switch[] = "Waiter.switch(self, value)\n\n        Switch to the greenlet if one's available. Otherwise store the\n        *value*.\n\n        .. versionchanged:: 1.3b1\n           The *value* is no longer optional.\n        ";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_11switch = {"switch", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_11switch, METH_O, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_10switch};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("switch (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_10switch(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_10switch(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_value) {
  PyGreenlet *__pyx_v_greenlet = NULL;
  PyObject *__pyx_v_switch = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("switch", 0);

  /* "src/gevent/_waiter.py":113
 *            The *value* is no longer optional.
 *         """
 *         greenlet = self.greenlet             # <<<<<<<<<<<<<<
 *         if greenlet is None:
 *             self.value = value
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":114
 *         """
 *         greenlet = self.greenlet
 *         if greenlet is None:             # <<<<<<<<<<<<<<
 *             self.value = value
 *             self._exception = None
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "src/gevent/_waiter.py":115
 *         greenlet = self.greenlet
 *         if greenlet is None:
 *             self.value = value             # <<<<<<<<<<<<<<
 *             self._exception = None
 *         else:
 */
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __Pyx_GOTREF(__pyx_v_self->value);
    __Pyx_DECREF(__pyx_v_self->value);
    __pyx_v_self->value = __pyx_v_value;

    /* "src/gevent/_waiter.py":116
 *         if greenlet is None:
 *             self.value = value
 *             self._exception = None             # <<<<<<<<<<<<<<
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_self->_exception);
    __Pyx_DECREF(__pyx_v_self->_exception);
    __pyx_v_self->_exception = Py_None;

    /* "src/gevent/_waiter.py":114
 *         """
 *         greenlet = self.greenlet
 *         if greenlet is None:             # <<<<<<<<<<<<<<
 *             self.value = value
 *             self._exception = None
 */
    goto __pyx_L3;
  }

  /* "src/gevent/_waiter.py":118
 *             self._exception = None
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable             # <<<<<<<<<<<<<<
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             switch = greenlet.switch
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_16_gevent_c_waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "src/gevent/_waiter.py":119
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")             # <<<<<<<<<<<<<<
 *             switch = greenlet.switch
 *             try:
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 119, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 119, __pyx_L1_error)

      /* "src/gevent/_waiter.py":118
 *             self._exception = None
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable             # <<<<<<<<<<<<<<
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             switch = greenlet.switch
 */
    }

    /* "src/gevent/_waiter.py":120
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             switch = greenlet.switch             # <<<<<<<<<<<<<<
 *             try:
 *                 switch(value)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_switch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_switch = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "src/gevent/_waiter.py":121
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             switch = greenlet.switch
 *             try:             # <<<<<<<<<<<<<<
 *                 switch(value)
 *             except: # pylint:disable=bare-except
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "src/gevent/_waiter.py":122
 *             switch = greenlet.switch
 *             try:
 *                 switch(value)             # <<<<<<<<<<<<<<
 *             except: # pylint:disable=bare-except
 *                 self.hub.handle_error(switch, *sys.exc_info())
 */
        __Pyx_INCREF(__pyx_v_switch);
        __pyx_t_7 = __pyx_v_switch; __pyx_t_8 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_value);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "src/gevent/_waiter.py":121
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             switch = greenlet.switch
 *             try:             # <<<<<<<<<<<<<<
 *                 switch(value)
 *             except: # pylint:disable=bare-except
 */
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L10_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "src/gevent/_waiter.py":123
 *             try:
 *                 switch(value)
 *             except: # pylint:disable=bare-except             # <<<<<<<<<<<<<<
 *                 self.hub.handle_error(switch, *sys.exc_info())
 * 
 */
      /*except:*/ {
        __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 123, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_8);

        /* "src/gevent/_waiter.py":124
 *                 switch(value)
 *             except: # pylint:disable=bare-except
 *                 self.hub.handle_error(switch, *sys.exc_info())             # <<<<<<<<<<<<<<
 * 
 *     def switch_args(self, *args):
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 124, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 124, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_switch);
        __Pyx_GIVEREF(__pyx_v_switch);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_switch);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16_gevent_c_waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 124, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 124, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 124, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L6_exception_handled;
      }
      __pyx_L7_except_error:;

      /* "src/gevent/_waiter.py":121
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             switch = greenlet.switch
 *             try:             # <<<<<<<<<<<<<<
 *                 switch(value)
 *             except: # pylint:disable=bare-except
 */
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L10_try_end:;
    }
  }
  __pyx_L3:;

  /* "src/gevent/_waiter.py":105
 *             return self._exception
 * 
 *     def switch(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Switch to the greenlet if one's available. Otherwise store the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
  __Pyx_XDECREF(__pyx_v_switch);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":126
 *                 self.hub.handle_error(switch, *sys.exc_info())
 * 
 *     def switch_args(self, *args):             # <<<<<<<<<<<<<<
 *         return self.switch(args)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_12switch_args[] = "Waiter.switch_args(self, *args)";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_13switch_args = {"switch_args", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_13switch_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_12switch_args};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_13switch_args(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("switch_args (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "switch_args", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_12switch_args(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self), __pyx_v_args);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_12switch_args(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("switch_args", 0);

  /* "src/gevent/_waiter.py":127
 * 
 *     def switch_args(self, *args):
 *         return self.switch(args)             # <<<<<<<<<<<<<<
 * 
 *     def throw(self, *throw_args):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_args) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_args);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "src/gevent/_waiter.py":126
 *                 self.hub.handle_error(switch, *sys.exc_info())
 * 
 *     def switch_args(self, *args):             # <<<<<<<<<<<<<<
 *         return self.switch(args)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.switch_args", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":129
 *         return self.switch(args)
 * 
 *     def throw(self, *throw_args):             # <<<<<<<<<<<<<<
 *         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
 *         greenlet = self.greenlet
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_14throw[] = "Waiter.throw(self, *throw_args)\nSwitch to the greenlet with the exception. If there's no greenlet, store the exception.";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_15throw = {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_15throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_14throw};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_throw_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("throw (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "throw", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_throw_args = __pyx_args;
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_14throw(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self), __pyx_v_throw_args);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_throw_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_14throw(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_throw_args) {
  PyGreenlet *__pyx_v_greenlet = NULL;
  PyObject *__pyx_v_throw = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("throw", 0);

  /* "src/gevent/_waiter.py":131
 *     def throw(self, *throw_args):
 *         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
 *         greenlet = self.greenlet             # <<<<<<<<<<<<<<
 *         if greenlet is None:
 *             self._exception = throw_args
 */
  __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet);
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":132
 *         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
 *         greenlet = self.greenlet
 *         if greenlet is None:             # <<<<<<<<<<<<<<
 *             self._exception = throw_args
 *         else:
 */
  __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "src/gevent/_waiter.py":133
 *         greenlet = self.greenlet
 *         if greenlet is None:
 *             self._exception = throw_args             # <<<<<<<<<<<<<<
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
 */
    __Pyx_INCREF(__pyx_v_throw_args);
    __Pyx_GIVEREF(__pyx_v_throw_args);
    __Pyx_GOTREF(__pyx_v_self->_exception);
    __Pyx_DECREF(__pyx_v_self->_exception);
    __pyx_v_self->_exception = __pyx_v_throw_args;

    /* "src/gevent/_waiter.py":132
 *         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
 *         greenlet = self.greenlet
 *         if greenlet is None:             # <<<<<<<<<<<<<<
 *             self._exception = throw_args
 *         else:
 */
    goto __pyx_L3;
  }

  /* "src/gevent/_waiter.py":135
 *             self._exception = throw_args
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable             # <<<<<<<<<<<<<<
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             throw = greenlet.throw
 */
  /*else*/ {
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_16_gevent_c_waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub));
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "src/gevent/_waiter.py":136
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")             # <<<<<<<<<<<<<<
 *             throw = greenlet.throw
 *             try:
 */
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_AssertionError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_Raise(__pyx_t_1, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __PYX_ERR(0, 136, __pyx_L1_error)

      /* "src/gevent/_waiter.py":135
 *             self._exception = throw_args
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable             # <<<<<<<<<<<<<<
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             throw = greenlet.throw
 */
    }

    /* "src/gevent/_waiter.py":137
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             throw = greenlet.throw             # <<<<<<<<<<<<<<
 *             try:
 *                 throw(*throw_args)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_n_s_throw); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_throw = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "src/gevent/_waiter.py":138
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             throw = greenlet.throw
 *             try:             # <<<<<<<<<<<<<<
 *                 throw(*throw_args)
 *             except: # pylint:disable=bare-except
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
      __Pyx_XGOTREF(__pyx_t_4);
      __Pyx_XGOTREF(__pyx_t_5);
      __Pyx_XGOTREF(__pyx_t_6);
      /*try:*/ {

        /* "src/gevent/_waiter.py":139
 *             throw = greenlet.throw
 *             try:
 *                 throw(*throw_args)             # <<<<<<<<<<<<<<
 *             except: # pylint:disable=bare-except
 *                 self.hub.handle_error(throw, *sys.exc_info())
 */
        __pyx_t_1 = __Pyx_PyObject_Call(__pyx_v_throw, __pyx_v_throw_args, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "src/gevent/_waiter.py":138
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             throw = greenlet.throw
 *             try:             # <<<<<<<<<<<<<<
 *                 throw(*throw_args)
 *             except: # pylint:disable=bare-except
 */
      }
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      goto __pyx_L10_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "src/gevent/_waiter.py":140
 *             try:
 *                 throw(*throw_args)
 *             except: # pylint:disable=bare-except             # <<<<<<<<<<<<<<
 *                 self.hub.handle_error(throw, *sys.exc_info())
 * 
 */
      /*except:*/ {
        __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(0, 140, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_GOTREF(__pyx_t_8);

        /* "src/gevent/_waiter.py":141
 *                 throw(*throw_args)
 *             except: # pylint:disable=bare-except
 *                 self.hub.handle_error(throw, *sys.exc_info())             # <<<<<<<<<<<<<<
 * 
 *     def get(self):
 */
        __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 141, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PyTuple_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 141, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_INCREF(__pyx_v_throw);
        __Pyx_GIVEREF(__pyx_v_throw);
        PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_throw);
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_6gevent_16_gevent_c_waiter_sys, __pyx_n_s_exc_info); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        __pyx_t_11 = (__pyx_t_13) ? __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallNoArg(__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PySequence_Tuple(__pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyNumber_Add(__pyx_t_10, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 141, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L6_exception_handled;
      }
      __pyx_L7_except_error:;

      /* "src/gevent/_waiter.py":138
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")
 *             throw = greenlet.throw
 *             try:             # <<<<<<<<<<<<<<
 *                 throw(*throw_args)
 *             except: # pylint:disable=bare-except
 */
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_4);
      __Pyx_XGIVEREF(__pyx_t_5);
      __Pyx_XGIVEREF(__pyx_t_6);
      __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
      __pyx_L10_try_end:;
    }
  }
  __pyx_L3:;

  /* "src/gevent/_waiter.py":129
 *         return self.switch(args)
 * 
 *     def throw(self, *throw_args):             # <<<<<<<<<<<<<<
 *         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
 *         greenlet = self.greenlet
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_greenlet);
  __Pyx_XDECREF(__pyx_v_throw);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":143
 *                 self.hub.handle_error(throw, *sys.exc_info())
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
 *         if self._exception is not _NONE:
 */

static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6gevent_16_gevent_c_waiter_6Waiter_get(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  char const *__pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely((Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0) || (Py_TYPE(((PyObject *)__pyx_v_self))->tp_flags & (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))) {
    #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    static PY_UINT64_T __pyx_tp_dict_version = __PYX_DICT_VERSION_INIT, __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
    if (unlikely(!__Pyx_object_dict_version_matches(((PyObject *)__pyx_v_self), __pyx_tp_dict_version, __pyx_obj_dict_version))) {
      PY_UINT64_T __pyx_type_dict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      #endif
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)(void*)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_17get)) {
        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
          __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
          if (likely(__pyx_t_4)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
            __Pyx_INCREF(__pyx_t_4);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_3, function);
          }
        }
        __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        goto __pyx_L0;
      }
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
      __pyx_tp_dict_version = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
      __pyx_obj_dict_version = __Pyx_get_object_dict_version(((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_type_dict_guard != __pyx_tp_dict_version)) {
        __pyx_tp_dict_version = __pyx_obj_dict_version = __PYX_DICT_VERSION_INIT;
      }
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
    }
    #endif
  }

  /* "src/gevent/_waiter.py":145
 *     def get(self):
 *         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
 *         if self._exception is not _NONE:             # <<<<<<<<<<<<<<
 *             if self._exception is None:
 *                 return self.value
 */
  __pyx_t_5 = (__pyx_v_self->_exception != __pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {

    /* "src/gevent/_waiter.py":146
 *         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
 *         if self._exception is not _NONE:
 *             if self._exception is None:             # <<<<<<<<<<<<<<
 *                 return self.value
 *             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable
 */
    __pyx_t_6 = (__pyx_v_self->_exception == Py_None);
    __pyx_t_5 = (__pyx_t_6 != 0);
    if (__pyx_t_5) {

      /* "src/gevent/_waiter.py":147
 *         if self._exception is not _NONE:
 *             if self._exception is None:
 *                 return self.value             # <<<<<<<<<<<<<<
 *             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable
 *         else:
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_self->value);
      __pyx_r = __pyx_v_self->value;
      goto __pyx_L0;

      /* "src/gevent/_waiter.py":146
 *         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
 *         if self._exception is not _NONE:
 *             if self._exception is None:             # <<<<<<<<<<<<<<
 *                 return self.value
 *             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable
 */
    }

    /* "src/gevent/_waiter.py":148
 *             if self._exception is None:
 *                 return self.value
 *             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable             # <<<<<<<<<<<<<<
 *         else:
 *             if self.greenlet is not None:
 */
    __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_16_gevent_c_waiter_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_throw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PySequence_Tuple(__pyx_v_self->_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "src/gevent/_waiter.py":145
 *     def get(self):
 *         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
 *         if self._exception is not _NONE:             # <<<<<<<<<<<<<<
 *             if self._exception is None:
 *                 return self.value
 */
    goto __pyx_L3;
  }

  /* "src/gevent/_waiter.py":150
 *             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable
 *         else:
 *             if self.greenlet is not None:             # <<<<<<<<<<<<<<
 *                 raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, ))
 *             self.greenlet = getcurrent() # pylint:disable=undefined-variable
 */
  /*else*/ {
    __pyx_t_5 = (((PyObject *)__pyx_v_self->greenlet) != Py_None);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (unlikely(__pyx_t_6)) {

      /* "src/gevent/_waiter.py":151
 *         else:
 *             if self.greenlet is not None:
 *                 raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, ))             # <<<<<<<<<<<<<<
 *             self.greenlet = getcurrent() # pylint:disable=undefined-variable
 *             try:
 */
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self->greenlet));
      PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self->greenlet));
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_This_Waiter_is_already_used_by_r, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_INCREF(__pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError);
      __pyx_t_1 = __pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_t_2) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2);
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 151, __pyx_L1_error)

      /* "src/gevent/_waiter.py":150
 *             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable
 *         else:
 *             if self.greenlet is not None:             # <<<<<<<<<<<<<<
 *                 raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, ))
 *             self.greenlet = getcurrent() # pylint:disable=undefined-variable
 */
    }

    /* "src/gevent/_waiter.py":152
 *             if self.greenlet is not None:
 *                 raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, ))
 *             self.greenlet = getcurrent() # pylint:disable=undefined-variable             # <<<<<<<<<<<<<<
 *             try:
 *                 return self.hub.switch()
 */
    __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_16_gevent_c_waiter_getcurrent()); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->greenlet);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
    __pyx_v_self->greenlet = ((PyGreenlet *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "src/gevent/_waiter.py":153
 *                 raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, ))
 *             self.greenlet = getcurrent() # pylint:disable=undefined-variable
 *             try:             # <<<<<<<<<<<<<<
 *                 return self.hub.switch()
 *             finally:
 */
    /*try:*/ {

      /* "src/gevent/_waiter.py":154
 *             self.greenlet = getcurrent() # pylint:disable=undefined-variable
 *             try:
 *                 return self.hub.switch()             # <<<<<<<<<<<<<<
 *             finally:
 *                 self.greenlet = None
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_v_self->hub->__pyx_vtab)->__pyx_switch(__pyx_v_self->hub, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L6_return;
    }

    /* "src/gevent/_waiter.py":156
 *                 return self.hub.switch()
 *             finally:
 *                 self.greenlet = None             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, source):
 */
    /*finally:*/ {
      __pyx_L7_error:;
      /*exception exit:*/{
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
        __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
        if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_10);
        __Pyx_XGOTREF(__pyx_t_11);
        __Pyx_XGOTREF(__pyx_t_12);
        __Pyx_XGOTREF(__pyx_t_13);
        __Pyx_XGOTREF(__pyx_t_14);
        __Pyx_XGOTREF(__pyx_t_15);
        __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
        {
          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          __Pyx_GOTREF(__pyx_v_self->greenlet);
          __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
          __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
        }
        if (PY_MAJOR_VERSION >= 3) {
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
        }
        __Pyx_XGIVEREF(__pyx_t_10);
        __Pyx_XGIVEREF(__pyx_t_11);
        __Pyx_XGIVEREF(__pyx_t_12);
        __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
        __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
        __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
        goto __pyx_L1_error;
      }
      __pyx_L6_return: {
        __pyx_t_15 = __pyx_r;
        __pyx_r = 0;
        __Pyx_INCREF(Py_None);
        __Pyx_GIVEREF(Py_None);
        __Pyx_GOTREF(__pyx_v_self->greenlet);
        __Pyx_DECREF(((PyObject *)__pyx_v_self->greenlet));
        __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
        __pyx_r = __pyx_t_15;
        __pyx_t_15 = 0;
        goto __pyx_L0;
      }
    }
  }
  __pyx_L3:;

  /* "src/gevent/_waiter.py":143
 *                 self.hub.handle_error(throw, *sys.exc_info())
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
 *         if self._exception is not _NONE:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_16get[] = "Waiter.get(self)\nIf a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called.";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_17get = {"get", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_17get, METH_NOARGS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_16get};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_17get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_16get(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_16get(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_16_gevent_c_waiter_6Waiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":158
 *                 self.greenlet = None
 * 
 *     def __call__(self, source):             # <<<<<<<<<<<<<<
 *         if source.exception is None:
 *             self.switch(source.value)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_19__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_source = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_source,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_source)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 158, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_source = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 158, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_18__call__(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self), __pyx_v_source);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_18__call__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "src/gevent/_waiter.py":159
 * 
 *     def __call__(self, source):
 *         if source.exception is None:             # <<<<<<<<<<<<<<
 *             self.switch(source.value)
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "src/gevent/_waiter.py":160
 *     def __call__(self, source):
 *         if source.exception is None:
 *             self.switch(source.value)             # <<<<<<<<<<<<<<
 *         else:
 *             self.throw(source.exception)
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_switch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "src/gevent/_waiter.py":159
 * 
 *     def __call__(self, source):
 *         if source.exception is None:             # <<<<<<<<<<<<<<
 *             self.switch(source.value)
 *         else:
 */
    goto __pyx_L3;
  }

  /* "src/gevent/_waiter.py":162
 *             self.switch(source.value)
 *         else:
 *             self.throw(source.exception)             # <<<<<<<<<<<<<<
 * 
 *     # can also have a debugging version, that wraps the value in a tuple (self, value) in switch()
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_throw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_n_s_exception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "src/gevent/_waiter.py":158
 *                 self.greenlet = None
 * 
 *     def __call__(self, source):             # <<<<<<<<<<<<<<
 *         if source.exception is None:
 *             self.switch(source.value)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/_gevent_c_waiter.pxd":34
 * 
 * cdef class Waiter:
 *     cdef readonly SwitchOutGreenletWithLoop hub             # <<<<<<<<<<<<<<
 *     cdef readonly greenlet greenlet
 *     cdef readonly value
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3hub_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3hub_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_3hub___get__(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_3hub___get__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->hub));
  __pyx_r = ((PyObject *)__pyx_v_self->hub);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/_gevent_c_waiter.pxd":35
 * cdef class Waiter:
 *     cdef readonly SwitchOutGreenletWithLoop hub
 *     cdef readonly greenlet greenlet             # <<<<<<<<<<<<<<
 *     cdef readonly value
 *     cdef _exception
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_8greenlet_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_8greenlet_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8greenlet___get__(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_8greenlet___get__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_self->greenlet));
  __pyx_r = ((PyObject *)__pyx_v_self->greenlet);
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/_gevent_c_waiter.pxd":36
 *     cdef readonly SwitchOutGreenletWithLoop hub
 *     cdef readonly greenlet greenlet
 *     cdef readonly value             # <<<<<<<<<<<<<<
 *     cdef _exception
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_5value_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_5value_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_5value___get__(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_6Waiter_5value___get__(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->value);
  __pyx_r = __pyx_v_self->value;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":180
 *     __slots__ = ['_values']
 * 
 *     def __init__(self, hub=None):             # <<<<<<<<<<<<<<
 *         Waiter.__init__(self, hub)
 *         # we typically expect a relatively small number of these to be outstanding.
 */

/* Python wrapper */
static int __pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_hub = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_hub,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_hub);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 180, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_hub = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 180, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent._gevent_c_waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter___init__(((struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *)__pyx_v_self), __pyx_v_hub);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter___init__(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_hub) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "src/gevent/_waiter.py":181
 * 
 *     def __init__(self, hub=None):
 *         Waiter.__init__(self, hub)             # <<<<<<<<<<<<<<
 *         # we typically expect a relatively small number of these to be outstanding.
 *         # since we pop from the left, a deque might be slightly
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_hub};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(__pyx_v_hub);
    __Pyx_GIVEREF(__pyx_v_hub);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_hub);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":187
 *         # we can help it to better support monkey-patching, and delaying the import
 *         # here can be impractical (see https://github.com/gevent/gevent/issues/652)
 *         self._values = []             # <<<<<<<<<<<<<<
 * 
 *     def switch(self, value):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_values);
  __Pyx_DECREF(__pyx_v_self->_values);
  __pyx_v_self->_values = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":180
 *     __slots__ = ['_values']
 * 
 *     def __init__(self, hub=None):             # <<<<<<<<<<<<<<
 *         Waiter.__init__(self, hub)
 *         # we typically expect a relatively small number of these to be outstanding.
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":189
 *         self._values = []
 * 
 *     def switch(self, value):             # <<<<<<<<<<<<<<
 *         self._values.append(value)
 *         Waiter.switch(self, True)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_14MultipleWaiter_2switch[] = "MultipleWaiter.switch(self, value)";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_14MultipleWaiter_3switch = {"switch", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_3switch, METH_O, __pyx_doc_6gevent_16_gevent_c_waiter_14MultipleWaiter_2switch};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("switch (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter_2switch(((struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter_2switch(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_v_self, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("switch", 0);

  /* "src/gevent/_waiter.py":190
 * 
 *     def switch(self, value):
 *         self._values.append(value)             # <<<<<<<<<<<<<<
 *         Waiter.switch(self, True)
 * 
 */
  if (unlikely(__pyx_v_self->_values == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
    __PYX_ERR(0, 190, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyList_Append(__pyx_v_self->_values, __pyx_v_value); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 190, __pyx_L1_error)

  /* "src/gevent/_waiter.py":191
 *     def switch(self, value):
 *         self._values.append(value)
 *         Waiter.switch(self, True)             # <<<<<<<<<<<<<<
 * 
 *     def get(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter), __pyx_n_s_switch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, ((PyObject *)__pyx_v_self), Py_True};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, ((PyObject *)__pyx_v_self));
    __Pyx_INCREF(Py_True);
    __Pyx_GIVEREF(Py_True);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, Py_True);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/gevent/_waiter.py":189
 *         self._values = []
 * 
 *     def switch(self, value):             # <<<<<<<<<<<<<<
 *         self._values.append(value)
 *         Waiter.switch(self, True)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.MultipleWaiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":193
 *         Waiter.switch(self, True)
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         if not self._values:
 *             Waiter.get(self)
 */

static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_6gevent_16_gevent_c_waiter_14MultipleWaiter_get(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_v_self, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);

  /* "src/gevent/_waiter.py":194
 * 
 *     def get(self):
 *         if not self._values:             # <<<<<<<<<<<<<<
 *             Waiter.get(self)
 *             Waiter.clear(self)
 */
  __pyx_t_1 = (__pyx_v_self->_values != Py_None)&&(PyList_GET_SIZE(__pyx_v_self->_values) != 0);
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

    /* "src/gevent/_waiter.py":195
 *     def get(self):
 *         if not self._values:
 *             Waiter.get(self)             # <<<<<<<<<<<<<<
 *             Waiter.clear(self)
 * 
 */
    __pyx_t_3 = __pyx_f_6gevent_16_gevent_c_waiter_6Waiter_get(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "src/gevent/_waiter.py":196
 *         if not self._values:
 *             Waiter.get(self)
 *             Waiter.clear(self)             # <<<<<<<<<<<<<<
 * 
 *         return self._values.pop(0)
 */
    __pyx_t_3 = __pyx_f_6gevent_16_gevent_c_waiter_6Waiter_clear(((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)__pyx_v_self), 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "src/gevent/_waiter.py":194
 * 
 *     def get(self):
 *         if not self._values:             # <<<<<<<<<<<<<<
 *             Waiter.get(self)
 *             Waiter.clear(self)
 */
  }

  /* "src/gevent/_waiter.py":198
 *             Waiter.clear(self)
 * 
 *         return self._values.pop(0)             # <<<<<<<<<<<<<<
 * 
 * def _init():
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely(__pyx_v_self->_values == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
    __PYX_ERR(0, 198, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_self->_values, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "src/gevent/_waiter.py":193
 *         Waiter.switch(self, True)
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         if not self._values:
 *             Waiter.get(self)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter_14MultipleWaiter_4get[] = "MultipleWaiter.get(self)";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_14MultipleWaiter_5get = {"get", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_5get, METH_NOARGS, __pyx_doc_6gevent_16_gevent_c_waiter_14MultipleWaiter_4get};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_5get(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter_4get(((struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter_14MultipleWaiter_4get(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_16_gevent_c_waiter_14MultipleWaiter_get(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.MultipleWaiter.get", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "src/gevent/_waiter.py":200
 *         return self._values.pop(0)
 * 
 * def _init():             # <<<<<<<<<<<<<<
 *     greenlet_init() # pylint:disable=undefined-variable
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_6gevent_16_gevent_c_waiter__init[] = "_init()";
static PyMethodDef __pyx_mdef_6gevent_16_gevent_c_waiter_1_init = {"_init", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_1_init, METH_NOARGS, __pyx_doc_6gevent_16_gevent_c_waiter__init};
static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_16_gevent_c_waiter__init(__pyx_self);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_16_gevent_c_waiter__init(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init", 0);

  /* "src/gevent/_waiter.py":201
 * 
 * def _init():
 *     greenlet_init() # pylint:disable=undefined-variable             # <<<<<<<<<<<<<<
 * 
 * _init()
 */
  __pyx_f_6gevent_16_gevent_c_waiter_greenlet_init();

  /* "src/gevent/_waiter.py":200
 *         return self._values.pop(0)
 * 
 * def _init():             # <<<<<<<<<<<<<<
 *     greenlet_init() # pylint:disable=undefined-variable
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/_gevent_c_greenlet_primitives.pxd":23
 * 
 * @cython.final
 * cdef inline greenlet getcurrent():             # <<<<<<<<<<<<<<
 *     return PyGreenlet_GetCurrent()
 * 
 */

static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_29_gevent_c_greenlet_primitives_getcurrent(void) {
  PyGreenlet *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getcurrent", 0);

  /* "gevent/_gevent_c_greenlet_primitives.pxd":24
 * @cython.final
 * cdef inline greenlet getcurrent():
 *     return PyGreenlet_GetCurrent()             # <<<<<<<<<<<<<<
 * 
 * cdef bint _greenlet_imported
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyGreenlet *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gevent/_gevent_c_greenlet_primitives.pxd":23
 * 
 * @cython.final
 * cdef inline greenlet getcurrent():             # <<<<<<<<<<<<<<
 *     return PyGreenlet_GetCurrent()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent._gevent_c_greenlet_primitives.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/_gevent_c_greenlet_primitives.pxd":28
 * cdef bint _greenlet_imported
 * 
 * cdef inline void greenlet_init():             # <<<<<<<<<<<<<<
 *     global _greenlet_imported
 *     if not _greenlet_imported:
 */

static CYTHON_INLINE void __pyx_f_6gevent_29_gevent_c_greenlet_primitives_greenlet_init(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("greenlet_init", 0);

  /* "gevent/_gevent_c_greenlet_primitives.pxd":30
 * cdef inline void greenlet_init():
 *     global _greenlet_imported
 *     if not _greenlet_imported:             # <<<<<<<<<<<<<<
 *         PyGreenlet_Import()
 *         _greenlet_imported = True
 */
  __pyx_t_1 = ((!(__pyx_v_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported != 0)) != 0);
  if (__pyx_t_1) {

    /* "gevent/_gevent_c_greenlet_primitives.pxd":31
 *     global _greenlet_imported
 *     if not _greenlet_imported:
 *         PyGreenlet_Import()             # <<<<<<<<<<<<<<
 *         _greenlet_imported = True
 * 
 */
    PyGreenlet_Import();

    /* "gevent/_gevent_c_greenlet_primitives.pxd":32
 *     if not _greenlet_imported:
 *         PyGreenlet_Import()
 *         _greenlet_imported = True             # <<<<<<<<<<<<<<
 * 
 * cdef inline object _greenlet_switch(greenlet self):
 */
    __pyx_v_6gevent_29_gevent_c_greenlet_primitives__greenlet_imported = 1;

    /* "gevent/_gevent_c_greenlet_primitives.pxd":30
 * cdef inline void greenlet_init():
 *     global _greenlet_imported
 *     if not _greenlet_imported:             # <<<<<<<<<<<<<<
 *         PyGreenlet_Import()
 *         _greenlet_imported = True
 */
  }

  /* "gevent/_gevent_c_greenlet_primitives.pxd":28
 * cdef bint _greenlet_imported
 * 
 * cdef inline void greenlet_init():             # <<<<<<<<<<<<<<
 *     global _greenlet_imported
 *     if not _greenlet_imported:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "gevent/_gevent_c_greenlet_primitives.pxd":34
 *         _greenlet_imported = True
 * 
 * cdef inline object _greenlet_switch(greenlet self):             # <<<<<<<<<<<<<<
 *     return PyGreenlet_Switch(self, NULL, NULL)
 * 
 */

static CYTHON_INLINE PyObject *__pyx_f_6gevent_29_gevent_c_greenlet_primitives__greenlet_switch(PyGreenlet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_greenlet_switch", 0);

  /* "gevent/_gevent_c_greenlet_primitives.pxd":35
 * 
 * cdef inline object _greenlet_switch(greenlet self):
 *     return PyGreenlet_Switch(self, NULL, NULL)             # <<<<<<<<<<<<<<
 * 
 * cdef class TrackedRawGreenlet(greenlet):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyGreenlet_Switch(__pyx_v_self, NULL, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gevent/_gevent_c_greenlet_primitives.pxd":34
 *         _greenlet_imported = True
 * 
 * cdef inline object _greenlet_switch(greenlet self):             # <<<<<<<<<<<<<<
 *     return PyGreenlet_Switch(self, NULL, NULL)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent._gevent_c_greenlet_primitives._greenlet_switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/_gevent_c_waiter.pxd":24
 *     void PyGreenlet_Import()
 * 
 * cdef inline greenlet getcurrent():             # <<<<<<<<<<<<<<
 *     return PyGreenlet_GetCurrent()
 * 
 */

static CYTHON_INLINE PyGreenlet *__pyx_f_6gevent_16_gevent_c_waiter_getcurrent(void) {
  PyGreenlet *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("getcurrent", 0);

  /* "gevent/_gevent_c_waiter.pxd":25
 * 
 * cdef inline greenlet getcurrent():
 *     return PyGreenlet_GetCurrent()             # <<<<<<<<<<<<<<
 * 
 * cdef inline void greenlet_init():
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)PyGreenlet_GetCurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyGreenlet *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "gevent/_gevent_c_waiter.pxd":24
 *     void PyGreenlet_Import()
 * 
 * cdef inline greenlet getcurrent():             # <<<<<<<<<<<<<<
 *     return PyGreenlet_GetCurrent()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent._gevent_c_waiter.getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/_gevent_c_waiter.pxd":27
 *     return PyGreenlet_GetCurrent()
 * 
 * cdef inline void greenlet_init():             # <<<<<<<<<<<<<<
 *     global _greenlet_imported
 *     if not _greenlet_imported:
 */

static CYTHON_INLINE void __pyx_f_6gevent_16_gevent_c_waiter_greenlet_init(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("greenlet_init", 0);

  /* "gevent/_gevent_c_waiter.pxd":29
 * cdef inline void greenlet_init():
 *     global _greenlet_imported
 *     if not _greenlet_imported:             # <<<<<<<<<<<<<<
 *         PyGreenlet_Import()
 *         _greenlet_imported = True
 */
  __pyx_t_1 = ((!(__pyx_v_6gevent_16_gevent_c_waiter__greenlet_imported != 0)) != 0);
  if (__pyx_t_1) {

    /* "gevent/_gevent_c_waiter.pxd":30
 *     global _greenlet_imported
 *     if not _greenlet_imported:
 *         PyGreenlet_Import()             # <<<<<<<<<<<<<<
 *         _greenlet_imported = True
 * 
 */
    PyGreenlet_Import();

    /* "gevent/_gevent_c_waiter.pxd":31
 *     if not _greenlet_imported:
 *         PyGreenlet_Import()
 *         _greenlet_imported = True             # <<<<<<<<<<<<<<
 * 
 * cdef class Waiter:
 */
    __pyx_v_6gevent_16_gevent_c_waiter__greenlet_imported = 1;

    /* "gevent/_gevent_c_waiter.pxd":29
 * cdef inline void greenlet_init():
 *     global _greenlet_imported
 *     if not _greenlet_imported:             # <<<<<<<<<<<<<<
 *         PyGreenlet_Import()
 *         _greenlet_imported = True
 */
  }

  /* "gevent/_gevent_c_waiter.pxd":27
 *     return PyGreenlet_GetCurrent()
 * 
 * cdef inline void greenlet_init():             # <<<<<<<<<<<<<<
 *     global _greenlet_imported
 *     if not _greenlet_imported:
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}
static struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_Waiter __pyx_vtable_6gevent_16_gevent_c_waiter_Waiter;

static PyObject *__pyx_tp_new_6gevent_16_gevent_c_waiter_Waiter(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)o);
  p->__pyx_vtab = __pyx_vtabptr_6gevent_16_gevent_c_waiter_Waiter;
  p->hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None);
  p->greenlet = ((PyGreenlet *)Py_None); Py_INCREF(Py_None);
  p->value = Py_None; Py_INCREF(Py_None);
  p->_exception = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_16_gevent_c_waiter_Waiter(PyObject *o) {
  struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *p = (struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->hub);
  Py_CLEAR(p->greenlet);
  Py_CLEAR(p->value);
  Py_CLEAR(p->_exception);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6gevent_16_gevent_c_waiter_Waiter(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *p = (struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)o;
  if (p->hub) {
    e = (*v)(((PyObject *)p->hub), a); if (e) return e;
  }
  if (p->greenlet) {
    e = (*v)(((PyObject *)p->greenlet), a); if (e) return e;
  }
  if (p->value) {
    e = (*v)(p->value, a); if (e) return e;
  }
  if (p->_exception) {
    e = (*v)(p->_exception, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_16_gevent_c_waiter_Waiter(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *p = (struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *)o;
  tmp = ((PyObject*)p->hub);
  p->hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->greenlet);
  p->greenlet = ((PyGreenlet *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->value);
  p->value = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_exception);
  p->_exception = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_16_gevent_c_waiter_6Waiter_exc_info(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_8exc_info_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_16_gevent_c_waiter_6Waiter_hub(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3hub_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_16_gevent_c_waiter_6Waiter_greenlet(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_8greenlet_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_16_gevent_c_waiter_6Waiter_value(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_5value_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_16_gevent_c_waiter_Waiter[] = {
  {"ready", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_7ready, METH_NOARGS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_6ready},
  {"successful", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_9successful, METH_NOARGS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_8successful},
  {"switch", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_11switch, METH_O, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_10switch},
  {"switch_args", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_13switch_args, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_12switch_args},
  {"throw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_15throw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_14throw},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_16_gevent_c_waiter_Waiter[] = {
  {(char *)"exc_info", __pyx_getprop_6gevent_16_gevent_c_waiter_6Waiter_exc_info, 0, (char *)"Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``.", 0},
  {(char *)"hub", __pyx_getprop_6gevent_16_gevent_c_waiter_6Waiter_hub, 0, (char *)0, 0},
  {(char *)"greenlet", __pyx_getprop_6gevent_16_gevent_c_waiter_6Waiter_greenlet, 0, (char *)0, 0},
  {(char *)"value", __pyx_getprop_6gevent_16_gevent_c_waiter_6Waiter_value, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6gevent_16_gevent_c_waiter_Waiter = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent._gevent_c_waiter.Waiter", /*tp_name*/
  sizeof(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_16_gevent_c_waiter_Waiter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_19__call__, /*tp_call*/
  __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_5__str__, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Waiter(hub=None)\n\n    A low level communication utility for greenlets.\n\n    Waiter is a wrapper around greenlet's ``switch()`` and ``throw()`` calls that makes them somewhat safer:\n\n    * switching will occur only if the waiting greenlet is executing :meth:`get` method currently;\n    * any error raised in the greenlet is handled inside :meth:`switch` and :meth:`throw`\n    * if :meth:`switch`/:meth:`throw` is called before the receiver calls :meth:`get`, then :class:`Waiter`\n      will store the value/exception. The following :meth:`get` will return the value/raise the exception.\n\n    The :meth:`switch` and :meth:`throw` methods must only be called from the :class:`Hub` greenlet.\n    The :meth:`get` method must be called from a greenlet other than :class:`Hub`.\n\n        >>> from gevent.hub import Waiter\n        >>> from gevent import get_hub\n        >>> result = Waiter()\n        >>> timer = get_hub().loop.timer(0.1)\n        >>> timer.start(result.switch, 'hello from Waiter')\n        >>> result.get() # blocks for 0.1 seconds\n        'hello from Waiter'\n        >>> timer.close()\n\n    If switch is called before the greenlet gets a chance to call :meth:`get` then\n    :class:`Waiter` stores the value.\n\n        >>> from gevent.time import sleep\n        >>> result = Waiter()\n        >>> timer = get_hub().loop.timer(0.1)\n        >>> timer.start(result.switch, 'hi from Waiter')\n        >>> sleep(0.2)\n        >>> result.get() # returns immediately without blocking\n        'hi from Waiter'\n        >>> timer.close()\n\n    .. warning::\n\n        This is a limited and dangerous way to communicate between\n        greenlets. It can easily leave a greenlet unscheduled forever\n        if used incorrectly. Consider using safer classes such as\n        :class:`gevent.event.Event`, :class:`gevent.event.AsyncResult`,\n        or :class:`gevent.queue.Queue`.\n    ", /*tp_doc*/
  __pyx_tp_traverse_6gevent_16_gevent_c_waiter_Waiter, /*tp_traverse*/
  __pyx_tp_clear_6gevent_16_gevent_c_waiter_Waiter, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_16_gevent_c_waiter_Waiter, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_16_gevent_c_waiter_Waiter, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_16_gevent_c_waiter_Waiter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};
static struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_MultipleWaiter __pyx_vtable_6gevent_16_gevent_c_waiter_MultipleWaiter;

static PyObject *__pyx_tp_new_6gevent_16_gevent_c_waiter_MultipleWaiter(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *p;
  PyObject *o = __pyx_tp_new_6gevent_16_gevent_c_waiter_Waiter(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_6gevent_16_gevent_c_waiter_Waiter*)__pyx_vtabptr_6gevent_16_gevent_c_waiter_MultipleWaiter;
  p->_values = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_16_gevent_c_waiter_MultipleWaiter(PyObject *o) {
  struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->_values);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_16_gevent_c_waiter_Waiter(o);
}

static int __pyx_tp_traverse_6gevent_16_gevent_c_waiter_MultipleWaiter(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *)o;
  e = __pyx_tp_traverse_6gevent_16_gevent_c_waiter_Waiter(o, v, a); if (e) return e;
  if (p->_values) {
    e = (*v)(p->_values, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_16_gevent_c_waiter_MultipleWaiter(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *p = (struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter *)o;
  __pyx_tp_clear_6gevent_16_gevent_c_waiter_Waiter(o);
  tmp = ((PyObject*)p->_values);
  p->_values = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_6gevent_16_gevent_c_waiter_MultipleWaiter[] = {
  {"switch", (PyCFunction)__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_3switch, METH_O, __pyx_doc_6gevent_16_gevent_c_waiter_14MultipleWaiter_2switch},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent._gevent_c_waiter.MultipleWaiter", /*tp_name*/
  sizeof(struct __pyx_obj_6gevent_16_gevent_c_waiter_MultipleWaiter), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_16_gevent_c_waiter_MultipleWaiter, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_19__call__, /*tp_call*/
  #else
  0, /*tp_call*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_5__str__, /*tp_str*/
  #else
  0, /*tp_str*/
  #endif
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "MultipleWaiter(hub=None)\n\n    An internal extension of Waiter that can be used if multiple objects\n    must be waited on, and there is a chance that in between waits greenlets\n    might be switched out. All greenlets that switch to this waiter\n    will have their value returned.\n\n    This does not handle exceptions or throw methods.\n    ", /*tp_doc*/
  __pyx_tp_traverse_6gevent_16_gevent_c_waiter_MultipleWaiter, /*tp_traverse*/
  __pyx_tp_clear_6gevent_16_gevent_c_waiter_MultipleWaiter, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_16_gevent_c_waiter_MultipleWaiter, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_16_gevent_c_waiter_MultipleWaiter, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000
  0, /*tp_pypy_flags*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec__gevent_c_waiter(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec__gevent_c_waiter},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "_gevent_c_waiter",
    __pyx_k_Low_level_waiting_primitives, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_n_s_AssertionError, __pyx_k_AssertionError, sizeof(__pyx_k_AssertionError), 0, 0, 1, 1},
  {&__pyx_kp_s_Can_only_use_Waiter_switch_metho, __pyx_k_Can_only_use_Waiter_switch_metho, sizeof(__pyx_k_Can_only_use_Waiter_switch_metho), 0, 0, 1, 0},
  {&__pyx_n_s_ConcurrentObjectUseError, __pyx_k_ConcurrentObjectUseError, sizeof(__pyx_k_ConcurrentObjectUseError), 0, 0, 1, 1},
  {&__pyx_n_s_MultipleWaiter, __pyx_k_MultipleWaiter, sizeof(__pyx_k_MultipleWaiter), 0, 0, 1, 1},
  {&__pyx_n_s_MultipleWaiter_get, __pyx_k_MultipleWaiter_get, sizeof(__pyx_k_MultipleWaiter_get), 0, 0, 1, 1},
  {&__pyx_n_s_MultipleWaiter_switch, __pyx_k_MultipleWaiter_switch, sizeof(__pyx_k_MultipleWaiter_switch), 0, 0, 1, 1},
  {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1},
  {&__pyx_kp_s_This_Waiter_is_already_used_by_r, __pyx_k_This_Waiter_is_already_used_by_r, sizeof(__pyx_k_This_Waiter_is_already_used_by_r), 0, 0, 1, 0},
  {&__pyx_n_s_Waiter, __pyx_k_Waiter, sizeof(__pyx_k_Waiter), 0, 0, 1, 1},
  {&__pyx_n_s_Waiter_clear, __pyx_k_Waiter_clear, sizeof(__pyx_k_Waiter_clear), 0, 0, 1, 1},
  {&__pyx_n_s_Waiter_get, __pyx_k_Waiter_get, sizeof(__pyx_k_Waiter_get), 0, 0, 1, 1},
  {&__pyx_n_s_Waiter_ready, __pyx_k_Waiter_ready, sizeof(__pyx_k_Waiter_ready), 0, 0, 1, 1},
  {&__pyx_n_s_Waiter_successful, __pyx_k_Waiter_successful, sizeof(__pyx_k_Waiter_successful), 0, 0, 1, 1},
  {&__pyx_n_s_Waiter_switch, __pyx_k_Waiter_switch, sizeof(__pyx_k_Waiter_switch), 0, 0, 1, 1},
  {&__pyx_n_s_Waiter_switch_args, __pyx_k_Waiter_switch_args, sizeof(__pyx_k_Waiter_switch_args), 0, 0, 1, 1},
  {&__pyx_n_s_Waiter_throw, __pyx_k_Waiter_throw, sizeof(__pyx_k_Waiter_throw), 0, 0, 1, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_exc_info, __pyx_k_exc_info, sizeof(__pyx_k_exc_info), 0, 0, 1, 1},
  {&__pyx_n_s_exception, __pyx_k_exception, sizeof(__pyx_k_exception), 0, 0, 1, 1},
  {&__pyx_n_s_exception_2, __pyx_k_exception_2, sizeof(__pyx_k_exception_2), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_hub_noargs, __pyx_k_get_hub_noargs, sizeof(__pyx_k_get_hub_noargs), 0, 0, 1, 1},
  {&__pyx_n_s_getcurrent, __pyx_k_getcurrent, sizeof(__pyx_k_getcurrent), 0, 0, 1, 1},
  {&__pyx_kp_s_gevent___waiter, __pyx_k_gevent___waiter, sizeof(__pyx_k_gevent___waiter), 0, 0, 1, 0},
  {&__pyx_n_s_gevent__gevent_c_waiter, __pyx_k_gevent__gevent_c_waiter, sizeof(__pyx_k_gevent__gevent_c_waiter), 0, 0, 1, 1},
  {&__pyx_n_s_gevent__hub_local, __pyx_k_gevent__hub_local, sizeof(__pyx_k_gevent__hub_local), 0, 0, 1, 1},
  {&__pyx_n_s_gevent__util, __pyx_k_gevent__util, sizeof(__pyx_k_gevent__util), 0, 0, 1, 1},
  {&__pyx_n_s_gevent_exceptions, __pyx_k_gevent_exceptions, sizeof(__pyx_k_gevent_exceptions), 0, 0, 1, 1},
  {&__pyx_n_s_greenlet, __pyx_k_greenlet, sizeof(__pyx_k_greenlet), 0, 0, 1, 1},
  {&__pyx_n_s_greenlet_imported, __pyx_k_greenlet_imported, sizeof(__pyx_k_greenlet_imported), 0, 0, 1, 1},
  {&__pyx_n_s_greenlet_init, __pyx_k_greenlet_init, sizeof(__pyx_k_greenlet_init), 0, 0, 1, 1},
  {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1},
  {&__pyx_n_s_hub, __pyx_k_hub, sizeof(__pyx_k_hub), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_import_c_accel, __pyx_k_import_c_accel, sizeof(__pyx_k_import_c_accel), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  {&__pyx_n_s_lambda, __pyx_k_lambda, sizeof(__pyx_k_lambda), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_capi, __pyx_k_pyx_capi, sizeof(__pyx_k_pyx_capi), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_ready, __pyx_k_ready, sizeof(__pyx_k_ready), 0, 0, 1, 1},
  {&__pyx_kp_s_s_greenlet_s, __pyx_k_s_greenlet_s, sizeof(__pyx_k_s_greenlet_s), 0, 0, 1, 0},
  {&__pyx_kp_s_s_greenlet_s_exc_info_r, __pyx_k_s_greenlet_s_exc_info_r, sizeof(__pyx_k_s_greenlet_s_exc_info_r), 0, 0, 1, 0},
  {&__pyx_kp_s_s_greenlet_s_value_r, __pyx_k_s_greenlet_s_value_r, sizeof(__pyx_k_s_greenlet_s_value_r), 0, 0, 1, 0},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_slots, __pyx_k_slots, sizeof(__pyx_k_slots), 0, 0, 1, 1},
  {&__pyx_n_s_source, __pyx_k_source, sizeof(__pyx_k_source), 0, 0, 1, 1},
  {&__pyx_kp_s_src_gevent__waiter_py, __pyx_k_src_gevent__waiter_py, sizeof(__pyx_k_src_gevent__waiter_py), 0, 0, 1, 0},
  {&__pyx_n_s_successful, __pyx_k_successful, sizeof(__pyx_k_successful), 0, 0, 1, 1},
  {&__pyx_n_s_switch, __pyx_k_switch, sizeof(__pyx_k_switch), 0, 0, 1, 1},
  {&__pyx_n_s_switch_args, __pyx_k_switch_args, sizeof(__pyx_k_switch_args), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_throw_args, __pyx_k_throw_args, sizeof(__pyx_k_throw_args), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_object = __Pyx_GetBuiltinName(__pyx_n_s_object); if (!__pyx_builtin_object) __PYX_ERR(0, 21, __pyx_L1_error)
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) __PYX_ERR(0, 23, __pyx_L1_error)
  __pyx_builtin_AssertionError = __Pyx_GetBuiltinName(__pyx_n_s_AssertionError); if (!__pyx_builtin_AssertionError) __PYX_ERR(0, 119, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "src/gevent/_waiter.py":119
 *         else:
 *             if getcurrent() is not self.hub: # pylint:disable=undefined-variable
 *                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")             # <<<<<<<<<<<<<<
 *             switch = greenlet.switch
 *             try:
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Can_only_use_Waiter_switch_metho); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 119, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "src/gevent/_waiter.py":23
 * _NONE = object()
 * 
 * locals()['getcurrent'] = __import__('greenlet').getcurrent             # <<<<<<<<<<<<<<
 * locals()['greenlet_init'] = lambda: None
 * 
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_n_s_greenlet); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "src/gevent/_waiter.py":79
 *         self._exception = _NONE
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self.greenlet = None
 *         self.value = None
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);
  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__3, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_clear, 79, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 79, __pyx_L1_error)

  /* "src/gevent/_waiter.py":91
 *         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
 * 
 *     def ready(self):             # <<<<<<<<<<<<<<
 *         """Return true if and only if it holds a value or an exception"""
 *         return self._exception is not _NONE
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);
  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_ready, 91, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 91, __pyx_L1_error)

  /* "src/gevent/_waiter.py":95
 *         return self._exception is not _NONE
 * 
 *     def successful(self):             # <<<<<<<<<<<<<<
 *         """Return true if and only if it is ready and holds a value"""
 *         return self._exception is None
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);
  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_successful, 95, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 95, __pyx_L1_error)

  /* "src/gevent/_waiter.py":105
 *             return self._exception
 * 
 *     def switch(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Switch to the greenlet if one's available. Otherwise store the
 */
  __pyx_tuple__9 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_value, __pyx_n_s_greenlet, __pyx_n_s_switch); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);
  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 105, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 105, __pyx_L1_error)

  /* "src/gevent/_waiter.py":126
 *                 self.hub.handle_error(switch, *sys.exc_info())
 * 
 *     def switch_args(self, *args):             # <<<<<<<<<<<<<<
 *         return self.switch(args)
 * 
 */
  __pyx_tuple__11 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_args); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);
  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch_args, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 126, __pyx_L1_error)

  /* "src/gevent/_waiter.py":129
 *         return self.switch(args)
 * 
 *     def throw(self, *throw_args):             # <<<<<<<<<<<<<<
 *         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
 *         greenlet = self.greenlet
 */
  __pyx_tuple__13 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_throw_args, __pyx_n_s_greenlet, __pyx_n_s_throw); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);
  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_throw, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 129, __pyx_L1_error)

  /* "src/gevent/_waiter.py":143
 *                 self.hub.handle_error(throw, *sys.exc_info())
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
 *         if self._exception is not _NONE:
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);
  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(0, 143, __pyx_L1_error)

  /* "src/gevent/_waiter.py":189
 *         self._values = []
 * 
 *     def switch(self, value):             # <<<<<<<<<<<<<<
 *         self._values.append(value)
 *         Waiter.switch(self, True)
 */
  __pyx_tuple__17 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);
  __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_switch, 189, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__18)) __PYX_ERR(0, 189, __pyx_L1_error)

  /* "src/gevent/_waiter.py":193
 *         Waiter.switch(self, True)
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         if not self._values:
 *             Waiter.get(self)
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);
  __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_get, 193, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(0, 193, __pyx_L1_error)

  /* "src/gevent/_waiter.py":200
 *         return self._values.pop(0)
 * 
 * def _init():             # <<<<<<<<<<<<<<
 *     greenlet_init() # pylint:disable=undefined-variable
 * 
 */
  __pyx_codeobj__21 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src_gevent__waiter_py, __pyx_n_s_init_2, 200, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__21)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __pyx_v_6gevent_16_gevent_c_waiter_sys = Py_None; Py_INCREF(Py_None);
  __pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError = Py_None; Py_INCREF(Py_None);
  __pyx_v_6gevent_16_gevent_c_waiter__NONE = Py_None; Py_INCREF(Py_None);
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  if (__Pyx_ExportVoidPtr(__pyx_n_s_sys, (void *)&__pyx_v_6gevent_16_gevent_c_waiter_sys, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_ConcurrentObjectUseError, (void *)&__pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_greenlet_imported, (void *)&__pyx_v_6gevent_16_gevent_c_waiter__greenlet_imported, "int") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (__Pyx_ExportVoidPtr(__pyx_n_s_NONE, (void *)&__pyx_v_6gevent_16_gevent_c_waiter__NONE, "PyObject *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_6gevent_16_gevent_c_waiter_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_6gevent_16_gevent_c_waiter_greenlet) __PYX_ERR(2, 15, __pyx_L1_error)
  __pyx_vtabptr_6gevent_16_gevent_c_waiter_Waiter = &__pyx_vtable_6gevent_16_gevent_c_waiter_Waiter;
  __pyx_vtable_6gevent_16_gevent_c_waiter_Waiter.get = (PyObject *(*)(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_16_gevent_c_waiter_6Waiter_get;
  __pyx_vtable_6gevent_16_gevent_c_waiter_Waiter.clear = (PyObject *(*)(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_16_gevent_c_waiter_6Waiter_clear;
  if (PyType_Ready(&__pyx_type_6gevent_16_gevent_c_waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6gevent_16_gevent_c_waiter_Waiter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_16_gevent_c_waiter_Waiter.tp_dictoffset && __pyx_type_6gevent_16_gevent_c_waiter_Waiter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6gevent_16_gevent_c_waiter_Waiter.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_6gevent_16_gevent_c_waiter_Waiter.tp_dict, __pyx_vtabptr_6gevent_16_gevent_c_waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Waiter, (PyObject *)&__pyx_type_6gevent_16_gevent_c_waiter_Waiter) < 0) __PYX_ERR(0, 27, __pyx_L1_error)
  __pyx_ptype_6gevent_16_gevent_c_waiter_Waiter = &__pyx_type_6gevent_16_gevent_c_waiter_Waiter;
  __pyx_vtabptr_6gevent_16_gevent_c_waiter_MultipleWaiter = &__pyx_vtable_6gevent_16_gevent_c_waiter_MultipleWaiter;
  __pyx_vtable_6gevent_16_gevent_c_waiter_MultipleWaiter.__pyx_base = *__pyx_vtabptr_6gevent_16_gevent_c_waiter_Waiter;
  __pyx_vtable_6gevent_16_gevent_c_waiter_MultipleWaiter.__pyx_base.get = (PyObject *(*)(struct __pyx_obj_6gevent_16_gevent_c_waiter_Waiter *, int __pyx_skip_dispatch))__pyx_f_6gevent_16_gevent_c_waiter_14MultipleWaiter_get;
  __pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter.tp_base = __pyx_ptype_6gevent_16_gevent_c_waiter_Waiter;
  if (PyType_Ready(&__pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter.tp_dictoffset && __pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  if (__Pyx_SetVtable(__pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter.tp_dict, __pyx_vtabptr_6gevent_16_gevent_c_waiter_MultipleWaiter) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MultipleWaiter, (PyObject *)&__pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
  __pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter = &__pyx_type_6gevent_16_gevent_c_waiter_MultipleWaiter;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_t_1 = PyImport_ImportModule("greenlet"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet = __Pyx_ImportType(__pyx_t_1, "greenlet", "greenlet", sizeof(PyGreenlet), __Pyx_ImportType_CheckSize_Warn);
   if (!__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_greenlet) __PYX_ERR(1, 12, __pyx_L1_error)
  __pyx_t_2 = PyImport_ImportModule("gevent._gevent_c_greenlet_primitives"); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 37, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __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);
   if (!__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_TrackedRawGreenlet) __PYX_ERR(1, 37, __pyx_L1_error)
  __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);
   if (!__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop) __PYX_ERR(1, 40, __pyx_L1_error)
  __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->tp_dict); if (unlikely(!__pyx_vtabptr_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __pyx_t_1 = PyImport_ImportModule("gevent._gevent_c_greenlet_primitives"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  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)
  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)
  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)
  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)
  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)
  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)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyImport_ImportModule("gevent._gevent_c_hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  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)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __pyx_t_1 = PyImport_ImportModule("gevent._gevent_c_hub_local"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  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)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_RefNannyFinishContext();
  return -1;
}


#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC init_gevent_c_waiter(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC init_gevent_c_waiter(void)
#else
__Pyx_PyMODINIT_FUNC PyInit__gevent_c_waiter(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit__gevent_c_waiter(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
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) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec__gevent_c_waiter(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module '_gevent_c_waiter' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__gevent_c_waiter(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("_gevent_c_waiter", __pyx_methods, __pyx_k_Low_level_waiting_primitives, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_gevent___gevent_c_waiter) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "gevent._gevent_c_waiter")) {
      if (unlikely(PyDict_SetItemString(modules, "gevent._gevent_c_waiter", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  if (unlikely(__Pyx_modinit_variable_export_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_type_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_variable_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  if (unlikely(__Pyx_modinit_function_import_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "src/gevent/_waiter.py":12
 * from __future__ import print_function
 * 
 * import sys             # <<<<<<<<<<<<<<
 * 
 * from gevent._hub_local import get_hub_noargs as get_hub
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(__pyx_v_6gevent_16_gevent_c_waiter_sys);
  __Pyx_DECREF_SET(__pyx_v_6gevent_16_gevent_c_waiter_sys, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":14
 * import sys
 * 
 * from gevent._hub_local import get_hub_noargs as get_hub             # <<<<<<<<<<<<<<
 * from gevent.exceptions import ConcurrentObjectUseError
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_get_hub_noargs);
  __Pyx_GIVEREF(__pyx_n_s_get_hub_noargs);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_hub_noargs);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__hub_local, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_get_hub_noargs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_hub_noargs, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/gevent/_waiter.py":15
 * 
 * from gevent._hub_local import get_hub_noargs as get_hub
 * from gevent.exceptions import ConcurrentObjectUseError             # <<<<<<<<<<<<<<
 * 
 * __all__ = [
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_ConcurrentObjectUseError);
  __Pyx_GIVEREF(__pyx_n_s_ConcurrentObjectUseError);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_ConcurrentObjectUseError);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ConcurrentObjectUseError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_XGOTREF(__pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError);
  __Pyx_DECREF_SET(__pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":17
 * from gevent.exceptions import ConcurrentObjectUseError
 * 
 * __all__ = [             # <<<<<<<<<<<<<<
 *     'Waiter',
 * ]
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_Waiter);
  __Pyx_GIVEREF(__pyx_n_s_Waiter);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_Waiter);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":21
 * ]
 * 
 * _NONE = object()             # <<<<<<<<<<<<<<
 * 
 * locals()['getcurrent'] = __import__('greenlet').getcurrent
 */
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_builtin_object); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 21, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XGOTREF(__pyx_v_6gevent_16_gevent_c_waiter__NONE);
  __Pyx_DECREF_SET(__pyx_v_6gevent_16_gevent_c_waiter__NONE, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":23
 * _NONE = object()
 * 
 * locals()['getcurrent'] = __import__('greenlet').getcurrent             # <<<<<<<<<<<<<<
 * locals()['greenlet_init'] = lambda: None
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_getcurrent); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_getcurrent, __pyx_t_2) < 0)) __PYX_ERR(0, 23, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/gevent/_waiter.py":24
 * 
 * locals()['getcurrent'] = __import__('greenlet').getcurrent
 * locals()['greenlet_init'] = lambda: None             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_2lambda, 0, __pyx_n_s_lambda, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_t_1, __pyx_n_s_greenlet_init, __pyx_t_2) < 0)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/gevent/_waiter.py":71
 *     """
 * 
 *     __slots__ = ['hub', 'greenlet', 'value', '_exception']             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, hub=None):
 */
  __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_hub);
  __Pyx_GIVEREF(__pyx_n_s_hub);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_hub);
  __Pyx_INCREF(__pyx_n_s_greenlet);
  __Pyx_GIVEREF(__pyx_n_s_greenlet);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_greenlet);
  __Pyx_INCREF(__pyx_n_s_value);
  __Pyx_GIVEREF(__pyx_n_s_value);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_value);
  __Pyx_INCREF(__pyx_n_s_exception_2);
  __Pyx_GIVEREF(__pyx_n_s_exception_2);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_exception_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);

  /* "src/gevent/_waiter.py":79
 *         self._exception = _NONE
 * 
 *     def clear(self):             # <<<<<<<<<<<<<<
 *         self.greenlet = None
 *         self.value = None
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_3clear, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_clear, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter->tp_dict, __pyx_n_s_clear, __pyx_t_2) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);

  /* "src/gevent/_waiter.py":91
 *         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)
 * 
 *     def ready(self):             # <<<<<<<<<<<<<<
 *         """Return true if and only if it holds a value or an exception"""
 *         return self._exception is not _NONE
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_7ready, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_ready, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter->tp_dict, __pyx_n_s_ready, __pyx_t_2) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);

  /* "src/gevent/_waiter.py":95
 *         return self._exception is not _NONE
 * 
 *     def successful(self):             # <<<<<<<<<<<<<<
 *         """Return true if and only if it is ready and holds a value"""
 *         return self._exception is None
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_9successful, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_successful, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter->tp_dict, __pyx_n_s_successful, __pyx_t_2) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);

  /* "src/gevent/_waiter.py":105
 *             return self._exception
 * 
 *     def switch(self, value):             # <<<<<<<<<<<<<<
 *         """
 *         Switch to the greenlet if one's available. Otherwise store the
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_11switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);

  /* "src/gevent/_waiter.py":126
 *                 self.hub.handle_error(switch, *sys.exc_info())
 * 
 *     def switch_args(self, *args):             # <<<<<<<<<<<<<<
 *         return self.switch(args)
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_13switch_args, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_switch_args, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter->tp_dict, __pyx_n_s_switch_args, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);

  /* "src/gevent/_waiter.py":129
 *         return self.switch(args)
 * 
 *     def throw(self, *throw_args):             # <<<<<<<<<<<<<<
 *         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""
 *         greenlet = self.greenlet
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_15throw, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_throw, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter->tp_dict, __pyx_n_s_throw, __pyx_t_2) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);

  /* "src/gevent/_waiter.py":143
 *                 self.hub.handle_error(throw, *sys.exc_info())
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""
 *         if self._exception is not _NONE:
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_17get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Waiter_get, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);

  /* "src/gevent/_waiter.py":178
 *     This does not handle exceptions or throw methods.
 *     """
 *     __slots__ = ['_values']             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, hub=None):
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_values);
  __Pyx_GIVEREF(__pyx_n_s_values);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_values);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter->tp_dict, __pyx_n_s_slots, __pyx_t_2) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter);

  /* "src/gevent/_waiter.py":189
 *         self._values = []
 * 
 *     def switch(self, value):             # <<<<<<<<<<<<<<
 *         self._values.append(value)
 *         Waiter.switch(self, True)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_14MultipleWaiter_3switch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_switch, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__18)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter->tp_dict, __pyx_n_s_switch, __pyx_t_2) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter);

  /* "src/gevent/_waiter.py":193
 *         Waiter.switch(self, True)
 * 
 *     def get(self):             # <<<<<<<<<<<<<<
 *         if not self._values:
 *             Waiter.get(self)
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_14MultipleWaiter_5get, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MultipleWaiter_get, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__20)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter->tp_dict, __pyx_n_s_get, __pyx_t_2) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter);

  /* "src/gevent/_waiter.py":200
 *         return self._values.pop(0)
 * 
 * def _init():             # <<<<<<<<<<<<<<
 *     greenlet_init() # pylint:disable=undefined-variable
 * 
 */
  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_1_init, 0, __pyx_n_s_init_2, NULL, __pyx_n_s_gevent__gevent_c_waiter, __pyx_d, ((PyObject *)__pyx_codeobj__21)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_2, __pyx_t_2) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/gevent/_waiter.py":203
 *     greenlet_init() # pylint:disable=undefined-variable
 * 
 * _init()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_init_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 203, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":206
 * 
 * 
 * from gevent._util import import_c_accel             # <<<<<<<<<<<<<<
 * import_c_accel(globals(), 'gevent.__waiter')
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_import_c_accel);
  __Pyx_GIVEREF(__pyx_n_s_import_c_accel);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_import_c_accel);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_gevent__util, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_import_c_accel, __pyx_t_1) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "src/gevent/_waiter.py":207
 * 
 * from gevent._util import import_c_accel
 * import_c_accel(globals(), 'gevent.__waiter')             # <<<<<<<<<<<<<<
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_Globals(); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_kp_s_gevent___waiter);
  __Pyx_GIVEREF(__pyx_kp_s_gevent___waiter);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_kp_s_gevent___waiter);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "src/gevent/_waiter.py":1
 * # -*- coding: utf-8 -*-             # <<<<<<<<<<<<<<
 * # copyright 2018 gevent
 * # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "gevent/_gevent_c_waiter.pxd":27
 *     return PyGreenlet_GetCurrent()
 * 
 * cdef inline void greenlet_init():             # <<<<<<<<<<<<<<
 *     global _greenlet_imported
 *     if not _greenlet_imported:
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init gevent._gevent_c_waiter", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init gevent._gevent_c_waiter");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
#include "src/gevent/_generated_include/ParseKeywords_impl_246e3b154e7277129180526999309c2e.h"
/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* PyDictVersioning */
#include "src/gevent/_generated_include/PyDictVersioning_impl_1d8fa70966f1315e259cc5346b82a97a.h"
/* PyFunctionFastCall */
#include "src/gevent/_generated_include/PyFunctionFastCall_impl_95e2c0e91a9bb38a123e6f371a1efbae.h"
/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyCFunctionFastCall */
#include "src/gevent/_generated_include/PyCFunctionFastCall_impl_a0a5a1738768b1fcb44b27777ca99365.h"
/* PyObjectCallOneArg */
#include "src/gevent/_generated_include/PyObjectCallOneArg_impl_1dbf32c55339c0b36c66d038384d813b.h"
/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#include "src/gevent/_generated_include/RaiseException_impl_8092f7d1014f7c278c627555bebbb8bc.h"
/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#include "src/gevent/_generated_include/SaveResetException_impl_a97db376921d2d15c7c242e91e66fa50.h"
/* GetException */
#include "src/gevent/_generated_include/GetException_impl_65508b3079d85bd0c31681e2a3b0b70a.h"
/* KeywordStringCheck */
#include "src/gevent/_generated_include/KeywordStringCheck_impl_a6202879ceb29b5c126e1b6941cf0998.h"
/* SwapException */
#include "src/gevent/_generated_include/SwapException_impl_9bf4965d753bfea28611c3c706e3d13a.h"
/* PyObjectGetMethod */
#include "src/gevent/_generated_include/PyObjectGetMethod_impl_0ac84d0b8d67a035e5345eacbea1db95.h"
/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* pop_index */
static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
    PyObject *r;
    if (unlikely(!py_ix)) return NULL;
    r = __Pyx__PyObject_PopIndex(L, py_ix);
    Py_DECREF(py_ix);
    return r;
}
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
    return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
    Py_ssize_t size = PyList_GET_SIZE(L);
    if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
        Py_ssize_t cix = ix;
        if (cix < 0) {
            cix += size;
        }
        if (likely(__Pyx_is_valid_index(cix, size))) {
            PyObject* v = PyList_GET_ITEM(L, cix);
            __Pyx_SET_SIZE(L, Py_SIZE(L) - 1);
            size -= 1;
            memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
            return v;
        }
    }
    if (py_ix == Py_None) {
        return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix));
    } else {
        return __Pyx__PyObject_PopIndex(L, py_ix);
    }
}
#endif

/* TypeImport */
#include "src/gevent/_generated_include/TypeImport_impl_d5cd5554eec5ba197a2a05afc9fb56ba.h"
/* PyObject_GenericGetAttrNoDict */
#include "src/gevent/_generated_include/PyObject_GenericGetAttrNoDict_impl_3495a872a971052956a8ea296b7d5390.h"
/* PyObject_GenericGetAttr */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
static void* __Pyx_GetVtable(PyObject *dict) {
    void* ptr;
    PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
    if (!ob)
        goto bad;
#if PY_VERSION_HEX >= 0x02070000
    ptr = PyCapsule_GetPointer(ob, 0);
#else
    ptr = PyCObject_AsVoidPtr(ob);
#endif
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* Import */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* FetchCommonType */
#include "src/gevent/_generated_include/FetchCommonType_impl_352a0dd347eaeec1cbcc99a1ad8b036b.h"
/* CythonFunctionShared */
#include "src/gevent/_generated_include/CythonFunctionShared_impl_520ff1994f74ed3de148349eae9a727b.h"
/* CythonFunction */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* GetModuleGlobalName */
#include "src/gevent/_generated_include/GetModuleGlobalName_impl_61ac73eac68e57e860b8d1a25c72d19e.h"
/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* Globals */
#include "src/gevent/_generated_include/Globals_impl_475973023a6ccac59fdfd64affb0e297.h"
/* CLineInTraceback */
#ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
#include "src/gevent/_generated_include/CodeObjectCache_impl_b2e4b115a9c23210a9997ddc920613b6.h"
/* AddTraceback */
#include "src/gevent/_generated_include/AddTraceback_impl_6222e8246deaca1572f32d1a1a011b8b.h"
/* CIntToPy */
#include "src/gevent/_generated_include/CIntToPy_impl_43939fa3d958923ed03ca0bab7988e3f.h"
/* CIntFromPyVerify */
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntFromPy */
#include "src/gevent/_generated_include/CIntFromPy_impl_3e7dff6e86f7b2e4c451b3f127cac6b3.h"
/* CIntFromPy */
#include "src/gevent/_generated_include/CIntFromPy_impl_0f372f08cfa6ee8ab98a2112a95f35e3.h"
/* FastTypeChecks */
#include "src/gevent/_generated_include/FastTypeChecks_impl_717054895497fe6f15da9253d1bff94e.h"
/* CheckBinaryVersion */
#include "src/gevent/_generated_include/CheckBinaryVersion_impl_0e609258b4cc8073875edaa080c1fe7b.h"
/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* VoidPtrExport */
static int __Pyx_ExportVoidPtr(PyObject *name, void *p, const char *sig) {
    PyObject *d;
    PyObject *cobj = 0;
    d = PyDict_GetItem(__pyx_d, __pyx_n_s_pyx_capi);
    Py_XINCREF(d);
    if (!d) {
        d = PyDict_New();
        if (!d)
            goto bad;
        if (__Pyx_PyObject_SetAttrStr(__pyx_m, __pyx_n_s_pyx_capi, d) < 0)
            goto bad;
    }
#if PY_VERSION_HEX >= 0x02070000
    cobj = PyCapsule_New(p, sig, 0);
#else
    cobj = PyCObject_FromVoidPtrAndDesc(p, (void *)sig, 0);
#endif
    if (!cobj)
        goto bad;
    if (PyDict_SetItem(d, name, cobj) < 0)
        goto bad;
    Py_DECREF(cobj);
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(cobj);
    Py_XDECREF(d);
    return -1;
}

/* VoidPtrImport */
#include "src/gevent/_generated_include/VoidPtrImport_impl_5efb54e6f8edcd092573f2b78d17c2de.h"
/* FunctionImport */
#include "src/gevent/_generated_include/FunctionImport_impl_9d8d37da3c982df2f162dba4e75cc5d0.h"
/* InitStrings */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             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]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             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]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
