Generated by Cython 3.1.2

Yellow lines hint at Python interaction.
Click on a line that starts with a "`+`" to see the C code that Cython generated for it.

Raw output: _waiter.c

    +001: # -*- coding: utf-8 -*-

      __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     002: # copyright 2018 gevent

     003: # cython: auto_pickle=False,embedsignature=True,always_allow_keywords=False

     004: """

     005: Low-level waiting primitives.

     006:

     007: """

     008: from __future__ import absolute_import

     009: from __future__ import division

     010: from __future__ import print_function

     011:

    +012: import sys

      __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_sys, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_v_6gevent_16_gevent_c_waiter_sys);
      __Pyx_DECREF_SET(__pyx_v_6gevent_16_gevent_c_waiter_sys, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;

     013:

    +014: from gevent._hub_local import get_hub_noargs as get_hub

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent__hub_local, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_get_hub_noargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_hub_noargs, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +015: from gevent.exceptions import ConcurrentObjectUseError

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_ConcurrentObjectUseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent_exceptions, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_ConcurrentObjectUseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError);
      __Pyx_DECREF_SET(__pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     016:

    +017: __all__ = [

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Waiter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_all, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     018:     'Waiter',

     019: ]

     020:

    +021: _NONE = object()

      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin_object);
      __pyx_t_4 = __pyx_builtin_object;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 21, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XGOTREF(__pyx_v_6gevent_16_gevent_c_waiter__NONE);
      __Pyx_DECREF_SET(__pyx_v_6gevent_16_gevent_c_waiter__NONE, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;

     022:

    +023: locals()['getcurrent'] = __import__('greenlet').getcurrent

      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin___import__);
      __pyx_t_3 = __pyx_builtin___import__;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_mstate_global->__pyx_n_u_greenlet_2};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getcurrent); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely((PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_getcurrent, __pyx_t_3) < 0))) __PYX_ERR(0, 23, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +024: 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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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_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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_2lambda, 0, __pyx_mstate_global->__pyx_n_u_lambda, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_Globals(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely((PyDict_SetItem(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_greenlet_init, __pyx_t_3) < 0))) __PYX_ERR(0, 24, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     025:

     026:

    +027: class Waiter(object):

    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;

     028:     """

     029:     A low level communication utility for greenlets.

     030:

     031:     Waiter is a wrapper around greenlet's ``switch()`` and ``throw()`` calls that makes them somewhat safer:

     032:

     033:     * switching will occur only if the waiting greenlet is executing :meth:`get` method currently;

     034:     * any error raised in the greenlet is handled inside :meth:`switch` and :meth:`throw`

     035:     * if :meth:`switch`/:meth:`throw` is called before the receiver calls :meth:`get`, then :class:`Waiter`

     036:       will store the value/exception. The following :meth:`get` will return the value/raise the exception.

     037:

     038:     The :meth:`switch` and :meth:`throw` methods must only be called from the :class:`Hub` greenlet.

     039:     The :meth:`get` method must be called from a greenlet other than :class:`Hub`.

     040:

     041:         >>> from gevent.hub import Waiter

     042:         >>> from gevent import get_hub

     043:         >>> result = Waiter()

     044:         >>> timer = get_hub().loop.timer(0.1)

     045:         >>> timer.start(result.switch, 'hello from Waiter')

     046:         >>> result.get() # blocks for 0.1 seconds

     047:         'hello from Waiter'

     048:         >>> timer.close()

     049:

     050:     If switch is called before the greenlet gets a chance to call :meth:`get` then

     051:     :class:`Waiter` stores the value.

     052:

     053:         >>> from gevent.time import sleep

     054:         >>> result = Waiter()

     055:         >>> timer = get_hub().loop.timer(0.1)

     056:         >>> timer.start(result.switch, 'hi from Waiter')

     057:         >>> sleep(0.2)

     058:         >>> result.get() # returns immediately without blocking

     059:         'hi from Waiter'

     060:         >>> timer.close()

     061:

     062:     .. warning::

     063:

     064:         This is a limited and dangerous way to communicate between

     065:         greenlets. It can easily leave a greenlet unscheduled forever

     066:         if used incorrectly. Consider using safer classes such as

     067:         :class:`gevent.event.Event`, :class:`gevent.event.AsyncResult`,

     068:         or :class:`gevent.queue.Queue`.

     069:     """

     070:

    +071:     __slots__ = ['hub', 'greenlet', 'value', '_exception']

      __pyx_t_3 = __Pyx_PyList_Pack(4, __pyx_mstate_global->__pyx_n_u_hub, __pyx_mstate_global->__pyx_n_u_greenlet_2, __pyx_mstate_global->__pyx_n_u_value_2, __pyx_mstate_global->__pyx_n_u_exception_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter, __pyx_mstate_global->__pyx_n_u_slots, __pyx_t_3) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     072:

    +073:     def __init__(self, hub=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;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hub,0};
      PyObject* values[1] = {0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 73, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 73, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 73, __pyx_L3_error)
          if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
        } else {
          switch (__pyx_nargs) {
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 73, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
        }
        __pyx_v_hub = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 73, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __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 */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __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;
    /* … */
      /* 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;
    }

    +074:         self.hub = get_hub() if hub is None else hub

      __pyx_t_2 = (__pyx_v_hub == Py_None);
      if (__pyx_t_2) {
        __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_mstate_global->__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((PyObject *)__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;

    +075:         self.greenlet = None

      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->greenlet);
      __Pyx_DECREF((PyObject *)__pyx_v_self->greenlet);
      __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);

    +076:         self.value = 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;

    +077:         self._exception = _NONE

      __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;

     078:

    +079:     def clear(self):

    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;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (
      #if !CYTHON_USE_TYPE_SLOTS
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter &&
      __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
      #else
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
      #endif
      ) {
        #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_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 79, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_3clear)) {
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_4 = __pyx_t_1;
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__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_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_typedict_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
      }
    /* … */
      /* 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*/
    PyDoc_STRVAR(__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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("clear (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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_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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_3clear, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Waiter_clear, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter, __pyx_mstate_global->__pyx_n_u_clear, __pyx_t_3) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +080:         self.greenlet = None

      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF((PyObject *)__pyx_v_self->greenlet);
      __Pyx_DECREF((PyObject *)__pyx_v_self->greenlet);
      __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);

    +081:         self.value = 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;

    +082:         self._exception = _NONE

      __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;

     083:

    +084:     def __str__(self):

    /* 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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_7);
      __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;
    }

    +085:         if self._exception is _NONE:

      __pyx_t_1 = (__pyx_v_self->_exception == __pyx_v_6gevent_16_gevent_c_waiter__NONE);
      if (__pyx_t_1) {
    /* … */
      }

    +086:             return '<%s greenlet=%s>' % (type(self).__name__, self.greenlet)

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_2), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(((PyObject *)__pyx_v_self->greenlet)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_4[0] = __pyx_mstate_global->__pyx_kp_u_;
        __pyx_t_4[1] = __pyx_t_3;
        __pyx_t_4[2] = __pyx_mstate_global->__pyx_kp_u_greenlet;
        __pyx_t_4[3] = __pyx_t_2;
        __pyx_t_4[4] = __pyx_mstate_global->__pyx_kp_u__2;
        __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_4, 5, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 86, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_r = __pyx_t_5;
        __pyx_t_5 = 0;
        goto __pyx_L0;

    +087:         if self._exception is None:

      __pyx_t_1 = (__pyx_v_self->_exception == Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +088:             return '<%s greenlet=%s value=%r>' % (type(self).__name__, self.greenlet, self.value)

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(((PyObject *)__pyx_v_self->greenlet)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 88, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_self->value), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 88, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_;
        __pyx_t_6[1] = __pyx_t_2;
        __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_greenlet;
        __pyx_t_6[3] = __pyx_t_5;
        __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u_value;
        __pyx_t_6[5] = __pyx_t_3;
        __pyx_t_6[6] = __pyx_mstate_global->__pyx_kp_u__2;
        __pyx_t_7 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2) + 10 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_5) + 7 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_5) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3));
        if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 88, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_r = __pyx_t_7;
        __pyx_t_7 = 0;
        goto __pyx_L0;

    +089:         return '<%s greenlet=%s exc_info=%r>' % (type(self).__name__, self.greenlet, self.exc_info)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))), __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_7), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(((PyObject *)__pyx_v_self->greenlet)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_exc_info_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_2 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_t_5), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_6[0] = __pyx_mstate_global->__pyx_kp_u_;
      __pyx_t_6[1] = __pyx_t_3;
      __pyx_t_6[2] = __pyx_mstate_global->__pyx_kp_u_greenlet;
      __pyx_t_6[3] = __pyx_t_7;
      __pyx_t_6[4] = __pyx_mstate_global->__pyx_kp_u_exc_info;
      __pyx_t_6[5] = __pyx_t_2;
      __pyx_t_6[6] = __pyx_mstate_global->__pyx_kp_u__2;
      __pyx_t_5 = __Pyx_PyUnicode_Join(__pyx_t_6, 7, 1 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_3) + 10 * 2 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_7) + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_2), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_3) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_7) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_2));
      if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 89, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      __pyx_t_5 = 0;
      goto __pyx_L0;

     090:

    +091:     def ready(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_7ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_6ready, "Waiter.ready(self)\n\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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("ready (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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;
    /* … */
      /* 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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_7ready, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Waiter_ready, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 91, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter, __pyx_mstate_global->__pyx_n_u_ready, __pyx_t_3) < 0) __PYX_ERR(0, 91, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     092:         """Return true if and only if it holds a value or an exception"""

    +093:         return self._exception is not _NONE

      __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;

     094:

    +095:     def successful(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_9successful(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_8successful, "Waiter.successful(self)\n\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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("successful (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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;
    /* … */
      /* 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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_9successful, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Waiter_successful, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 95, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter, __pyx_mstate_global->__pyx_n_u_successful, __pyx_t_3) < 0) __PYX_ERR(0, 95, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     096:         """Return true if and only if it is ready and holds a value"""

    +097:         return self._exception is None

      __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;

     098:

    +099:     @property

    /* 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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     100:     def exc_info(self):

     101:         "Holds the exception info passed to :meth:`throw` if :meth:`throw` was called. Otherwise ``None``."

    +102:         if self._exception is not _NONE:

      __pyx_t_1 = (__pyx_v_self->_exception != __pyx_v_6gevent_16_gevent_c_waiter__NONE);
      if (__pyx_t_1) {
    /* … */
      }

    +103:             return self._exception

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_self->_exception);
        __pyx_r = __pyx_v_self->_exception;
        goto __pyx_L0;

     104:

    +105:     def switch(self, value):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_11switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_10switch, "Waiter.switch(self, value)\n\nSwitch to the greenlet if one's available. Otherwise store the\n*value*.\n\n.. versionchanged:: 1.3b1\n   The *value* is no longer optional.");
    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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("switch (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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;
    /* … */
      /* 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_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_11switch, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Waiter_switch, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter, __pyx_mstate_global->__pyx_n_u_switch, __pyx_t_3) < 0) __PYX_ERR(0, 105, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     106:         """

     107:         Switch to the greenlet if one's available. Otherwise store the

     108:         *value*.

     109:

     110:         .. versionchanged:: 1.3b1

     111:            The *value* is no longer optional.

     112:         """

    +113:         greenlet = self.greenlet

      __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
      __pyx_t_1 = 0;

    +114:         if greenlet is None:

      __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None);
      if (__pyx_t_2) {
    /* … */
        goto __pyx_L3;
      }

    +115:             self.value = value

        __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;

    +116:             self._exception = None

        __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;

     117:         else:

    +118:             if getcurrent() is not self.hub: # pylint:disable=undefined-variable

      /*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_2 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub));
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(__pyx_t_2)) {
    /* … */
        }

    +119:                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")

          __pyx_t_3 = NULL;
          __Pyx_INCREF(__pyx_builtin_AssertionError);
          __pyx_t_4 = __pyx_builtin_AssertionError;
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Can_only_use_Waiter_switch_metho};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            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)

    +120:             switch = greenlet.switch

        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_mstate_global->__pyx_n_u_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;

    +121:             try:

        {
          /*try:*/ {
    /* … */
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L10_try_end;
          __pyx_L5_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
          __pyx_L7_except_error:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          goto __pyx_L1_error;
          __pyx_L6_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          __pyx_L10_try_end:;
        }
      }
      __pyx_L3:;

    +122:                 switch(value)

            __pyx_t_4 = NULL;
            __Pyx_INCREF(__pyx_v_switch);
            __pyx_t_3 = __pyx_v_switch;
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (likely(PyMethod_Check(__pyx_t_3))) {
              __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
              assert(__pyx_t_4);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
              __Pyx_INCREF(__pyx_t_4);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_value};
              __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
              if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L5_error)
              __Pyx_GOTREF(__pyx_t_1);
            }
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +123:             except: # pylint:disable=bare-except

          /*except:*/ {
            __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.switch", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_3, &__pyx_t_4) < 0) __PYX_ERR(0, 123, __pyx_L7_except_error)
            __Pyx_XGOTREF(__pyx_t_1);
            __Pyx_XGOTREF(__pyx_t_3);
            __Pyx_XGOTREF(__pyx_t_4);

    +124:                 self.hub.handle_error(switch, *sys.exc_info())

            __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_mstate_global->__pyx_n_u_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);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_switch) != (0)) __PYX_ERR(0, 124, __pyx_L7_except_error);
            __pyx_t_12 = __pyx_v_6gevent_16_gevent_c_waiter_sys;
            __Pyx_INCREF(__pyx_t_12);
            __pyx_t_5 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
              __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_exc_info_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 124, __pyx_L7_except_error)
              __Pyx_GOTREF(__pyx_t_11);
            }
            __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_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            goto __pyx_L6_exception_handled;
          }

     125:

    +126:     def switch_args(self, *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*/
    PyDoc_STRVAR(__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(*)(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;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("switch_args (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
      if (unlikely(__pyx_kwds_len < 0)) return NULL;
      if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("switch_args", __pyx_kwds); 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_DECREF(__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;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_13switch_args, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Waiter_switch_args, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter, __pyx_mstate_global->__pyx_n_u_switch_args, __pyx_t_3) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +127:         return self.switch(args)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = ((PyObject *)__pyx_v_self);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_args};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_switch, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 127, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     128:

    +129:     def throw(self, *throw_args):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_15throw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_14throw, "Waiter.throw(self, *throw_args)\n\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(*)(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;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("throw (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
      if (unlikely(__pyx_kwds_len < 0)) return NULL;
      if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("throw", __pyx_kwds); 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_DECREF(__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;
    /* … */
      /* 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_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_XDECREF(__pyx_t_12);
      __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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_15throw, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Waiter_throw, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter, __pyx_mstate_global->__pyx_n_u_throw, __pyx_t_3) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     130:         """Switch to the greenlet with the exception. If there's no greenlet, store the exception."""

    +131:         greenlet = self.greenlet

      __pyx_t_1 = ((PyObject *)__pyx_v_self->greenlet);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_greenlet = ((PyGreenlet *)__pyx_t_1);
      __pyx_t_1 = 0;

    +132:         if greenlet is None:

      __pyx_t_2 = (((PyObject *)__pyx_v_greenlet) == Py_None);
      if (__pyx_t_2) {
    /* … */
        goto __pyx_L3;
      }

    +133:             self._exception = throw_args

        __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;

     134:         else:

    +135:             if getcurrent() is not self.hub: # pylint:disable=undefined-variable

      /*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_2 = (__pyx_t_1 != ((PyObject *)__pyx_v_self->hub));
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (unlikely(__pyx_t_2)) {
    /* … */
        }

    +136:                 raise AssertionError("Can only use Waiter.switch method from the Hub greenlet")

          __pyx_t_3 = NULL;
          __Pyx_INCREF(__pyx_builtin_AssertionError);
          __pyx_t_4 = __pyx_builtin_AssertionError;
          __pyx_t_5 = 1;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_mstate_global->__pyx_kp_u_Can_only_use_Waiter_switch_metho};
            __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            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)

    +137:             throw = greenlet.throw

        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_greenlet), __pyx_mstate_global->__pyx_n_u_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;

    +138:             try:

        {
          /*try:*/ {
    /* … */
          }
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          goto __pyx_L10_try_end;
          __pyx_L5_error:;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
          __pyx_L7_except_error:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          goto __pyx_L1_error;
          __pyx_L6_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
          __pyx_L10_try_end:;
        }
      }
      __pyx_L3:;

    +139:                 throw(*throw_args)

            __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;

    +140:             except: # pylint:disable=bare-except

          /*except:*/ {
            __Pyx_AddTraceback("gevent._gevent_c_waiter.Waiter.throw", __pyx_clineno, __pyx_lineno, __pyx_filename);
            if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 140, __pyx_L7_except_error)
            __Pyx_XGOTREF(__pyx_t_1);
            __Pyx_XGOTREF(__pyx_t_4);
            __Pyx_XGOTREF(__pyx_t_3);

    +141:                 self.hub.handle_error(throw, *sys.exc_info())

            __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_mstate_global->__pyx_n_u_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);
            if (__Pyx_PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_v_throw) != (0)) __PYX_ERR(0, 141, __pyx_L7_except_error);
            __pyx_t_12 = __pyx_v_6gevent_16_gevent_c_waiter_sys;
            __Pyx_INCREF(__pyx_t_12);
            __pyx_t_5 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_12, NULL};
              __pyx_t_11 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_exc_info_2, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 141, __pyx_L7_except_error)
              __Pyx_GOTREF(__pyx_t_11);
            }
            __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_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            goto __pyx_L6_exception_handled;
          }

     142:

    +143:     def get(self):

    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;
      /* Check if called by wrapper */
      if (unlikely(__pyx_skip_dispatch)) ;
      /* Check if overridden in Python */
      else if (
      #if !CYTHON_USE_TYPE_SLOTS
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self)) != __pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter &&
      __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), Py_TPFLAGS_HAVE_GC))
      #else
      unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0 || __Pyx_PyType_HasFeature(Py_TYPE(((PyObject *)__pyx_v_self)), (Py_TPFLAGS_IS_ABSTRACT | Py_TPFLAGS_HEAPTYPE)))
      #endif
      ) {
        #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_typedict_guard = __Pyx_get_tp_dict_version(((PyObject *)__pyx_v_self));
          #endif
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_get); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_16_gevent_c_waiter_6Waiter_17get)) {
            __Pyx_XDECREF(__pyx_r);
            __pyx_t_3 = NULL;
            __Pyx_INCREF(__pyx_t_1);
            __pyx_t_4 = __pyx_t_1;
            __pyx_t_5 = 1;
            #if CYTHON_UNPACK_METHODS
            if (unlikely(PyMethod_Check(__pyx_t_4))) {
              __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
              assert(__pyx_t_3);
              PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
              __Pyx_INCREF(__pyx_t_3);
              __Pyx_INCREF(__pyx__function);
              __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
              __pyx_t_5 = 0;
            }
            #endif
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
              __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_DECREF(__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_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_typedict_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
      }
    /* … */
      /* 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_XDECREF(__pyx_t_7);
      __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*/
    PyDoc_STRVAR(__pyx_doc_6gevent_16_gevent_c_waiter_6Waiter_16get, "Waiter.get(self)\n\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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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_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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_6Waiter_17get, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_Waiter_get, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_3) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     144:         """If a value/an exception is stored, return/raise it. Otherwise until switch() or throw() is called."""

    +145:         if self._exception is not _NONE:

      __pyx_t_6 = (__pyx_v_self->_exception != __pyx_v_6gevent_16_gevent_c_waiter__NONE);
      if (__pyx_t_6) {
    /* … */
        goto __pyx_L3;
      }

    +146:             if self._exception is None:

        __pyx_t_6 = (__pyx_v_self->_exception == Py_None);
        if (__pyx_t_6) {
    /* … */
        }

    +147:                 return self.value

          __Pyx_XDECREF(__pyx_r);
          __Pyx_INCREF(__pyx_v_self->value);
          __pyx_r = __pyx_v_self->value;
          goto __pyx_L0;

    +148:             getcurrent().throw(*self._exception) # pylint:disable=undefined-variable

        __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_mstate_global->__pyx_n_u_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_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     149:         else:

    +150:             if self.greenlet is not None:

      /*else*/ {
        __pyx_t_6 = (((PyObject *)__pyx_v_self->greenlet) != Py_None);
        if (unlikely(__pyx_t_6)) {
    /* … */
        }

    +151:                 raise ConcurrentObjectUseError('This Waiter is already used by %r' % (self.greenlet, ))

          __pyx_t_1 = NULL;
          __Pyx_INCREF(__pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError);
          __pyx_t_2 = __pyx_v_6gevent_16_gevent_c_waiter_ConcurrentObjectUseError;
          __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(((PyObject *)__pyx_v_self->greenlet)), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_7 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_This_Waiter_is_already_used_by, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 151, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_5 = 1;
          #if CYTHON_UNPACK_METHODS
          if (unlikely(PyMethod_Check(__pyx_t_2))) {
            __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
            assert(__pyx_t_1);
            PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_2);
            __Pyx_INCREF(__pyx_t_1);
            __Pyx_INCREF(__pyx__function);
            __Pyx_DECREF_SET(__pyx_t_2, __pyx__function);
            __pyx_t_5 = 0;
          }
          #endif
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_7};
            __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 151, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
          }
          __Pyx_Raise(__pyx_t_4, 0, 0, 0);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          __PYX_ERR(0, 151, __pyx_L1_error)

    +152:             self.greenlet = getcurrent() # pylint:disable=undefined-variable

        __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_16_gevent_c_waiter_getcurrent()); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __Pyx_GOTREF((PyObject *)__pyx_v_self->greenlet);
        __Pyx_DECREF((PyObject *)__pyx_v_self->greenlet);
        __pyx_v_self->greenlet = ((PyGreenlet *)__pyx_t_4);
        __pyx_t_4 = 0;

    +153:             try:

        /*try:*/ {

    +154:                 return self.hub.switch()

          __Pyx_XDECREF(__pyx_r);
          __pyx_t_4 = ((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_4)) __PYX_ERR(0, 154, __pyx_L7_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_r = __pyx_t_4;
          __pyx_t_4 = 0;
          goto __pyx_L6_return;
        }

     155:             finally:

    +156:                 self.greenlet = None

        /*finally:*/ {
          __pyx_L7_error:;
          /*exception exit:*/{
            __Pyx_PyThreadState_declare
            __Pyx_PyThreadState_assign
            __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 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;
            __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
             __Pyx_ExceptionSwap(&__pyx_t_14, &__pyx_t_15, &__pyx_t_16);
            if ( unlikely(__Pyx_GetException(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13) < 0)) __Pyx_ErrFetch(&__pyx_t_11, &__pyx_t_12, &__pyx_t_13);
            __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_XGOTREF(__pyx_t_16);
            __pyx_t_8 = __pyx_lineno; __pyx_t_9 = __pyx_clineno; __pyx_t_10 = __pyx_filename;
            {
              __Pyx_INCREF(Py_None);
              __Pyx_GIVEREF(Py_None);
              __Pyx_GOTREF((PyObject *)__pyx_v_self->greenlet);
              __Pyx_DECREF((PyObject *)__pyx_v_self->greenlet);
              __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
            }
            __Pyx_XGIVEREF(__pyx_t_14);
            __Pyx_XGIVEREF(__pyx_t_15);
            __Pyx_XGIVEREF(__pyx_t_16);
            __Pyx_ExceptionReset(__pyx_t_14, __pyx_t_15, __pyx_t_16);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_XGIVEREF(__pyx_t_12);
            __Pyx_XGIVEREF(__pyx_t_13);
            __Pyx_ErrRestore(__pyx_t_11, __pyx_t_12, __pyx_t_13);
            __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0;
            __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_9; __pyx_filename = __pyx_t_10;
            goto __pyx_L1_error;
          }
          __pyx_L6_return: {
            __pyx_t_16 = __pyx_r;
            __pyx_r = 0;
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            __Pyx_GOTREF((PyObject *)__pyx_v_self->greenlet);
            __Pyx_DECREF((PyObject *)__pyx_v_self->greenlet);
            __pyx_v_self->greenlet = ((PyGreenlet *)Py_None);
            __pyx_r = __pyx_t_16;
            __pyx_t_16 = 0;
            goto __pyx_L0;
          }
        }
      }
      __pyx_L3:;

     157:

    +158:     def __call__(self, source):

    /* 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;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_source,0};
      PyObject* values[1] = {0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 158, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 158, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__call__", 0) < 0) __PYX_ERR(0, 158, __pyx_L3_error)
          for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
            if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, i); __PYX_ERR(0, 158, __pyx_L3_error) }
          }
        } else if (unlikely(__pyx_nargs != 1)) {
          goto __pyx_L5_argtuple_error;
        } else {
          values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
          if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 158, __pyx_L3_error)
        }
        __pyx_v_source = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 158, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __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);
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __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;
    /* … */
      /* 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_3);
      __Pyx_XDECREF(__pyx_t_4);
      __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;
    }

    +159:         if source.exception is None:

      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_mstate_global->__pyx_n_u_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;
      if (__pyx_t_2) {
    /* … */
        goto __pyx_L3;
      }

    +160:             self.switch(source.value)

        __pyx_t_3 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_mstate_global->__pyx_n_u_value_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_4};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_switch, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     161:         else:

    +162:             self.throw(source.exception)

      /*else*/ {
        __pyx_t_4 = ((PyObject *)__pyx_v_self);
        __Pyx_INCREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_source, __pyx_mstate_global->__pyx_n_u_exception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_throw, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L3:;

     163:

     164:     # can also have a debugging version, that wraps the value in a tuple (self, value) in switch()

     165:     # and unwraps it in wait() thus checking that switch() was indeed called

     166:

     167:

     168:

    +169: class MultipleWaiter(Waiter):

    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;

     170:     """

     171:     An internal extension of Waiter that can be used if multiple objects

     172:     must be waited on, and there is a chance that in between waits greenlets

     173:     might be switched out. All greenlets that switch to this waiter

     174:     will have their value returned.

     175:

     176:     This does not handle exceptions or throw methods.

     177:     """

    +178:     __slots__ = ['_values']

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_values); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter, __pyx_mstate_global->__pyx_n_u_slots, __pyx_t_3) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     179:

    +180:     def __init__(self, hub=None):

    /* 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;
      CYTHON_UNUSED Py_ssize_t __pyx_nargs;
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      int __pyx_r;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
      #if CYTHON_ASSUME_SAFE_SIZE
      __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
      #else
      __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return -1;
      #endif
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      {
        PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_hub,0};
      PyObject* values[1] = {0};
        const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
        if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 180, __pyx_L3_error)
        if (__pyx_kwds_len > 0) {
          switch (__pyx_nargs) {
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 180, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          const Py_ssize_t kwd_pos_args = __pyx_nargs;
          if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < 0) __PYX_ERR(0, 180, __pyx_L3_error)
          if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
        } else {
          switch (__pyx_nargs) {
            case  1:
            values[0] = __Pyx_ArgRef_VARARGS(__pyx_args, 0);
            if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 180, __pyx_L3_error)
            CYTHON_FALLTHROUGH;
            case  0: break;
            default: goto __pyx_L5_argtuple_error;
          }
          if (!values[0]) values[0] = __Pyx_NewRef(((PyObject *)Py_None));
        }
        __pyx_v_hub = values[0];
      }
      goto __pyx_L6_skip;
      __pyx_L5_argtuple_error:;
      __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 180, __pyx_L3_error)
      __pyx_L6_skip:;
      goto __pyx_L4_argument_unpacking_done;
      __pyx_L3_error:;
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __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 */
      for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
        Py_XDECREF(values[__pyx_temp]);
      }
      __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;
    /* … */
      /* function exit code */
      __pyx_r = 0;
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_c_waiter.MultipleWaiter.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +181:         Waiter.__init__(self, hub)

      __pyx_t_2 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);
      __Pyx_INCREF(__pyx_t_2);
      __pyx_t_3 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_2, ((PyObject *)__pyx_v_self), __pyx_v_hub};
        __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_init, __pyx_callargs+__pyx_t_3, (3-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     182:         # we typically expect a relatively small number of these to be outstanding.

     183:         # since we pop from the left, a deque might be slightly

     184:         # more efficient, but since we're in the hub we avoid imports if

     185:         # we can help it to better support monkey-patching, and delaying the import

     186:         # here can be impractical (see https://github.com/gevent/gevent/issues/652)

    +187:         self._values = []

      __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;

     188:

    +189:     def switch(self, value):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_14MultipleWaiter_3switch(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
    PyDoc_STRVAR(__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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("switch (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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;
    /* … */
      /* 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_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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_14MultipleWaiter_3switch, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MultipleWaiter_switch, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 189, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter, __pyx_mstate_global->__pyx_n_u_switch, __pyx_t_3) < 0) __PYX_ERR(0, 189, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +190:         self._values.append(value)

      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)

    +191:         Waiter.switch(self, True)

      __pyx_t_3 = ((PyObject *)__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_Waiter);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_t_4 = 0;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, ((PyObject *)__pyx_v_self), Py_True};
        __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_switch, __pyx_callargs+__pyx_t_4, (3-__pyx_t_4) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     192:

    +193:     def 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;
    /* … */
      /* 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*/
    PyDoc_STRVAR(__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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("get (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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_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;
    }
    /* … */
      __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_14MultipleWaiter_5get, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_MultipleWaiter_get, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[9])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_16_gevent_c_waiter_MultipleWaiter, __pyx_mstate_global->__pyx_n_u_get, __pyx_t_3) < 0) __PYX_ERR(0, 193, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +194:         if not self._values:

      __pyx_t_1 = (__pyx_v_self->_values != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_self->_values) != 0);
      if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 194, __pyx_L1_error)
      __pyx_t_2 = (!__pyx_t_1);
      if (__pyx_t_2) {
    /* … */
      }

    +195:             Waiter.get(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;

    +196:             Waiter.clear(self)

        __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;

     197:

    +198:         return self._values.pop(0)

      __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_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_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;

     199:

    +200: def _init():

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_16_gevent_c_waiter_1_init(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__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) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_init (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __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_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_16_gevent_c_waiter_1_init, 0, __pyx_mstate_global->__pyx_n_u_init_2, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_waiter, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[10])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_init_2, __pyx_t_3) < 0) __PYX_ERR(0, 200, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +201:     greenlet_init() # pylint:disable=undefined-variable

      __pyx_f_6gevent_16_gevent_c_waiter_greenlet_init(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 201, __pyx_L1_error)

     202:

    +203: _init()

      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_init_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     204:

     205:

    +206: from gevent._util import import_c_accel

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_import_c_accel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent__util, __pyx_t_3, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_ImportFrom(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_import_c_accel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_import_c_accel, __pyx_t_3) < 0) __PYX_ERR(0, 206, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +207: import_c_accel(globals(), 'gevent.__waiter')

      __pyx_t_3 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_import_c_accel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_Globals(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 207, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_3, __pyx_t_6, __pyx_mstate_global->__pyx_kp_u_gevent___waiter};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;