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: _abstract_linkable.c

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

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

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

     003: """

     004: Internal use only base class for objects

     005: that can be waited on and then asked to notify (wake up)

     006: waiters.  Examples include locks, events, semaphores.

     007:

     008: gevent has the generic concept of "linkable" objects, or the "linkable"

     009: protocol, which is the ``link`` and ``rawlink`` methods. (Actually sending

     010: the notification is up to the implementation of the individual

     011: objects.) `gevent.greenlet.Greenlet` implements this protocol but

     012: does not extend this object (TODO: It probably should.)

     013: """

    +014: import sys

      __pyx_t_2 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_sys, NULL); 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_sys, __pyx_t_2) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +015: from gc import get_objects

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_get_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gc, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __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_objects); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects);
      __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     016:

    +017: from greenlet import greenlet

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_greenlet); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_greenlet, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +018: from greenlet import error as greenlet_error

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_greenlet, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __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_error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_greenlet_error, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     019:

    +020: from gevent._compat import thread_mod_name

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_thread_mod_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent__compat, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 20, __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_thread_mod_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_thread_mod_name, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +021: 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, 21, __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, 21, __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, 21, __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, 21, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +022: from gevent._hub_local import get_hub_if_exists

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_get_hub_if_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent__hub_local, __pyx_t_3, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 22, __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_get_hub_if_exists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_get_hub_if_exists, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     023:

    +024: from gevent.exceptions import InvalidSwitchError

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent_exceptions, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __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_InvalidSwitchError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError);
      __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +025: from gevent.exceptions import InvalidThreadUseError

      __pyx_t_3 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_InvalidThreadUseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __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, 25, __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_InvalidThreadUseError); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 25, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError);
      __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError, __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;

    +026: from gevent.timeout import Timeout

      __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent_timeout, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 26, __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_Timeout); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout);
      __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

     027:

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

      __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_builtin___import__);
      __pyx_t_4 = __pyx_builtin___import__;
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_mstate_global->__pyx_n_u_greenlet};
        __pyx_t_3 = __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_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getcurrent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely((PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_getcurrent, __pyx_t_4) < 0))) __PYX_ERR(0, 28, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +029: locals()['greenlet_init'] = lambda: None

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_lambda = {"lambda", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_lambda, METH_NOARGS, 0};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_lambda(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_27_gevent_c_abstract_linkable_lambda(__pyx_self);

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

    static PyObject *__pyx_lambda_funcdef_6gevent_27_gevent_c_abstract_linkable_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_4 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_lambda, 0, __pyx_mstate_global->__pyx_n_u_lambda, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = __Pyx_Globals(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 29, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely((PyDict_SetItem(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_greenlet_init, __pyx_t_4) < 0))) __PYX_ERR(0, 29, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     030:

    +031: __all__ = [

      __pyx_t_4 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_AbstractLinkable); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 31, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_all, __pyx_t_4) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     032:     'AbstractLinkable',

     033: ]

     034:

     035: # Need the real get_ident. We're imported early enough during monkey-patching

     036: # that we can be sure nothing is monkey patched yet.

    +037: _get_thread_ident = __import__(thread_mod_name).get_ident

      __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_builtin___import__);
      __pyx_t_2 = __pyx_builtin___import__;
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_mstate_global->__pyx_n_u_thread_mod_name); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_t_6};
        __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_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, 37, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
      }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_get_ident); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XGOTREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident);
      __Pyx_DECREF_SET(__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;

    +038: _allocate_thread_lock = __import__(thread_mod_name).allocate_lock

      __pyx_t_4 = NULL;
      __Pyx_INCREF(__pyx_builtin___import__);
      __pyx_t_6 = __pyx_builtin___import__;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_thread_mod_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = 1;
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __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;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 38, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      }
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_allocate_lock); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 38, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_allocate_thread_lock, __pyx_t_6) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     039:

     040: class _FakeNotifier(object):

     041:     __slots__ = (

    +042:         'pending',

      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable__FakeNotifier, __pyx_mstate_global->__pyx_n_u_slots, __pyx_mstate_global->__pyx_tuple[2]) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
    /* … */
      __pyx_mstate_global->__pyx_tuple[2] = PyTuple_Pack(1, __pyx_mstate_global->__pyx_n_u_pending); if (unlikely(!__pyx_mstate_global->__pyx_tuple[2])) __PYX_ERR(0, 42, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[2]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[2]);

     043:     )

     044:

    +045:     def __init__(self):

    /* Python wrapper */
    static int __pyx_pw_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
      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);
      if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, __pyx_nargs); return -1; }
      const Py_ssize_t __pyx_kwds_len = unlikely(__pyx_kwds) ? __Pyx_NumKwargs_VARARGS(__pyx_kwds) : 0;
      if (unlikely(__pyx_kwds_len < 0)) return -1;
      if (unlikely(__pyx_kwds_len > 0)) {__Pyx_RejectKeywords("__init__", __pyx_kwds); return -1;}
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier___init__(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier *)__pyx_v_self));

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

    static int __pyx_pf_6gevent_27_gevent_c_abstract_linkable_13_FakeNotifier___init__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable__FakeNotifier *__pyx_v_self) {
      int __pyx_r;
    /* … */
      /* function exit code */
      __pyx_r = 0;
      return __pyx_r;
    }

    +046:         self.pending = False

      __pyx_v_self->pending = 0;

     047:

    +048: def get_roots_and_hubs():

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_get_roots_and_hubs(void) {
      PyObject *__pyx_v_Hub = NULL;
      PyObject *__pyx_7genexpr__pyx_v_x = NULL;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __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_abstract_linkable.get_roots_and_hubs", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_Hub);
      __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +049:     from gevent.hub import Hub # delay import

      __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_mstate_global->__pyx_n_u_Hub);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_n_u_Hub);
      if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_mstate_global->__pyx_n_u_Hub) != (0)) __PYX_ERR(0, 49, __pyx_L1_error);
      __pyx_t_2 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_gevent_hub, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_Hub); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_Hub = __pyx_t_1;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +050:     return {

      __Pyx_XDECREF(__pyx_r);
      { /* enter inner scope */
        __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);

    +051:         x.parent: x

            __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_x, __pyx_mstate_global->__pyx_n_u_parent); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L5_error)
            __Pyx_GOTREF(__pyx_t_1);
            if (unlikely(PyDict_SetItem(__pyx_t_2, (PyObject*)__pyx_t_1, (PyObject*)__pyx_7genexpr__pyx_v_x))) __PYX_ERR(0, 51, __pyx_L5_error)
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +052:         for x in get_objects()

        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects);
        __pyx_t_4 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_get_objects;
        __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_1 = __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_1)) __PYX_ERR(0, 52, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
          __pyx_t_4 = __pyx_t_1; __Pyx_INCREF(__pyx_t_4);
          __pyx_t_6 = 0;
          __pyx_t_7 = NULL;
        } else {
          __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_7 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 52, __pyx_L5_error)
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        for (;;) {
          if (likely(!__pyx_t_7)) {
            if (likely(PyList_CheckExact(__pyx_t_4))) {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyList_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 52, __pyx_L5_error)
                #endif
                if (__pyx_t_6 >= __pyx_temp) break;
              }
              __pyx_t_1 = __Pyx_PyList_GetItemRef(__pyx_t_4, __pyx_t_6);
              ++__pyx_t_6;
            } else {
              {
                Py_ssize_t __pyx_temp = __Pyx_PyTuple_GET_SIZE(__pyx_t_4);
                #if !CYTHON_ASSUME_SAFE_SIZE
                if (unlikely((__pyx_temp < 0))) __PYX_ERR(0, 52, __pyx_L5_error)
                #endif
                if (__pyx_t_6 >= __pyx_temp) break;
              }
              #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
              __pyx_t_1 = __Pyx_NewRef(PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6));
              #else
              __pyx_t_1 = __Pyx_PySequence_ITEM(__pyx_t_4, __pyx_t_6);
              #endif
              ++__pyx_t_6;
            }
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L5_error)
          } else {
            __pyx_t_1 = __pyx_t_7(__pyx_t_4);
            if (unlikely(!__pyx_t_1)) {
              PyObject* exc_type = PyErr_Occurred();
              if (exc_type) {
                if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) __PYX_ERR(0, 52, __pyx_L5_error)
                PyErr_Clear();
              }
              break;
            }
          }
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_XDECREF_SET(__pyx_7genexpr__pyx_v_x, __pyx_t_1);
          __pyx_t_1 = 0;
    /* … */
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
        goto __pyx_L12_exit_scope;
        __pyx_L5_error:;
        __Pyx_XDECREF(__pyx_7genexpr__pyx_v_x); __pyx_7genexpr__pyx_v_x = 0;
        goto __pyx_L1_error;
        __pyx_L12_exit_scope:;
      } /* exit inner scope */
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      goto __pyx_L0;

     053:         # Make sure to only find hubs that have a loop

     054:         # and aren't destroyed. If we don't do that, we can

     055:         # get an old hub that no longer works leading to issues in

     056:         # combined test cases.

    +057:         if isinstance(x, Hub) and x.loop is not None

          __pyx_t_9 = PyObject_IsInstance(__pyx_7genexpr__pyx_v_x, __pyx_v_Hub); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 57, __pyx_L5_error)
          if (__pyx_t_9) {
          } else {
            __pyx_t_8 = __pyx_t_9;
            goto __pyx_L9_bool_binop_done;
          }
          __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_7genexpr__pyx_v_x, __pyx_mstate_global->__pyx_n_u_loop); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_9 = (__pyx_t_1 != Py_None);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __pyx_t_8 = __pyx_t_9;
          __pyx_L9_bool_binop_done:;
          if (__pyx_t_8) {
    /* … */
          }

     058:     }

     059:

     060:

    +061: class AbstractLinkable(object):

    struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable {
      PyObject *(*linkcount)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
      PyObject *(*rawlink)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
      int (*ready)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
      PyObject *(*unlink)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
      PyObject *(*_check_and_notify)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *);
      struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *(*_capture_hub)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int);
      PyObject *(*_AbstractLinkable__wait_to_be_notified)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int);
      void (*_quiet_unlink_all)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *);
      int (*_switch_to_hub)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *);
      PyObject *(*_notify_link_list)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *);
      PyObject *(*_notify_links)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int __pyx_skip_dispatch);
      PyObject *(*_handle_unswitched_notifications)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *);
      PyObject *(*_AbstractLinkable__print_unswitched_warning)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, int);
      PyObject *(*_drop_lock_for_switch_out)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
      PyObject *(*_acquire_lock_for_switch_in)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int __pyx_skip_dispatch);
      PyObject *(*_wait_core)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, PyObject *, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args);
      PyObject *(*_wait_return_value)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, int, int);
      PyObject *(*_wait)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args);
      PyObject *(*_allocate_lock)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *);
      PyGreenlet *(*_getcurrent)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *);
      PyObject *(*_get_thread_ident)(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *);
    };
    static struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_vtabptr_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable;

     062:     # Encapsulates the standard parts of the linking and notifying

     063:     # protocol common to both repeatable events (Event, Semaphore) and

     064:     # one-time events (AsyncResult).

     065:     #

     066:     # With a few careful exceptions, instances of this object can only

     067:     # be used from a single thread. The exception is that certain methods

     068:     # may be used from multiple threads IFF:

     069:     #

     070:     # 1.  They are documented as safe for that purpose; AND

     071:     # 2a. This object is compiled with Cython and thus is holding the GIL

     072:     #     for the entire duration of the method; OR

     073:     # 2b. A subclass ensures that a Python-level native thread lock is held

     074:     #     for the duration of the method; this is necessary in pure-Python mode.

     075:     #     The only known implementation of such

     076:     #     a subclass is for Semaphore. AND

     077:     # 3. The subclass that calls ``capture_hub`` catches

     078:     #    and handles ``InvalidThreadUseError``

     079:     #

     080:     # TODO: As of gevent 1.5, we use the same datastructures and almost

     081:     # the same algorithm as Greenlet. See about unifying them more.

     082:

     083:     __slots__ = (

    +084:         'hub',

      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_slots, __pyx_mstate_global->__pyx_tuple[3]) < 0) __PYX_ERR(0, 83, __pyx_L1_error)

     085:         '_links',

     086:         '_notifier',

     087:         '_notify_all',

     088:         '__weakref__'

     089:     )

     090:

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

    /* Python wrapper */
    static int __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
    static int __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_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, 91, __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, 91, __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, 91, __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, 91, __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, 91, __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_abstract_linkable.AbstractLinkable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __Pyx_RefNannyFinishContext();
      return -1;
      __pyx_L4_argument_unpacking_done:;
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable___init__(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), __pyx_v_hub);

      /* 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_27_gevent_c_abstract_linkable_16AbstractLinkable___init__(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__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_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     092:         # Before this implementation, AsyncResult and Semaphore

     093:         # maintained the order of notifications, but Event did not.

     094:

     095:         # In gevent 1.3, before Semaphore extended this class, that

     096:         # was changed to not maintain the order. It was done because

     097:         # Event guaranteed to only call callbacks once (a set) but

     098:         # AsyncResult had no such guarantees. When Semaphore was

     099:         # changed to extend this class, it lost its ordering

     100:         # guarantees. Unfortunately, that made it unfair. There are

     101:         # rare cases that this can starve a greenlet

     102:         # (https://github.com/gevent/gevent/issues/1487) and maybe

     103:         # even lead to deadlock (not tested).

     104:

     105:         # So in gevent 1.5 we go back to maintaining order. But it's

     106:         # still important not to make duplicate calls, and it's also

     107:         # important to avoid O(n^2) behaviour that can result from

     108:         # naive use of a simple list due to the need to handle removed

     109:         # links in the _notify_links loop. Cython has special support for

     110:         # built-in sets, lists, and dicts, but not ordereddict. Rather than

     111:         # use two data structures, or a dict({link: order}), we simply use a

     112:         # list and remove objects as we go, keeping track of them so as not to

     113:         # have duplicates called. This makes `unlink` O(n), but we can avoid

     114:         # calling it in the common case in _wait_core (even so, the number of

     115:         # waiters should usually be pretty small)

    +116:         self._links = []

      __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->_links);
      __Pyx_DECREF(__pyx_v_self->_links);
      __pyx_v_self->_links = ((PyObject*)__pyx_t_1);
      __pyx_t_1 = 0;

    +117:         self._notifier = None

      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->_notifier);
      __Pyx_DECREF(__pyx_v_self->_notifier);
      __pyx_v_self->_notifier = Py_None;

     118:         # This is conceptually a class attribute, defined here for ease of access in

     119:         # cython. If it's true, when notifiers fire, all existing callbacks are called.

     120:         # If its false, we only call callbacks as long as ready() returns true.

    +121:         self._notify_all = True

      __pyx_v_self->_notify_all = 1;

     122:         # we don't want to do get_hub() here to allow defining module-level objects

     123:         # without initializing the hub. However, for multiple-thread safety, as soon

     124:         # as a waiting method is entered, even if it won't have to wait, we

     125:         # need to grab the hub and assign ownership. But we don't want to grab one prematurely.

     126:         # The example is three threads, the main thread and two worker threads; if we create

     127:         # a Semaphore in the main thread but only use it in the two threads, if we had grabbed

     128:         # the main thread's hub, the two worker threads would have a dependency on it, meaning that

     129:         # if the main event loop is blocked, the worker threads might get blocked too.

    +130:         self.hub = hub

      __pyx_t_1 = __pyx_v_hub;
      __Pyx_INCREF(__pyx_t_1);
      if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_mstate_global->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 130, __pyx_L1_error)
      __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;

     131:

    +132:     def linkcount(self):

    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_linkcount(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
      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_27_gevent_c_abstract_linkable_AbstractLinkable &&
      __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_linkcount); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount)) {
            __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, 132, __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_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_abstract_linkable.AbstractLinkable.linkcount", __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_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount, "AbstractLinkable.linkcount(self)");
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount = {"linkcount", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("linkcount (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_2linkcount(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_linkcount(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 132, __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_abstract_linkable.AbstractLinkable.linkcount", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_3linkcount, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbstractLinkable_linkcount, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_linkcount, __pyx_t_6) < 0) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     133:         # For testing: how many objects are linked to this one?

    +134:         return len(self._links)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_v_self->_links;
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_t_1 == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
        __PYX_ERR(0, 134, __pyx_L1_error)
      }
      __pyx_t_6 = __Pyx_PyList_GET_SIZE(__pyx_t_1); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyLong_FromSsize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     135:

    +136:     def ready(self):

    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static int __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_ready(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
      int __pyx_r;
      /* 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_27_gevent_c_abstract_linkable_AbstractLinkable &&
      __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_ready); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 136, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready)) {
            __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, 136, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
            __pyx_r = __pyx_t_6;
            __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_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_abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready, "AbstractLinkable.ready(self) -> bool");
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready = {"ready", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready(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_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_4ready(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_ready(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 136, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      goto __pyx_L0;

      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.ready", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_5ready, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbstractLinkable_ready, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_ready, __pyx_t_6) < 0) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     137:         # Instances must define this

    +138:         raise NotImplementedError

      __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0, 0);
      __PYX_ERR(0, 138, __pyx_L1_error)

     139:

    +140:     def rawlink(self, callback):

    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_rawlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
      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_27_gevent_c_abstract_linkable_AbstractLinkable &&
      __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_rawlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink)) {
            __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, __pyx_v_callback};
              __pyx_t_2 = __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_2)) __PYX_ERR(0, 140, __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_8);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable.rawlink", __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_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink, "AbstractLinkable.rawlink(self, callback)\n\nRegister a callback to call when this object is ready.\n\n*callback* will be called in the :class:`Hub\n<gevent.hub.Hub>`, so it must not use blocking gevent API.\n*callback* will be passed one argument: this instance.");
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink = {"rawlink", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink, METH_O, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("rawlink (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

    static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_6rawlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_rawlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __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_abstract_linkable.AbstractLinkable.rawlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_7rawlink, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbstractLinkable_rawlink, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_rawlink, __pyx_t_6) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     141:         """

     142:         Register a callback to call when this object is ready.

     143:

     144:         *callback* will be called in the :class:`Hub

     145:         <gevent.hub.Hub>`, so it must not use blocking gevent API.

     146:         *callback* will be passed one argument: this instance.

     147:         """

    +148:         if not callable(callback):

      __pyx_t_6 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 148, __pyx_L1_error)
      __pyx_t_7 = (!__pyx_t_6);
      if (unlikely(__pyx_t_7)) {
    /* … */
      }

    +149:             raise TypeError('Expected callable: %r' % (callback, ))

        __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_builtin_TypeError);
        __pyx_t_4 = __pyx_builtin_TypeError;
        __pyx_t_3 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_callback), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_PyUnicode_Concat(__pyx_mstate_global->__pyx_kp_u_Expected_callable, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 149, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_5 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_8};
          __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_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __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, 149, __pyx_L1_error)

    +150:         self._links.append(callback)

      if (unlikely(__pyx_v_self->_links == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "append");
        __PYX_ERR(0, 150, __pyx_L1_error)
      }
      __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_self->_links, __pyx_v_callback); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 150, __pyx_L1_error)

    +151:         self._check_and_notify()

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     152:

    +153:     def unlink(self, callback):

    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_unlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback, int __pyx_skip_dispatch) {
      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_27_gevent_c_abstract_linkable_AbstractLinkable &&
      __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_unlink); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink)) {
            __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, __pyx_v_callback};
              __pyx_t_2 = __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_2)) __PYX_ERR(0, 153, __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_abstract_linkable.AbstractLinkable.unlink", __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_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink, "AbstractLinkable.unlink(self, callback)\n\nRemove the callback set by :meth:`rawlink`");
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink = {"unlink", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink, METH_O, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("unlink (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

    static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_8unlink(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_callback) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_unlink(__pyx_v_self, __pyx_v_callback, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __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_abstract_linkable.AbstractLinkable.unlink", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_9unlink, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbstractLinkable_unlink, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_unlink, __pyx_t_6) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     154:         """Remove the callback set by :meth:`rawlink`"""

    +155:         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_L8_try_end;
        __pyx_L3_error:;
        __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_L5_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_L4_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_L8_try_end:;
      }

    +156:             self._links.remove(callback)

          __pyx_t_2 = __pyx_v_self->_links;
          __Pyx_INCREF(__pyx_t_2);
          __pyx_t_5 = 0;
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_callback};
            __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_5, (2-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L3_error)
            __Pyx_GOTREF(__pyx_t_1);
          }
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +157:         except ValueError:

        __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
        if (__pyx_t_9) {
          __Pyx_ErrRestore(0,0,0);
          goto __pyx_L4_exception_handled;
        }
        goto __pyx_L5_except_error;

     158:             pass

     159:

    +160:         if not self._links and self._notifier is not None and self._notifier.pending:

      __pyx_t_11 = (__pyx_v_self->_links != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_self->_links) != 0);
      if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_11 < 0))) __PYX_ERR(0, 160, __pyx_L1_error)
      __pyx_t_12 = (!__pyx_t_11);
      if (__pyx_t_12) {
      } else {
        __pyx_t_10 = __pyx_t_12;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_12 = (__pyx_v_self->_notifier != Py_None);
      if (__pyx_t_12) {
      } else {
        __pyx_t_10 = __pyx_t_12;
        goto __pyx_L12_bool_binop_done;
      }
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_mstate_global->__pyx_n_u_pending); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_12 < 0))) __PYX_ERR(0, 160, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_10 = __pyx_t_12;
      __pyx_L12_bool_binop_done:;
      if (__pyx_t_10) {
    /* … */
      }

     161:             # If we currently have one queued, but not running, de-queue it.

     162:             # This will break a reference cycle.

     163:             # (self._notifier -> self._notify_links -> self)

     164:             # If it's actually running, though, (and we're here as a result of callbacks)

     165:             # we don't want to change it; it needs to finish what its doing

     166:             # so we don't attempt to start a fresh one or swap it out from underneath the

     167:             # _notify_links method.

    +168:             self._notifier.stop()

        __pyx_t_2 = __pyx_v_self->_notifier;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_5 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_stop, __pyx_callargs+__pyx_t_5, (1-__pyx_t_5) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     169:

    +170:     def _allocate_lock(self):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__allocate_lock(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._allocate_lock", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +171:         return _allocate_thread_lock()

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = NULL;
      __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_allocate_thread_lock); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     172:

    +173:     def _getcurrent(self):

    static PyGreenlet *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__getcurrent(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      PyGreenlet *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._getcurrent", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF((PyObject *)__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +174:         return getcurrent() # pylint:disable=undefined-variable

      __Pyx_XDECREF((PyObject *)__pyx_r);
      __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = ((PyGreenlet *)__pyx_t_1);
      __pyx_t_1 = 0;
      goto __pyx_L0;

     175:

    +176:     def _get_thread_ident(self):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__get_thread_ident(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._get_thread_ident", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +177:         return _get_thread_ident()

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident);
      __pyx_t_3 = __pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident;
      __pyx_t_4 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        assert(__pyx_t_2);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_3, __pyx__function);
        __pyx_t_4 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+__pyx_t_4, (1-__pyx_t_4) | (__pyx_t_4*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     178:

    +179:     def _capture_hub(self, create):

    static struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__capture_hub(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_v_create) {
      struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_my_hub = NULL;
      struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_current_hub = NULL;
      struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._capture_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_my_hub);
      __Pyx_XDECREF((PyObject *)__pyx_v_current_hub);
      __Pyx_XGIVEREF((PyObject *)__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     180:         # Subclasses should call this as the first action from any

     181:         # public method that could, in theory, block and switch

     182:         # to the hub. This may release the GIL. It may

     183:         # raise InvalidThreadUseError if the result would

     184:

     185:         # First, detect a dead hub and drop it.

    +186:         while 1:

      while (1) {

    +187:             my_hub = self.hub

        __pyx_t_1 = ((PyObject *)__pyx_v_self->hub);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_my_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1));
        __pyx_t_1 = 0;

    +188:             if my_hub is None:

        __pyx_t_2 = (((PyObject *)__pyx_v_my_hub) == Py_None);
        if (__pyx_t_2) {
    /* … */
        }

    +189:                 break

          goto __pyx_L4_break;

    +190:             if my_hub.dead: # dead is a property, could release GIL

        __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_my_hub), __pyx_mstate_global->__pyx_n_u_dead); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 190, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        if (__pyx_t_2) {
    /* … */
          goto __pyx_L6;
        }

     191:                 # back, holding GIL

    +192:                 if self.hub is my_hub:

          __pyx_t_2 = (__pyx_v_self->hub == __pyx_v_my_hub);
          if (__pyx_t_2) {
    /* … */
          }

    +193:                     self.hub = None

            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            __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 *)Py_None);

    +194:                     my_hub = None

            __Pyx_INCREF(Py_None);
            __Pyx_DECREF_SET(__pyx_v_my_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None));

    +195:                     break

            goto __pyx_L4_break;

     196:             else:

    +197:                 break

        /*else*/ {
          goto __pyx_L4_break;
        }
        __pyx_L6:;
      }
      __pyx_L4_break:;

     198:

    +199:         if self.hub is None:

      __pyx_t_2 = (((PyObject *)__pyx_v_self->hub) == Py_None);
      if (__pyx_t_2) {
    /* … */
      }

     200:             # This next line might release the GIL.

    +201:             current_hub = get_hub() if create else get_hub_if_exists()

        if (__pyx_v_create) {
          __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_noargs(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __pyx_t_3;
          __pyx_t_3 = 0;
        } else {
          __pyx_t_3 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_1 = __pyx_t_3;
          __pyx_t_3 = 0;
        }
        __pyx_v_current_hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_1);
        __pyx_t_1 = 0;

     202:

     203:             # We have the GIL again. Did anything change? If so,

     204:             # we lost the race.

    +205:             if self.hub is None:

        __pyx_t_2 = (((PyObject *)__pyx_v_self->hub) == Py_None);
        if (__pyx_t_2) {
    /* … */
        }

    +206:                 self.hub = current_hub

          __Pyx_INCREF((PyObject *)__pyx_v_current_hub);
          __Pyx_GIVEREF((PyObject *)__pyx_v_current_hub);
          __Pyx_GOTREF((PyObject *)__pyx_v_self->hub);
          __Pyx_DECREF((PyObject *)__pyx_v_self->hub);
          __pyx_v_self->hub = __pyx_v_current_hub;

     207:

    +208:         if self.hub is not None and self.hub.thread_ident != _get_thread_ident():

      __pyx_t_4 = (((PyObject *)__pyx_v_self->hub) != Py_None);
      if (__pyx_t_4) {
      } else {
        __pyx_t_2 = __pyx_t_4;
        goto __pyx_L11_bool_binop_done;
      }
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->hub), __pyx_mstate_global->__pyx_n_u_thread_ident); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = NULL;
      __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident);
      __pyx_t_6 = __pyx_v_6gevent_27_gevent_c_abstract_linkable__get_thread_ident;
      __pyx_t_7 = 1;
      #if CYTHON_UNPACK_METHODS
      if (unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
        assert(__pyx_t_5);
        PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx__function);
        __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
        __pyx_t_7 = 0;
      }
      #endif
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
      }
      __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_NE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 208, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_2 = __pyx_t_4;
      __pyx_L11_bool_binop_done:;
      if (unlikely(__pyx_t_2)) {
    /* … */
      }

    +209:             raise InvalidThreadUseError(

        __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError);
        __pyx_t_1 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError;

     210:                 self.hub,

    +211:                 get_hub_if_exists(),

        __pyx_t_5 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 211, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);

    +212:                 getcurrent() # pylint:disable=undefined-variable

        __pyx_t_8 = ((PyObject *)__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_7 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
          assert(__pyx_t_3);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_1, __pyx__function);
          __pyx_t_7 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self->hub), __pyx_t_5, __pyx_t_8};
          __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+__pyx_t_7, (4-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_Raise(__pyx_t_6, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __PYX_ERR(0, 209, __pyx_L1_error)

     213:             )

    +214:         return self.hub

      __Pyx_XDECREF((PyObject *)__pyx_r);
      __Pyx_INCREF((PyObject *)__pyx_v_self->hub);
      __pyx_r = __pyx_v_self->hub;
      goto __pyx_L0;

     215:

    +216:     def _check_and_notify(self):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__check_and_notify(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = 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_7);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_11);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._check_and_notify", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_hub);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     217:         # If this object is ready to be notified, begin the process.

    +218:         if self.ready() and self._links and not self._notifier:

      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 218, __pyx_L1_error)
      if (__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_2 = (__pyx_v_self->_links != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_self->_links) != 0);
      if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 218, __pyx_L1_error)
      if (__pyx_t_2) {
      } else {
        __pyx_t_1 = __pyx_t_2;
        goto __pyx_L4_bool_binop_done;
      }
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 218, __pyx_L1_error)
      __pyx_t_3 = (!__pyx_t_2);
      __pyx_t_1 = __pyx_t_3;
      __pyx_L4_bool_binop_done:;
      if (__pyx_t_1) {
    /* … */
      }

    +219:             hub = None

        __Pyx_INCREF(Py_None);
        __pyx_v_hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None);

    +220:             try:

        {
          /*try:*/ {
    /* … */
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L12_try_end;
          __pyx_L7_error:;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    /* … */
          __pyx_L9_except_error:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          goto __pyx_L1_error;
          __pyx_L8_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          __pyx_L12_try_end:;
        }

    +221:                 hub = self._capture_hub(False) # Must create, we need it.

            __pyx_t_7 = ((PyObject *)((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_capture_hub(__pyx_v_self, 0)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 221, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_7));
            __pyx_t_7 = 0;

    +222:             except InvalidThreadUseError:

          __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidThreadUseError);
          if (__pyx_t_8) {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L8_exception_handled;
          }
          goto __pyx_L9_except_error;

     223:                 # The current hub doesn't match self.hub. That's OK,

     224:                 # we still want to start the notifier in the thread running

     225:                 # self.hub (because the links probably contains greenlet.switch

     226:                 # calls valid only in that hub)

     227:                 pass

    +228:             if hub is not None:

        __pyx_t_1 = (((PyObject *)__pyx_v_hub) != Py_None);
        if (__pyx_t_1) {
    /* … */
          goto __pyx_L15;
        }

    +229:                 self._notifier = hub.loop.run_callback(self._notify_links, [])

          __pyx_t_9 = __pyx_v_hub->loop;
          __Pyx_INCREF(__pyx_t_9);
          __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_notify_links); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          __pyx_t_11 = PyList_New(0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 229, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_12 = 0;
          {
            PyObject *__pyx_callargs[3] = {__pyx_t_9, __pyx_t_10, __pyx_t_11};
            __pyx_t_7 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_run_callback, __pyx_callargs+__pyx_t_12, (3-__pyx_t_12) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 229, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_GIVEREF(__pyx_t_7);
          __Pyx_GOTREF(__pyx_v_self->_notifier);
          __Pyx_DECREF(__pyx_v_self->_notifier);
          __pyx_v_self->_notifier = __pyx_t_7;
          __pyx_t_7 = 0;

     230:             else:

     231:                 # Hmm, no hub. We must be the only thing running. Then its OK

     232:                 # to just directly call the callbacks.

    +233:                 self._notifier = 1

        /*else*/ {
          __Pyx_INCREF(__pyx_mstate_global->__pyx_int_1);
          __Pyx_GIVEREF(__pyx_mstate_global->__pyx_int_1);
          __Pyx_GOTREF(__pyx_v_self->_notifier);
          __Pyx_DECREF(__pyx_v_self->_notifier);
          __pyx_v_self->_notifier = __pyx_mstate_global->__pyx_int_1;

    +234:                 try:

          /*try:*/ {

    +235:                     self._notify_links([])

            __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 235, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_11 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_notify_links(__pyx_v_self, ((PyObject*)__pyx_t_7), 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 235, __pyx_L17_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          }

     236:                 finally:

    +237:                     self._notifier = None

          /*finally:*/ {
            /*normal exit:*/{
              __Pyx_INCREF(Py_None);
              __Pyx_GIVEREF(Py_None);
              __Pyx_GOTREF(__pyx_v_self->_notifier);
              __Pyx_DECREF(__pyx_v_self->_notifier);
              __pyx_v_self->_notifier = Py_None;
              goto __pyx_L18;
            }
            __pyx_L17_error:;
            /*exception exit:*/{
              __Pyx_PyThreadState_declare
              __Pyx_PyThreadState_assign
              __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
              __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
              __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
               __Pyx_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
              if ( unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_6);
              __Pyx_XGOTREF(__pyx_t_5);
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_15);
              __Pyx_XGOTREF(__pyx_t_16);
              __Pyx_XGOTREF(__pyx_t_17);
              __pyx_t_8 = __pyx_lineno; __pyx_t_13 = __pyx_clineno; __pyx_t_14 = __pyx_filename;
              {
                __Pyx_INCREF(Py_None);
                __Pyx_GIVEREF(Py_None);
                __Pyx_GOTREF(__pyx_v_self->_notifier);
                __Pyx_DECREF(__pyx_v_self->_notifier);
                __pyx_v_self->_notifier = Py_None;
              }
              __Pyx_XGIVEREF(__pyx_t_15);
              __Pyx_XGIVEREF(__pyx_t_16);
              __Pyx_XGIVEREF(__pyx_t_17);
              __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
              __Pyx_XGIVEREF(__pyx_t_6);
              __Pyx_XGIVEREF(__pyx_t_5);
              __Pyx_XGIVEREF(__pyx_t_4);
              __Pyx_ErrRestore(__pyx_t_6, __pyx_t_5, __pyx_t_4);
              __pyx_t_6 = 0; __pyx_t_5 = 0; __pyx_t_4 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
              __pyx_lineno = __pyx_t_8; __pyx_clineno = __pyx_t_13; __pyx_filename = __pyx_t_14;
              goto __pyx_L1_error;
            }
            __pyx_L18:;
          }
        }
        __pyx_L15:;

     238:

    +239:     def _notify_link_list(self, links):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_link_list(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_links) {
      int __pyx_v_only_while_ready;
      PyObject *__pyx_v_final_link = NULL;
      PyObject *__pyx_v_done = NULL;
      struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = NULL;
      PyObject *__pyx_v_unswitched = NULL;
      PyObject *__pyx_v_link = NULL;
      PyObject *__pyx_v_id_link = NULL;
      PyObject *__pyx_v_traceback = NULL;
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_22);
      __Pyx_XDECREF(__pyx_t_23);
      __Pyx_XDECREF(__pyx_t_24);
      __Pyx_XDECREF(__pyx_t_25);
      __Pyx_XDECREF(__pyx_t_26);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._notify_link_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_final_link);
      __Pyx_XDECREF(__pyx_v_done);
      __Pyx_XDECREF((PyObject *)__pyx_v_hub);
      __Pyx_XDECREF(__pyx_v_unswitched);
      __Pyx_XDECREF(__pyx_v_link);
      __Pyx_XDECREF(__pyx_v_id_link);
      __Pyx_XDECREF(__pyx_v_traceback);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     240:         # The core of the _notify_links method to notify

     241:         # links in order. Lets the ``links`` list be mutated,

     242:         # and only notifies up to the last item in the list, in case

     243:         # objects are added to it.

    +244:         if not links:

      __pyx_t_1 = (__pyx_v_links != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_links) != 0);
      if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 244, __pyx_L1_error)
      __pyx_t_2 = (!__pyx_t_1);
      if (__pyx_t_2) {
    /* … */
      }

     245:             # HMM. How did we get here? Running two threads at once?

     246:             # Seen once on Py27/Win/Appveyor

     247:             # https://ci.appveyor.com/project/jamadden/gevent/builds/36875645/job/9wahj9ft4h4qa170

    +248:             return []

        __Pyx_XDECREF(__pyx_r);
        __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_r = ((PyObject*)__pyx_t_3);
        __pyx_t_3 = 0;
        goto __pyx_L0;

     249:

    +250:         only_while_ready = not self._notify_all

      __pyx_v_only_while_ready = (!__pyx_v_self->_notify_all);

    +251:         final_link = links[-1]

      if (unlikely(__pyx_v_links == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(0, 251, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_GetItemInt_List(__pyx_v_links, -1L, long, 1, __Pyx_PyLong_From_long, 1, 1, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_final_link = __pyx_t_3;
      __pyx_t_3 = 0;

    +252:         done = set() # of ids

      __pyx_t_3 = PySet_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_done = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

    +253:         hub = self.hub if self.hub is not None else get_hub_if_exists()

      __pyx_t_2 = (((PyObject *)__pyx_v_self->hub) != Py_None);
      if (__pyx_t_2) {
        __Pyx_INCREF((PyObject *)__pyx_v_self->hub);
        __pyx_t_3 = ((PyObject *)__pyx_v_self->hub);
      } else {
        __pyx_t_4 = ((PyObject *)__pyx_f_6gevent_19_gevent_c_hub_local_get_hub_if_exists(0)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __pyx_t_4;
        __pyx_t_4 = 0;
      }
      __pyx_v_hub = ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_3);
      __pyx_t_3 = 0;

    +254:         unswitched = []

      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 254, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_v_unswitched = ((PyObject*)__pyx_t_3);
      __pyx_t_3 = 0;

    +255:         while links: # remember this can be mutated

      while (1) {
        __pyx_t_2 = (__pyx_v_links != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_links) != 0);
        if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_2 < 0))) __PYX_ERR(0, 255, __pyx_L1_error)
        if (!__pyx_t_2) break;

    +256:             if only_while_ready and not self.ready():

        if (__pyx_v_only_while_ready) {
        } else {
          __pyx_t_2 = __pyx_v_only_while_ready;
          goto __pyx_L7_bool_binop_done;
        }
        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error)
        __pyx_t_5 = (!__pyx_t_1);
        __pyx_t_2 = __pyx_t_5;
        __pyx_L7_bool_binop_done:;
        if (__pyx_t_2) {
    /* … */
        }

    +257:                 break

          goto __pyx_L5_break;

     258:

    +259:             link = links.pop(0) # Cython optimizes using list internals

        if (unlikely(__pyx_v_links == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
          __PYX_ERR(0, 259, __pyx_L1_error)
        }
        __pyx_t_3 = __Pyx_PyList_PopIndex(__pyx_v_links, __pyx_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_3);
        __pyx_t_3 = 0;

    +260:             id_link = id(link)

        __pyx_t_4 = NULL;
        __Pyx_INCREF(__pyx_builtin_id);
        __pyx_t_6 = __pyx_builtin_id;
        __pyx_t_7 = 1;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v_link};
          __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 260, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_v_id_link, __pyx_t_3);
        __pyx_t_3 = 0;

    +261:             if id_link not in done:

        __pyx_t_2 = (__Pyx_PySet_ContainsTF(__pyx_v_id_link, __pyx_v_done, Py_NE)); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 261, __pyx_L1_error)
        if (__pyx_t_2) {
    /* … */
        }

     262:                 # XXX: JAM: What was I thinking? This doesn't make much sense,

     263:                 # there's a good chance `link` will be deallocated, and its id() will

     264:                 # be free to be reused. This also makes looping difficult, you have to

     265:                 # create new functions inside a loop rather than just once outside the loop.

    +266:                 done.add(id_link)

          __pyx_t_8 = PySet_Add(__pyx_v_done, __pyx_v_id_link); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 266, __pyx_L1_error)

    +267:                 try:

          {
            /*try:*/ {
    /* … */
            }
            __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
            __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
            __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
            goto __pyx_L17_try_end;
            __pyx_L10_error:;
            __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
            __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
            __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    /* … */
            __pyx_L12_except_error:;
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            goto __pyx_L1_error;
            __pyx_L11_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_XGIVEREF(__pyx_t_10);
            __Pyx_XGIVEREF(__pyx_t_11);
            __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
            __pyx_L17_try_end:;
          }

    +268:                     self._drop_lock_for_switch_out()

              __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_drop_lock_for_switch_out(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 268, __pyx_L10_error)
              __Pyx_GOTREF(__pyx_t_3);
              __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +269:                     try:

              /*try:*/ {
                {
                  /*try:*/ {
    /* … */
                  }
                  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  goto __pyx_L30_try_end;
                  __pyx_L23_error:;
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    /* … */
                  __pyx_L25_except_error:;
                  __Pyx_XGIVEREF(__pyx_t_12);
                  __Pyx_XGIVEREF(__pyx_t_13);
                  __Pyx_XGIVEREF(__pyx_t_14);
                  __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
                  goto __pyx_L21_error;
                  __pyx_L24_exception_handled:;
                  __Pyx_XGIVEREF(__pyx_t_12);
                  __Pyx_XGIVEREF(__pyx_t_13);
                  __Pyx_XGIVEREF(__pyx_t_14);
                  __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
                  __pyx_L30_try_end:;
                }
              }

    +270:                         link(self)

                    __pyx_t_6 = NULL;
                    __Pyx_INCREF(__pyx_v_link);
                    __pyx_t_4 = __pyx_v_link;
                    __pyx_t_7 = 1;
                    #if CYTHON_UNPACK_METHODS
                    if (unlikely(PyMethod_Check(__pyx_t_4))) {
                      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
                      assert(__pyx_t_6);
                      PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
                      __Pyx_INCREF(__pyx_t_6);
                      __Pyx_INCREF(__pyx__function);
                      __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
                      __pyx_t_7 = 0;
                    }
                    #endif
                    {
                      PyObject *__pyx_callargs[2] = {__pyx_t_6, ((PyObject *)__pyx_v_self)};
                      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+__pyx_t_7, (2-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
                      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L23_error)
                      __Pyx_GOTREF(__pyx_t_3);
                    }
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    +271:                     except greenlet_error:

                  __Pyx_ErrFetch(&__pyx_t_3, &__pyx_t_4, &__pyx_t_6);
                  __Pyx_GetModuleGlobalName(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_greenlet_error); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 271, __pyx_L25_except_error)
                  __Pyx_GOTREF(__pyx_t_15);
                  __pyx_t_16 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_3, __pyx_t_15);
                  __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_ErrRestore(__pyx_t_3, __pyx_t_4, __pyx_t_6);
                  __pyx_t_3 = 0; __pyx_t_4 = 0; __pyx_t_6 = 0;
                  if (__pyx_t_16) {
                    __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._notify_link_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
                    if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_4, &__pyx_t_3) < 0) __PYX_ERR(0, 271, __pyx_L25_except_error)
                    __Pyx_XGOTREF(__pyx_t_6);
                    __Pyx_XGOTREF(__pyx_t_4);
                    __Pyx_XGOTREF(__pyx_t_3);

     272:                         # couldn't switch to a greenlet, we must be

     273:                         # running in a different thread. back on the list it goes for next time.

    +274:                         unswitched.append(link)

                    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_unswitched, __pyx_v_link); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(0, 274, __pyx_L25_except_error)
                    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                    goto __pyx_L24_exception_handled;
                  }
                  goto __pyx_L25_except_error;

     275:                     finally:

    +276:                         self._acquire_lock_for_switch_in()

              /*finally:*/ {
                /*normal exit:*/{
                  __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_acquire_lock_for_switch_in(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L10_error)
                  __Pyx_GOTREF(__pyx_t_3);
                  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  goto __pyx_L22;
                }
                __pyx_L21_error:;
                /*exception exit:*/{
                  __Pyx_PyThreadState_declare
                  __Pyx_PyThreadState_assign
                  __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
                  __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
                  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
                  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
                  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
                   __Pyx_ExceptionSwap(&__pyx_t_19, &__pyx_t_20, &__pyx_t_21);
                  if ( unlikely(__Pyx_GetException(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_14, &__pyx_t_13, &__pyx_t_12);
                  __Pyx_XGOTREF(__pyx_t_14);
                  __Pyx_XGOTREF(__pyx_t_13);
                  __Pyx_XGOTREF(__pyx_t_12);
                  __Pyx_XGOTREF(__pyx_t_19);
                  __Pyx_XGOTREF(__pyx_t_20);
                  __Pyx_XGOTREF(__pyx_t_21);
                  __pyx_t_16 = __pyx_lineno; __pyx_t_17 = __pyx_clineno; __pyx_t_18 = __pyx_filename;
                  {
                    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_acquire_lock_for_switch_in(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 276, __pyx_L36_error)
                    __Pyx_GOTREF(__pyx_t_3);
                    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
                  }
                  __Pyx_XGIVEREF(__pyx_t_19);
                  __Pyx_XGIVEREF(__pyx_t_20);
                  __Pyx_XGIVEREF(__pyx_t_21);
                  __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
                  __Pyx_XGIVEREF(__pyx_t_14);
                  __Pyx_XGIVEREF(__pyx_t_13);
                  __Pyx_XGIVEREF(__pyx_t_12);
                  __Pyx_ErrRestore(__pyx_t_14, __pyx_t_13, __pyx_t_12);
                  __pyx_t_14 = 0; __pyx_t_13 = 0; __pyx_t_12 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
                  __pyx_lineno = __pyx_t_16; __pyx_clineno = __pyx_t_17; __pyx_filename = __pyx_t_18;
                  goto __pyx_L10_error;
                  __pyx_L36_error:;
                  __Pyx_XGIVEREF(__pyx_t_19);
                  __Pyx_XGIVEREF(__pyx_t_20);
                  __Pyx_XGIVEREF(__pyx_t_21);
                  __Pyx_ExceptionReset(__pyx_t_19, __pyx_t_20, __pyx_t_21);
                  __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
                  __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
                  __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
                  __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0;
                  goto __pyx_L10_error;
                }
                __pyx_L22:;
              }

     277:

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

            /*except:*/ {
              __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._notify_link_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_4, &__pyx_t_6) < 0) __PYX_ERR(0, 278, __pyx_L12_except_error)
              __Pyx_XGOTREF(__pyx_t_3);
              __Pyx_XGOTREF(__pyx_t_4);
              __Pyx_XGOTREF(__pyx_t_6);

     279:                     # We're running in the hub, errors must not escape.

    +280:                     if hub is not None:

              __pyx_t_2 = (((PyObject *)__pyx_v_hub) != Py_None);
              if (__pyx_t_2) {
    /* … */
                goto __pyx_L39;
              }

    +281:                         hub.handle_error((link, self), *sys.exc_info())

                __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_hub), __pyx_mstate_global->__pyx_n_u_handle_error); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_15);
                __pyx_t_22 = PyTuple_New(2); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_22);
                __Pyx_INCREF(__pyx_v_link);
                __Pyx_GIVEREF(__pyx_v_link);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_v_link) != (0)) __PYX_ERR(0, 281, __pyx_L12_except_error);
                __Pyx_INCREF((PyObject *)__pyx_v_self);
                __Pyx_GIVEREF((PyObject *)__pyx_v_self);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_22, 1, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 281, __pyx_L12_except_error);
                __pyx_t_23 = PyTuple_New(1); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_23);
                __Pyx_GIVEREF(__pyx_t_22);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_23, 0, __pyx_t_22) != (0)) __PYX_ERR(0, 281, __pyx_L12_except_error);
                __pyx_t_22 = 0;
                __pyx_t_24 = NULL;
                __Pyx_GetModuleGlobalName(__pyx_t_25, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_25)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_25);
                __pyx_t_26 = __Pyx_PyObject_GetAttrStr(__pyx_t_25, __pyx_mstate_global->__pyx_n_u_exc_info); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_26);
                __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
                __pyx_t_7 = 1;
                #if CYTHON_UNPACK_METHODS
                if (unlikely(PyMethod_Check(__pyx_t_26))) {
                  __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_26);
                  assert(__pyx_t_24);
                  PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_26);
                  __Pyx_INCREF(__pyx_t_24);
                  __Pyx_INCREF(__pyx__function);
                  __Pyx_DECREF_SET(__pyx_t_26, __pyx__function);
                  __pyx_t_7 = 0;
                }
                #endif
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_24, NULL};
                  __pyx_t_22 = __Pyx_PyObject_FastCall(__pyx_t_26, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (__pyx_t_7*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
                  __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
                  if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                  __Pyx_GOTREF(__pyx_t_22);
                }
                __pyx_t_26 = __Pyx_PySequence_Tuple(__pyx_t_22); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_26);
                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                __pyx_t_22 = PyNumber_Add(__pyx_t_23, __pyx_t_26); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_22);
                __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
                __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
                __pyx_t_26 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_22, NULL); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 281, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_26);
                __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
                __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
                __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;

     282:                     else:

    +283:                         import traceback

              /*else*/ {
                __pyx_t_26 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_traceback, NULL); if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 283, __pyx_L12_except_error)
                __Pyx_GOTREF(__pyx_t_26);
                __Pyx_XDECREF_SET(__pyx_v_traceback, __pyx_t_26);
                __pyx_t_26 = 0;

    +284:                         traceback.print_exc()

                __pyx_t_22 = __pyx_v_traceback;
                __Pyx_INCREF(__pyx_t_22);
                __pyx_t_7 = 0;
                {
                  PyObject *__pyx_callargs[2] = {__pyx_t_22, NULL};
                  __pyx_t_26 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_print_exc, __pyx_callargs+__pyx_t_7, (1-__pyx_t_7) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
                  __Pyx_XDECREF(__pyx_t_22); __pyx_t_22 = 0;
                  if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 284, __pyx_L12_except_error)
                  __Pyx_GOTREF(__pyx_t_26);
                }
                __Pyx_DECREF(__pyx_t_26); __pyx_t_26 = 0;
              }
              __pyx_L39:;
              __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
              __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              goto __pyx_L11_exception_handled;
            }

     285:

    +286:             if link is final_link:

        __pyx_t_2 = (__pyx_v_link == __pyx_v_final_link);
        if (__pyx_t_2) {
    /* … */
        }
      }
      __pyx_L5_break:;

    +287:                 break

          goto __pyx_L5_break;

    +288:         return unswitched

      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_unswitched);
      __pyx_r = __pyx_v_unswitched;
      goto __pyx_L0;

     289:

    +290:     def _notify_links(self, arrived_while_waiting):

    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting); /*proto*/
    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_links(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting, int __pyx_skip_dispatch) {
      PyObject *__pyx_v_notifier = NULL;
      PyObject *__pyx_v_unswitched = NULL;
      PyObject *__pyx_v_un2 = NULL;
      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_27_gevent_c_abstract_linkable_AbstractLinkable &&
      __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_notify_links); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links)) {
            __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, __pyx_v_arrived_while_waiting};
              __pyx_t_2 = __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_2)) __PYX_ERR(0, 290, __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_abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_notifier);
      __Pyx_XDECREF(__pyx_v_unswitched);
      __Pyx_XDECREF(__pyx_v_un2);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links, "AbstractLinkable._notify_links(self, list arrived_while_waiting)");
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links = {"_notify_links", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links, METH_O, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links(PyObject *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_notify_links (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arrived_while_waiting), (&PyList_Type), 1, "arrived_while_waiting", 1))) __PYX_ERR(0, 290, __pyx_L1_error)
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self), ((PyObject*)__pyx_v_arrived_while_waiting));
      int __pyx_lineno = 0;
      const char *__pyx_filename = NULL;
      int __pyx_clineno = 0;

      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __pyx_r = NULL;
      goto __pyx_L5_cleaned_up;
      __pyx_L0:;
      __pyx_L5_cleaned_up:;
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_10_notify_links(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_arrived_while_waiting) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__notify_links(__pyx_v_self, __pyx_v_arrived_while_waiting, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __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_abstract_linkable.AbstractLinkable._notify_links", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_11_notify_links, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbstractLinkable__notify_links, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_notify_links, __pyx_t_6) < 0) __PYX_ERR(0, 290, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     291:         # This method must hold the GIL, or be guarded with the lock that guards

     292:         # this object. Thus, while we are notifying objects, an object from another

     293:         # thread simply cannot arrive and mutate ``_links`` or ``arrived_while_waiting``

     294:

     295:         # ``arrived_while_waiting`` is a list of greenlet.switch methods

     296:         # to call. These were objects that called wait() while we were processing,

     297:         # and which would have run *before* those that had actually waited

     298:         # and blocked. Instead of returning True immediately, we add them to this

     299:         # list so they wait their turn.

     300:

     301:         # We release self._notifier here when done invoking links.

     302:         # The object itself becomes false in a boolean way as soon

     303:         # as this method returns.

    +304:         notifier = self._notifier

      __pyx_t_1 = __pyx_v_self->_notifier;
      __Pyx_INCREF(__pyx_t_1);
      __pyx_v_notifier = __pyx_t_1;
      __pyx_t_1 = 0;

    +305:         if notifier is None:

      __pyx_t_6 = (__pyx_v_notifier == Py_None);
      if (__pyx_t_6) {
    /* … */
      }

     306:             # XXX: How did we get here?

    +307:             self._check_and_notify()

        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 307, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +308:             return

        __Pyx_XDECREF(__pyx_r);
        __pyx_r = Py_None; __Pyx_INCREF(Py_None);
        goto __pyx_L0;

     309:         # Early links are allowed to remove later links, and links

     310:         # are allowed to add more links, thus we must not

     311:         # make a copy of our the ``_links`` list, we must traverse it and

     312:         # mutate in place.

     313:         #

     314:         # We were ready() at the time this callback was scheduled; we

     315:         # may not be anymore, and that status may change during

     316:         # callback processing. Some of our subclasses (Event) will

     317:         # want to notify everyone who was registered when the status

     318:         # became true that it was once true, even though it may not be

     319:         # any more. In that case, we must not keep notifying anyone that's

     320:         # newly added after that, even if we go ready again.

    +321:         try:

      /*try:*/ {

    +322:             unswitched = self._notify_link_list(self._links)

        __pyx_t_1 = __pyx_v_self->_links;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_notify_link_list(__pyx_v_self, ((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __pyx_v_unswitched = ((PyObject*)__pyx_t_2);
        __pyx_t_2 = 0;

     323:             # Now, those that arrived after we had begun the notification

     324:             # process. Follow the same rules, stop with those that are

     325:             # added so far to prevent starvation.

    +326:             if arrived_while_waiting:

        __pyx_t_6 = (__pyx_v_arrived_while_waiting != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_arrived_while_waiting) != 0);
        if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 326, __pyx_L5_error)
        if (__pyx_t_6) {
    /* … */
        }
      }

    +327:                 un2 = self._notify_link_list(arrived_while_waiting)

          __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_notify_link_list(__pyx_v_self, __pyx_v_arrived_while_waiting); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 327, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_2);
          __pyx_v_un2 = ((PyObject*)__pyx_t_2);
          __pyx_t_2 = 0;

    +328:                 unswitched.extend(un2)

          if (unlikely(__pyx_v_unswitched == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend");
            __PYX_ERR(0, 328, __pyx_L5_error)
          }
          __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_unswitched, __pyx_v_un2); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 328, __pyx_L5_error)

     329:

     330:                 # Anything left needs to go back on the main list.

    +331:                 self._links.extend(arrived_while_waiting)

          if (unlikely(__pyx_v_self->_links == Py_None)) {
            PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "extend");
            __PYX_ERR(0, 331, __pyx_L5_error)
          }
          __pyx_t_7 = __Pyx_PyList_Extend(__pyx_v_self->_links, __pyx_v_arrived_while_waiting); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 331, __pyx_L5_error)

     332:         finally:

     333:             # We should not have created a new notifier even if callbacks

     334:             # released us because we loop through *all* of our links on the

     335:             # same callback while self._notifier is still true.

     336:             # However, one of our callbacks could have called ``os.fork``,

     337:             # which invokes ``_at_fork_reinit`` and destroys the notifier and

     338:             # hub *while this method is running*.

    +339:             assert self._notifier is notifier or (

      /*finally:*/ {
        /*normal exit:*/{
          #ifndef CYTHON_WITHOUT_ASSERTIONS
          if (unlikely(__pyx_assertions_enabled())) {
            __pyx_t_8 = (__pyx_v_self->_notifier == __pyx_v_notifier);
            if (!__pyx_t_8) {
            } else {
              __pyx_t_6 = __pyx_t_8;
              goto __pyx_L8_bool_binop_done;
            }
    /* … */
            #ifndef CYTHON_WITHOUT_ASSERTIONS
            if (unlikely(__pyx_assertions_enabled())) {
              __pyx_t_8 = (__pyx_v_self->_notifier == __pyx_v_notifier);
              if (!__pyx_t_8) {
              } else {
                __pyx_t_6 = __pyx_t_8;
                goto __pyx_L13_bool_binop_done;
              }

    +340:                 self._notifier is None and self.hub is None

            __pyx_t_8 = (__pyx_v_self->_notifier == Py_None);
            if (__pyx_t_8) {
            } else {
              __pyx_t_6 = __pyx_t_8;
              goto __pyx_L8_bool_binop_done;
            }
            __pyx_t_8 = (((PyObject *)__pyx_v_self->hub) == Py_None);
            __pyx_t_6 = __pyx_t_8;
            __pyx_L8_bool_binop_done:;
            if (unlikely(!__pyx_t_6)) {
    /* … */
              __pyx_t_8 = (__pyx_v_self->_notifier == Py_None);
              if (__pyx_t_8) {
              } else {
                __pyx_t_6 = __pyx_t_8;
                goto __pyx_L13_bool_binop_done;
              }
              __pyx_t_8 = (((PyObject *)__pyx_v_self->hub) == Py_None);
              __pyx_t_6 = __pyx_t_8;
              __pyx_L13_bool_binop_done:;
              if (unlikely(!__pyx_t_6)) {

    +341:             ), (self, self._notifier, notifier)

              __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_2);
              __Pyx_INCREF((PyObject *)__pyx_v_self);
              __Pyx_GIVEREF((PyObject *)__pyx_v_self);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 341, __pyx_L1_error);
              __Pyx_INCREF(__pyx_v_self->_notifier);
              __Pyx_GIVEREF(__pyx_v_self->_notifier);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->_notifier) != (0)) __PYX_ERR(0, 341, __pyx_L1_error);
              __Pyx_INCREF(__pyx_v_notifier);
              __Pyx_GIVEREF(__pyx_v_notifier);
              if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_notifier) != (0)) __PYX_ERR(0, 341, __pyx_L1_error);
              __pyx_t_1 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_1);
              __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_1, 0, 0);
              __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
              __PYX_ERR(0, 339, __pyx_L1_error)
            }
          }
          #else
          if ((1)); else __PYX_ERR(0, 339, __pyx_L1_error)
          #endif
    /* … */
                __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 341, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_1);
                __Pyx_INCREF((PyObject *)__pyx_v_self);
                __Pyx_GIVEREF((PyObject *)__pyx_v_self);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self)) != (0)) __PYX_ERR(0, 341, __pyx_L12_error);
                __Pyx_INCREF(__pyx_v_self->_notifier);
                __Pyx_GIVEREF(__pyx_v_self->_notifier);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->_notifier) != (0)) __PYX_ERR(0, 341, __pyx_L12_error);
                __Pyx_INCREF(__pyx_v_notifier);
                __Pyx_GIVEREF(__pyx_v_notifier);
                if (__Pyx_PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_notifier) != (0)) __PYX_ERR(0, 341, __pyx_L12_error);
                __pyx_t_2 = PyTuple_Pack(1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 341, __pyx_L12_error)
                __Pyx_GOTREF(__pyx_t_2);
                __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_t_2, 0, 0);
                __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                __PYX_ERR(0, 339, __pyx_L12_error)
              }
            }
            #else
            if ((1)); else __PYX_ERR(0, 339, __pyx_L12_error)
            #endif

    +342:             self._notifier = None

          __Pyx_INCREF(Py_None);
          __Pyx_GIVEREF(Py_None);
          __Pyx_GOTREF(__pyx_v_self->_notifier);
          __Pyx_DECREF(__pyx_v_self->_notifier);
          __pyx_v_self->_notifier = Py_None;
          goto __pyx_L6;
        }
        __pyx_L5_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 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_ExceptionSwap(&__pyx_t_15, &__pyx_t_16, &__pyx_t_17);
          if ( unlikely(__Pyx_GetException(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14) < 0)) __Pyx_ErrFetch(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
          __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_XGOTREF(__pyx_t_17);
          __pyx_t_9 = __pyx_lineno; __pyx_t_10 = __pyx_clineno; __pyx_t_11 = __pyx_filename;
          {
    /* … */
            __Pyx_INCREF(Py_None);
            __Pyx_GIVEREF(Py_None);
            __Pyx_GOTREF(__pyx_v_self->_notifier);
            __Pyx_DECREF(__pyx_v_self->_notifier);
            __pyx_v_self->_notifier = Py_None;
          }
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_13);
          __Pyx_XGIVEREF(__pyx_t_14);
          __Pyx_ErrRestore(__pyx_t_12, __pyx_t_13, __pyx_t_14);
          __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          __pyx_lineno = __pyx_t_9; __pyx_clineno = __pyx_t_10; __pyx_filename = __pyx_t_11;
          goto __pyx_L1_error;
          __pyx_L12_error:;
          __Pyx_XGIVEREF(__pyx_t_15);
          __Pyx_XGIVEREF(__pyx_t_16);
          __Pyx_XGIVEREF(__pyx_t_17);
          __Pyx_ExceptionReset(__pyx_t_15, __pyx_t_16, __pyx_t_17);
          __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
          __pyx_t_15 = 0; __pyx_t_16 = 0; __pyx_t_17 = 0;
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }

     343:             # TODO: Maybe we should intelligently reset self.hub to

     344:             # free up thread affinity? In case of a pathological situation where

     345:             # one object was used from one thread once & first,  but usually is

     346:             # used by another thread.

     347:             #

     348:             # BoundedSemaphore does this.

     349:         # Now we may be ready or not ready. If we're ready, which

     350:         # could have happened during the last link we called, then we

     351:         # must have more links than we started with. We need to schedule the

     352:         # wakeup.

    +353:         self._check_and_notify()

      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_check_and_notify(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 353, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +354:         if unswitched:

      __pyx_t_6 = (__pyx_v_unswitched != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_unswitched) != 0);
      if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_6 < 0))) __PYX_ERR(0, 354, __pyx_L1_error)
      if (__pyx_t_6) {
    /* … */
      }

    +355:             self._handle_unswitched_notifications(unswitched)

        __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_handle_unswitched_notifications(__pyx_v_self, __pyx_v_unswitched); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 355, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     356:

     357:

    +358:     def _handle_unswitched_notifications(self, unswitched):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__handle_unswitched_notifications(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_unswitched) {
      struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *__pyx_v_hub = 0;
      PyObject *__pyx_v_root_greenlets = NULL;
      int __pyx_v_printed_tb;
      int __pyx_v_only_while_ready;
      PyObject *__pyx_v_link = NULL;
      PyObject *__pyx_v_glet = NULL;
      PyObject *__pyx_v_parent = 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_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._handle_unswitched_notifications", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF((PyObject *)__pyx_v_hub);
      __Pyx_XDECREF(__pyx_v_root_greenlets);
      __Pyx_XDECREF(__pyx_v_link);
      __Pyx_XDECREF(__pyx_v_glet);
      __Pyx_XDECREF(__pyx_v_parent);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     359:         # Given a list of callable objects that raised

     360:         # ``greenlet.error`` when we called them: If we can determine

     361:         # that it is a parked greenlet (the callablle is a

     362:         # ``greenlet.switch`` method) and we can determine the hub

     363:         # that the greenlet belongs to (either its parent, or, in the

     364:         # case of a main greenlet, find a hub with the same parent as

     365:         # this greenlet object) then:

     366:

     367:         # Move this to be a callback in that thread.

     368:         # (This relies on holding the GIL *or* ``Hub.loop.run_callback`` being

     369:         # thread-safe! Note that the CFFI implementations are definitely

     370:         # NOT thread-safe. TODO: Make them? Or an alternative?)

     371:         #

     372:         # Otherwise, print some error messages.

     373:

     374:         # TODO: Inline this for individual links. That handles the

     375:         # "only while ready" case automatically. Be careful about locking in that case.

     376:         #

     377:         # TODO: Add a 'strict' mode that prevents doing this dance, since it's

     378:         # inherently not safe.

    +379:         root_greenlets = None

      __Pyx_INCREF(Py_None);
      __pyx_v_root_greenlets = ((PyObject*)Py_None);

    +380:         printed_tb = False

      __pyx_v_printed_tb = 0;

    +381:         only_while_ready = not self._notify_all

      __pyx_v_only_while_ready = (!__pyx_v_self->_notify_all);

     382:

    +383:         while unswitched:

      while (1) {
        __pyx_t_1 = (__pyx_v_unswitched != Py_None)&&(__Pyx_PyList_GET_SIZE(__pyx_v_unswitched) != 0);
        if (unlikely(((!CYTHON_ASSUME_SAFE_MACROS) && __pyx_t_1 < 0))) __PYX_ERR(0, 383, __pyx_L1_error)
        if (!__pyx_t_1) break;

    +384:             if only_while_ready and not self.ready():

        if (__pyx_v_only_while_ready) {
        } else {
          __pyx_t_1 = __pyx_v_only_while_ready;
          goto __pyx_L6_bool_binop_done;
        }
        __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 384, __pyx_L1_error)
        __pyx_t_3 = (!__pyx_t_2);
        __pyx_t_1 = __pyx_t_3;
        __pyx_L6_bool_binop_done:;
        if (__pyx_t_1) {
    /* … */
        }

    +385:                 self.__print_unswitched_warning(unswitched, printed_tb)

          __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_AbstractLinkable__print_unswitched_warning(__pyx_v_self, __pyx_v_unswitched, __pyx_v_printed_tb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 385, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +386:                 break

          goto __pyx_L4_break;

     387:

    +388:             link = unswitched.pop(0)

        if (unlikely(__pyx_v_unswitched == Py_None)) {
          PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "pop");
          __PYX_ERR(0, 388, __pyx_L1_error)
        }
        __pyx_t_4 = __Pyx_PyList_PopIndex(__pyx_v_unswitched, __pyx_mstate_global->__pyx_int_0, 0, 1, Py_ssize_t, PyLong_FromSsize_t); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_XDECREF_SET(__pyx_v_link, __pyx_t_4);
        __pyx_t_4 = 0;

     389:

    +390:             hub = None # Also serves as a "handled?" flag

        __Pyx_INCREF(Py_None);
        __Pyx_XDECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)Py_None));

     391:             # Is it a greenlet.switch method?

    +392:             if (getattr(link, '__name__', None) == 'switch'

        __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_mstate_global->__pyx_n_u_name, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_switch, Py_EQ)); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 392, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        if (__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L9_bool_binop_done;
        }
    /* … */
        if (__pyx_t_1) {
    /* … */
        }

    +393:                 and isinstance(getattr(link, '__self__', None), greenlet)):

        __pyx_t_4 = __Pyx_GetAttr3(__pyx_v_link, __pyx_mstate_global->__pyx_n_u_self, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_3 = __Pyx_TypeCheck(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_greenlet);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_1 = __pyx_t_3;
        __pyx_L9_bool_binop_done:;

    +394:                 glet = link.__self__

          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_link, __pyx_mstate_global->__pyx_n_u_self); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 394, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_v_glet, __pyx_t_4);
          __pyx_t_4 = 0;

    +395:                 parent = glet.parent

          __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_mstate_global->__pyx_n_u_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_XDECREF_SET(__pyx_v_parent, __pyx_t_4);
          __pyx_t_4 = 0;

     396:

    +397:                 while parent is not None:

          while (1) {
            __pyx_t_1 = (__pyx_v_parent != Py_None);
            if (!__pyx_t_1) break;

    +398:                     if hasattr(parent, 'loop'): # Assuming the hub.

            __pyx_t_1 = __Pyx_HasAttr(__pyx_v_parent, __pyx_mstate_global->__pyx_n_u_loop); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 398, __pyx_L1_error)
            if (__pyx_t_1) {
    /* … */
            }

    +399:                         hub = glet.parent

              __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_mstate_global->__pyx_n_u_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 399, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 399, __pyx_L1_error)
              __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_4));
              __pyx_t_4 = 0;

    +400:                         break

              goto __pyx_L12_break;

    +401:                     parent = glet.parent

            __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_glet, __pyx_mstate_global->__pyx_n_u_parent); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __Pyx_DECREF_SET(__pyx_v_parent, __pyx_t_4);
            __pyx_t_4 = 0;
          }
          __pyx_L12_break:;

     402:

    +403:                 if hub is None:

          __pyx_t_1 = (((PyObject *)__pyx_v_hub) == Py_None);
          if (__pyx_t_1) {
    /* … */
          }

    +404:                     if root_greenlets is None:

            __pyx_t_1 = (__pyx_v_root_greenlets == ((PyObject*)Py_None));
            if (__pyx_t_1) {
    /* … */
            }

    +405:                         root_greenlets = get_roots_and_hubs()

              __pyx_t_4 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_get_roots_and_hubs(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 405, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
              __Pyx_DECREF_SET(__pyx_v_root_greenlets, ((PyObject*)__pyx_t_4));
              __pyx_t_4 = 0;

    +406:                     hub = root_greenlets.get(glet)

            if (unlikely(__pyx_v_root_greenlets == Py_None)) {
              PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "get");
              __PYX_ERR(0, 406, __pyx_L1_error)
            }
            __pyx_t_4 = __Pyx_PyDict_GetItemDefault(__pyx_v_root_greenlets, __pyx_v_glet, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 406, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_mstate_global->__pyx_ptype_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop))))) __PYX_ERR(0, 406, __pyx_L1_error)
            __Pyx_DECREF_SET(__pyx_v_hub, ((struct __pyx_obj_6gevent_29_gevent_c_greenlet_primitives_SwitchOutGreenletWithLoop *)__pyx_t_4));
            __pyx_t_4 = 0;

     407:

    +408:                 if hub is not None and hub.loop is not None:

          __pyx_t_3 = (((PyObject *)__pyx_v_hub) != Py_None);
          if (__pyx_t_3) {
          } else {
            __pyx_t_1 = __pyx_t_3;
            goto __pyx_L17_bool_binop_done;
          }
          __pyx_t_3 = (__pyx_v_hub->loop != Py_None);
          __pyx_t_1 = __pyx_t_3;
          __pyx_L17_bool_binop_done:;
          if (__pyx_t_1) {
    /* … */
          }

    +409:                     hub.loop.run_callback_threadsafe(link, self)

            __pyx_t_5 = __pyx_v_hub->loop;
            __Pyx_INCREF(__pyx_t_5);
            __pyx_t_6 = 0;
            {
              PyObject *__pyx_callargs[3] = {__pyx_t_5, __pyx_v_link, ((PyObject *)__pyx_v_self)};
              __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_run_callback_threadsafe, __pyx_callargs+__pyx_t_6, (3-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 409, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_4);
            }
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +410:             if hub is None or hub.loop is None:

        __pyx_t_3 = (((PyObject *)__pyx_v_hub) == Py_None);
        if (!__pyx_t_3) {
        } else {
          __pyx_t_1 = __pyx_t_3;
          goto __pyx_L20_bool_binop_done;
        }
        __pyx_t_3 = (__pyx_v_hub->loop == Py_None);
        __pyx_t_1 = __pyx_t_3;
        __pyx_L20_bool_binop_done:;
        if (__pyx_t_1) {
    /* … */
        }
      }
      __pyx_L4_break:;

     411:                 # We couldn't handle it

    +412:                 self.__print_unswitched_warning(link, printed_tb)

          __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_AbstractLinkable__print_unswitched_warning(__pyx_v_self, __pyx_v_link, __pyx_v_printed_tb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    +413:                 printed_tb = True

          __pyx_v_printed_tb = 1;

     414:

     415:

    +416:     def __print_unswitched_warning(self, link, printed_tb):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__print_unswitched_warning(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_link, int __pyx_v_printed_tb) {
      PyObject *__pyx_v_traceback = 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_2);
      __Pyx_XDECREF(__pyx_t_3);
      __Pyx_XDECREF(__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_5);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._AbstractLinkable__print_unswitched_warning", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_traceback);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +417:         print('gevent: error: Unable to switch to greenlet', link,

      __pyx_t_2 = NULL;
      __Pyx_INCREF(__pyx_builtin_print);
      __pyx_t_3 = __pyx_builtin_print;

     418:               'from', self, '; crossing thread boundaries is not allowed.',

    +419:               file=sys.stderr)

      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 419, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_6 = 1;
      {
        PyObject *__pyx_callargs[6 + ((CYTHON_VECTORCALL) ? 1 : 0)] = {__pyx_t_2, __pyx_mstate_global->__pyx_kp_u_gevent_error_Unable_to_switch_to, __pyx_v_link, __pyx_mstate_global->__pyx_n_u_from, ((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_kp_u_crossing_thread_boundaries_is_n};
        __pyx_t_4 = __Pyx_MakeVectorcallBuilderKwds(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        if (__Pyx_VectorcallBuilder_AddArg(__pyx_mstate_global->__pyx_n_u_file, __pyx_t_5, __pyx_t_4, __pyx_callargs+6, 0) < 0) __PYX_ERR(0, 417, __pyx_L1_error)
        __pyx_t_1 = __Pyx_Object_Vectorcall_CallFromBuilder(__pyx_t_3, __pyx_callargs+__pyx_t_6, (6-__pyx_t_6) | (__pyx_t_6*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET), __pyx_t_4);
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 417, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     420:

    +421:         if not printed_tb:

      __pyx_t_7 = (!__pyx_v_printed_tb);
      if (__pyx_t_7) {
    /* … */
      }

    +422:             printed_tb = True

        __pyx_v_printed_tb = 1;

    +423:             print(

        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_mstate_global->__pyx_tuple[0], __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 423, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    /* … */
      __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_kp_u_gevent_error_This_is_a_result_of, __pyx_mstate_global->__pyx_kp_u_and_is_a_bug_in_the_calling_code); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 423, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);

     424:                 'gevent: error: '

     425:                 'This is a result of using gevent objects from multiple threads,',

    +426:                 'and is a bug in the calling code.', file=sys.stderr)

        __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_stderr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (PyDict_SetItem(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_file, __pyx_t_4) < 0) __PYX_ERR(0, 426, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     427:

    +428:             import traceback

        __pyx_t_4 = __Pyx_ImportDottedModule(__pyx_mstate_global->__pyx_n_u_traceback, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_v_traceback = __pyx_t_4;
        __pyx_t_4 = 0;

    +429:             traceback.print_stack()

        __pyx_t_1 = __pyx_v_traceback;
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_6 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_1, NULL};
          __pyx_t_4 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_print_stack, __pyx_callargs+__pyx_t_6, (1-__pyx_t_6) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

     430:

    +431:     def _quiet_unlink_all(self, obj):

    static void __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__quiet_unlink_all(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_obj) {
    /* … */
      /* function exit code */
      goto __pyx_L0;
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_2);
      __Pyx_XDECREF(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_9);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._quiet_unlink_all", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_L0:;
      __Pyx_RefNannyFinishContext();
    }

    +432:         if obj is None:

      __pyx_t_1 = (__pyx_v_obj == Py_None);
      if (__pyx_t_1) {
    /* … */
      }

    +433:             return

        goto __pyx_L0;

     434:

    +435:         self.unlink(obj)

      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->unlink(__pyx_v_self, __pyx_v_obj, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +436:         if self._notifier is not None and self._notifier.args:

      __pyx_t_3 = (__pyx_v_self->_notifier != Py_None);
      if (__pyx_t_3) {
      } else {
        __pyx_t_1 = __pyx_t_3;
        goto __pyx_L5_bool_binop_done;
      }
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_3 < 0))) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_1 = __pyx_t_3;
      __pyx_L5_bool_binop_done:;
      if (__pyx_t_1) {
    /* … */
      }

    +437:             try:

        {
          /*try:*/ {
    /* … */
          }
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
          goto __pyx_L12_try_end;
          __pyx_L7_error:;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    /* … */
          __pyx_L9_except_error:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          goto __pyx_L1_error;
          __pyx_L8_exception_handled:;
          __Pyx_XGIVEREF(__pyx_t_4);
          __Pyx_XGIVEREF(__pyx_t_5);
          __Pyx_XGIVEREF(__pyx_t_6);
          __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
          __pyx_L12_try_end:;
        }

    +438:                 self._notifier.args[0].remove(obj)

            __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 438, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_8);
            __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 438, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_9);
            __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            __pyx_t_7 = __pyx_t_9;
            __Pyx_INCREF(__pyx_t_7);
            __pyx_t_10 = 0;
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_v_obj};
              __pyx_t_2 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_remove, __pyx_callargs+__pyx_t_10, (2-__pyx_t_10) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
              __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
              if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 438, __pyx_L7_error)
              __Pyx_GOTREF(__pyx_t_2);
            }
            __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    +439:             except ValueError:

          __pyx_t_11 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_ValueError);
          if (__pyx_t_11) {
            __Pyx_ErrRestore(0,0,0);
            goto __pyx_L8_exception_handled;
          }
          goto __pyx_L9_except_error;

     440:                 pass

     441:

    +442:     def __wait_to_be_notified(self, rawlink): # pylint:disable=too-many-branches

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__AbstractLinkable__wait_to_be_notified(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_v_rawlink) {
      PyObject *__pyx_v_resume_this_greenlet = 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_2);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._AbstractLinkable__wait_to_be_notified", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_resume_this_greenlet);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +443:         resume_this_greenlet = getcurrent().switch # pylint:disable=undefined-variable

      __pyx_t_1 = ((PyObject *)__pyx_f_6gevent_27_gevent_c_abstract_linkable_getcurrent()); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_switch); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_resume_this_greenlet = __pyx_t_2;
      __pyx_t_2 = 0;

    +444:         if rawlink:

      if (__pyx_v_rawlink) {
    /* … */
        goto __pyx_L3;
      }

    +445:             self.rawlink(resume_this_greenlet)

        __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->rawlink(__pyx_v_self, __pyx_v_resume_this_greenlet, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

     446:         else:

    +447:             self._notifier.args[0].append(resume_this_greenlet)

      /*else*/ {
        __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->_notifier, __pyx_mstate_global->__pyx_n_u_args); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyLong_From_long, 0, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_v_resume_this_greenlet); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 447, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_L3:;

     448:

    +449:         try:

      /*try:*/ {

    +450:             self._switch_to_hub(self.hub)

        __pyx_t_1 = ((PyObject *)__pyx_v_self->hub);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_switch_to_hub(__pyx_v_self, __pyx_t_1); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 450, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     451:             # If we got here, we were automatically unlinked already.

    +452:             resume_this_greenlet = None

        __Pyx_INCREF(Py_None);
        __Pyx_DECREF_SET(__pyx_v_resume_this_greenlet, Py_None);
      }

     453:         finally:

    +454:             self._quiet_unlink_all(resume_this_greenlet)

      /*finally:*/ {
        /*normal exit:*/{
          ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_quiet_unlink_all(__pyx_v_self, __pyx_v_resume_this_greenlet); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L1_error)
          goto __pyx_L6;
        }
        __pyx_L5_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
          if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_12);
          __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
          {
            ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_quiet_unlink_all(__pyx_v_self, __pyx_v_resume_this_greenlet); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 454, __pyx_L8_error)
          }
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
          __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
          goto __pyx_L1_error;
          __pyx_L8_error:;
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
          goto __pyx_L1_error;
        }
        __pyx_L6:;
      }

     455:

    +456:     def _switch_to_hub(self, the_hub):

    static int __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__switch_to_hub(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_the_hub) {
      PyObject *__pyx_v_result = NULL;
      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_XDECREF(__pyx_t_14);
      __Pyx_XDECREF(__pyx_t_15);
      __Pyx_XDECREF(__pyx_t_16);
      __Pyx_XDECREF(__pyx_t_18);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._switch_to_hub", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = -1;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

    +457:         self._drop_lock_for_switch_out()

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_drop_lock_for_switch_out(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    +458:         try:

      /*try:*/ {

    +459:             result = the_hub.switch()

        __pyx_t_2 = __pyx_v_the_hub;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_switch, __pyx_callargs+__pyx_t_3, (1-__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, 459, __pyx_L4_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __pyx_v_result = __pyx_t_1;
        __pyx_t_1 = 0;
      }

     460:         finally:

    +461:             self._acquire_lock_for_switch_in()

      /*finally:*/ {
        /*normal exit:*/{
          __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_acquire_lock_for_switch_in(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          goto __pyx_L5;
        }
        __pyx_L4_error:;
        /*exception exit:*/{
          __Pyx_PyThreadState_declare
          __Pyx_PyThreadState_assign
          __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
           __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
          if ( unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_7);
          __Pyx_XGOTREF(__pyx_t_8);
          __Pyx_XGOTREF(__pyx_t_9);
          __Pyx_XGOTREF(__pyx_t_10);
          __Pyx_XGOTREF(__pyx_t_11);
          __Pyx_XGOTREF(__pyx_t_12);
          __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
          {
            __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_acquire_lock_for_switch_in(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L7_error)
            __Pyx_GOTREF(__pyx_t_1);
            __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          }
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          __Pyx_XGIVEREF(__pyx_t_7);
          __Pyx_XGIVEREF(__pyx_t_8);
          __Pyx_XGIVEREF(__pyx_t_9);
          __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
          __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
          goto __pyx_L1_error;
          __pyx_L7_error:;
          __Pyx_XGIVEREF(__pyx_t_10);
          __Pyx_XGIVEREF(__pyx_t_11);
          __Pyx_XGIVEREF(__pyx_t_12);
          __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
          __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
          __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
          goto __pyx_L1_error;
        }
        __pyx_L5:;
      }

    +462:         if result is not self: # pragma: no cover

      __pyx_t_13 = (__pyx_v_result != ((PyObject *)__pyx_v_self));
      if (unlikely(__pyx_t_13)) {
    /* … */
      }

    +463:             raise InvalidSwitchError(

        __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError);
        __pyx_t_14 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_InvalidSwitchError;

    +464:                 'Invalid switch into %s.wait(): %r' % (

        __pyx_t_18 = __Pyx_PyUnicode_Join(__pyx_t_17, 4, 20 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_15) + 9 + __Pyx_PyUnicode_GET_LENGTH(__pyx_t_16), 127 | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_15) | __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_16));
        if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 464, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_18);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (unlikely(PyMethod_Check(__pyx_t_14))) {
          __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_14);
          assert(__pyx_t_2);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_14);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_14, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_t_18};
          __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_14, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
          __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
          if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __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, 463, __pyx_L1_error)

    +465:                     self.__class__.__name__,

        __pyx_t_15 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_mstate_global->__pyx_n_u_class); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 465, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 465, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __pyx_t_15 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Str(__pyx_t_16), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 465, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_15);
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;

    +466:                     result,

        __pyx_t_16 = __Pyx_PyObject_FormatSimpleAndDecref(PyObject_Repr(__pyx_v_result), __pyx_mstate_global->__pyx_empty_unicode); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_16);
        __pyx_t_17[0] = __pyx_mstate_global->__pyx_kp_u_Invalid_switch_into;
        __pyx_t_17[1] = __pyx_t_15;
        __pyx_t_17[2] = __pyx_mstate_global->__pyx_kp_u_wait;
        __pyx_t_17[3] = __pyx_t_16;

     467:                 )

     468:             )

     469:

    +470:     def _acquire_lock_for_switch_in(self):

    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__acquire_lock_for_switch_in(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
      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_27_gevent_c_abstract_linkable_AbstractLinkable &&
      __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_acquire_lock_for_switch_in); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in)) {
            __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, 470, __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_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_abstract_linkable.AbstractLinkable._acquire_lock_for_switch_in", __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_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in, "AbstractLinkable._acquire_lock_for_switch_in(self)");
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in = {"_acquire_lock_for_switch_in", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_acquire_lock_for_switch_in (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_12_acquire_lock_for_switch_in(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__acquire_lock_for_switch_in(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 470, __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_abstract_linkable.AbstractLinkable._acquire_lock_for_switch_in", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_13_acquire_lock_for_switch_in, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbstractLinkable__acquire_lock_f, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_acquire_lock_for_switch_in, __pyx_t_6) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +471:         return

      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

     472:

    +473:     def _drop_lock_for_switch_out(self):

    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__drop_lock_for_switch_out(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, int __pyx_skip_dispatch) {
      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_27_gevent_c_abstract_linkable_AbstractLinkable &&
      __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_drop_lock_for_switch_out); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          if (!__Pyx_IsSameCFunction(__pyx_t_1, (void(*)(void)) __pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out)) {
            __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, 473, __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_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_abstract_linkable.AbstractLinkable._drop_lock_for_switch_out", __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_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out, "AbstractLinkable._drop_lock_for_switch_out(self)");
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out = {"_drop_lock_for_switch_out", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_drop_lock_for_switch_out (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_14_drop_lock_for_switch_out(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_1 = __pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__drop_lock_for_switch_out(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 473, __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_abstract_linkable.AbstractLinkable._drop_lock_for_switch_out", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = NULL;
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_15_drop_lock_for_switch_out, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbstractLinkable__drop_lock_for, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[7])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_drop_lock_for_switch_out, __pyx_t_6) < 0) __PYX_ERR(0, 473, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    +474:         return

      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

     475:

    +476:     def _wait_core(self, timeout, catch=Timeout):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, PyObject *__pyx_v_timeout, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_core *__pyx_optional_args) {
      PyObject *__pyx_v_catch = __pyx_mstate_global->__pyx_k__2;
      PyObject *__pyx_v_timer = NULL;
      PyObject *__pyx_v_ex = NULL;
      PyObject *__pyx_r = NULL;
      if (__pyx_optional_args) {
        if (__pyx_optional_args->__pyx_n > 0) {
          __pyx_v_catch = __pyx_optional_args->__pyx_catch;
        }
      }
    /* … */
      /* 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_5);
      __Pyx_XDECREF(__pyx_t_6);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_timer);
      __Pyx_XDECREF(__pyx_v_ex);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __Pyx_INCREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout);
      __pyx_mstate_global->__pyx_k__2 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout;
      __Pyx_GIVEREF(__pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout);

     477:         """

     478:         The core of the wait implementation, handling switching and

     479:         linking.

     480:

     481:         This method is NOT safe to call from multiple threads.

     482:

     483:         ``self.hub`` must be initialized before entering this method.

     484:         The hub that is set is considered the owner and cannot be changed

     485:         while this method is running. It must only be called from the thread

     486:         where ``self.hub`` is the current hub.

     487:

     488:         If *catch* is set to ``()``, a timeout that elapses will be

     489:         allowed to be raised.

     490:

     491:         :return: A true value if the wait succeeded without timing out.

     492:           That is, a true return value means we were notified and control

     493:           resumed in this greenlet.

     494:         """

    +495:         with Timeout._start_new_or_dummy(timeout) as timer: # Might release

      /*with:*/ {
        __pyx_t_2 = __pyx_v_6gevent_27_gevent_c_abstract_linkable_Timeout;
        __Pyx_INCREF(__pyx_t_2);
        __pyx_t_3 = 0;
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_timeout};
          __pyx_t_1 = __Pyx_PyObject_FastCallMethod(__pyx_mstate_global->__pyx_n_u_start_new_or_dummy, __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, 495, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
        }
        __pyx_t_4 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_exit); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = NULL;
        __pyx_t_6 = __Pyx_PyObject_LookupSpecial(__pyx_t_1, __pyx_mstate_global->__pyx_n_u_enter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 495, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_3 = 1;
        #if CYTHON_UNPACK_METHODS
        if (likely(PyMethod_Check(__pyx_t_6))) {
          __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
          assert(__pyx_t_5);
          PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(__pyx__function);
          __Pyx_DECREF_SET(__pyx_t_6, __pyx__function);
          __pyx_t_3 = 0;
        }
        #endif
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_5, NULL};
          __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
          if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L3_error)
          __Pyx_GOTREF(__pyx_t_2);
        }
        __pyx_t_6 = __pyx_t_2;
        __pyx_t_2 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        /*try:*/ {
          {
            /*try:*/ {
              __pyx_v_timer = __pyx_t_6;
              __pyx_t_6 = 0;
    /* … */
            }
            __pyx_L7_error:;
            __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
            __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
            __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
            __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
            /*except:*/ {
              __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
              if (__Pyx_GetException(&__pyx_t_2, &__pyx_t_1, &__pyx_t_6) < 0) __PYX_ERR(0, 495, __pyx_L9_except_error)
              __Pyx_XGOTREF(__pyx_t_2);
              __Pyx_XGOTREF(__pyx_t_1);
              __Pyx_XGOTREF(__pyx_t_6);
              __pyx_t_5 = PyTuple_Pack(3, __pyx_t_2, __pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 495, __pyx_L9_except_error)
              __Pyx_GOTREF(__pyx_t_5);
              __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
              if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 495, __pyx_L9_except_error)
              __Pyx_GOTREF(__pyx_t_12);
              __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_12);
              __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
              if (__pyx_t_14 < 0) __PYX_ERR(0, 495, __pyx_L9_except_error)
              __pyx_t_23 = (!__pyx_t_14);
              if (unlikely(__pyx_t_23)) {
                __Pyx_GIVEREF(__pyx_t_2);
                __Pyx_GIVEREF(__pyx_t_1);
                __Pyx_XGIVEREF(__pyx_t_6);
                __Pyx_ErrRestoreWithState(__pyx_t_2, __pyx_t_1, __pyx_t_6);
                __pyx_t_2 = 0;  __pyx_t_1 = 0;  __pyx_t_6 = 0;
                __PYX_ERR(0, 495, __pyx_L9_except_error)
              }
              __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
              __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
              __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
              goto __pyx_L8_exception_handled;
            }
            __pyx_L9_except_error:;
            __Pyx_XGIVEREF(__pyx_t_7);
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
            goto __pyx_L1_error;
            __pyx_L11_try_return:;
            __Pyx_XGIVEREF(__pyx_t_7);
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
            goto __pyx_L4_return;
            __pyx_L8_exception_handled:;
            __Pyx_XGIVEREF(__pyx_t_7);
            __Pyx_XGIVEREF(__pyx_t_8);
            __Pyx_XGIVEREF(__pyx_t_9);
            __Pyx_ExceptionReset(__pyx_t_7, __pyx_t_8, __pyx_t_9);
          }
        }
        /*finally:*/ {
          /*normal exit:*/{
            if (__pyx_t_4) {
              __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1], NULL);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 495, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_9);
              __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
            }
            goto __pyx_L6;
          }
          __pyx_L4_return: {
            __pyx_t_9 = __pyx_r;
            __pyx_r = 0;
            if (__pyx_t_4) {
              __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[1], NULL);
              __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
              if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 495, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_8);
              __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
            }
            __pyx_r = __pyx_t_9;
            __pyx_t_9 = 0;
            goto __pyx_L0;
          }
          __pyx_L6:;
        }
        goto __pyx_L34;
        __pyx_L3_error:;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L1_error;
        __pyx_L34:;
      }
    /* … */
      __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(3, Py_None, Py_None, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
      __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);

     496:             # We already checked above (_wait()) if we're ready()

    +497:             try:

              {
                /*try:*/ {
    /* … */
                }
                __pyx_L13_error:;
                __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
                __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
                __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    /* … */
                __pyx_L15_except_error:;
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
                goto __pyx_L7_error;
                __pyx_L17_try_return:;
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
                goto __pyx_L11_try_return;
                __pyx_L16_except_return:;
                __Pyx_XGIVEREF(__pyx_t_10);
                __Pyx_XGIVEREF(__pyx_t_11);
                __Pyx_XGIVEREF(__pyx_t_12);
                __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
                goto __pyx_L11_try_return;
              }

    +498:                 self.__wait_to_be_notified(

                  __pyx_t_6 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_AbstractLinkable__wait_to_be_notified(__pyx_v_self, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 498, __pyx_L13_error)
                  __Pyx_GOTREF(__pyx_t_6);
                  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     499:                     True,# Use rawlink()

     500:                 )

    +501:                 return True

                  __Pyx_XDECREF(__pyx_r);
                  __Pyx_INCREF(Py_True);
                  __pyx_r = Py_True;
                  goto __pyx_L17_try_return;

    +502:             except catch as ex:

                __pyx_t_13 = __Pyx_PyErr_ExceptionMatches(__pyx_v_catch);
                if (__pyx_t_13) {
                  __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._wait_core", __pyx_clineno, __pyx_lineno, __pyx_filename);
                  if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_1, &__pyx_t_2) < 0) __PYX_ERR(0, 502, __pyx_L15_except_error)
                  __Pyx_XGOTREF(__pyx_t_6);
                  __Pyx_XGOTREF(__pyx_t_1);
                  __Pyx_XGOTREF(__pyx_t_2);
                  __Pyx_INCREF(__pyx_t_1);
                  __pyx_v_ex = __pyx_t_1;
                  /*try:*/ {
    /* … */
                  /*finally:*/ {
                    __pyx_L24_error:;
                    /*exception exit:*/{
                      __Pyx_PyThreadState_declare
                      __Pyx_PyThreadState_assign
                      __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
                      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
                       __Pyx_ExceptionSwap(&__pyx_t_20, &__pyx_t_21, &__pyx_t_22);
                      if ( unlikely(__Pyx_GetException(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19) < 0)) __Pyx_ErrFetch(&__pyx_t_17, &__pyx_t_18, &__pyx_t_19);
                      __Pyx_XGOTREF(__pyx_t_17);
                      __Pyx_XGOTREF(__pyx_t_18);
                      __Pyx_XGOTREF(__pyx_t_19);
                      __Pyx_XGOTREF(__pyx_t_20);
                      __Pyx_XGOTREF(__pyx_t_21);
                      __Pyx_XGOTREF(__pyx_t_22);
                      __pyx_t_13 = __pyx_lineno; __pyx_t_15 = __pyx_clineno; __pyx_t_16 = __pyx_filename;
                      {
                        __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
                      }
                      __Pyx_XGIVEREF(__pyx_t_20);
                      __Pyx_XGIVEREF(__pyx_t_21);
                      __Pyx_XGIVEREF(__pyx_t_22);
                      __Pyx_ExceptionReset(__pyx_t_20, __pyx_t_21, __pyx_t_22);
                      __Pyx_XGIVEREF(__pyx_t_17);
                      __Pyx_XGIVEREF(__pyx_t_18);
                      __Pyx_XGIVEREF(__pyx_t_19);
                      __Pyx_ErrRestore(__pyx_t_17, __pyx_t_18, __pyx_t_19);
                      __pyx_t_17 = 0; __pyx_t_18 = 0; __pyx_t_19 = 0; __pyx_t_20 = 0; __pyx_t_21 = 0; __pyx_t_22 = 0;
                      __pyx_lineno = __pyx_t_13; __pyx_clineno = __pyx_t_15; __pyx_filename = __pyx_t_16;
                      goto __pyx_L15_except_error;
                    }
                    __pyx_L23_return: {
                      __pyx_t_22 = __pyx_r;
                      __pyx_r = 0;
                      __Pyx_DECREF(__pyx_v_ex); __pyx_v_ex = 0;
                      __pyx_r = __pyx_t_22;
                      __pyx_t_22 = 0;
                      goto __pyx_L16_except_return;
                    }
                  }
                }
                goto __pyx_L15_except_error;

    +503:                 if ex is not timer:

                    __pyx_t_14 = (__pyx_v_ex != __pyx_v_timer);
                    if (unlikely(__pyx_t_14)) {
    /* … */
                    }

    +504:                     raise

                      __Pyx_GIVEREF(__pyx_t_6);
                      __Pyx_GIVEREF(__pyx_t_1);
                      __Pyx_XGIVEREF(__pyx_t_2);
                      __Pyx_ErrRestoreWithState(__pyx_t_6, __pyx_t_1, __pyx_t_2);
                      __pyx_t_6 = 0;  __pyx_t_1 = 0;  __pyx_t_2 = 0;
                      __PYX_ERR(0, 504, __pyx_L24_error)

     505:                 # test_set_and_clear and test_timeout in test_threading

     506:                 # rely on the exact return values, not just truthish-ness

    +507:                 return False

                    __Pyx_XDECREF(__pyx_r);
                    __Pyx_INCREF(Py_False);
                    __pyx_r = Py_False;
                    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
                    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
                    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
                    goto __pyx_L23_return;
                  }

     508:

    +509:     def _wait_return_value(self, waited, wait_success):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait_return_value(CYTHON_UNUSED struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, CYTHON_UNUSED int __pyx_v_waited, CYTHON_UNUSED int __pyx_v_wait_success) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_L0:;
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     510:         # pylint:disable=unused-argument

     511:         # Subclasses should override this to return a value from _wait.

     512:         # By default we return None.

    +513:         return None # pragma: no cover all extent subclasses override

      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;

     514:

    +515:     def _wait(self, timeout=None):

    static PyObject *__pyx_f_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self, struct __pyx_opt_args_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable__wait *__pyx_optional_args) {
      PyObject *__pyx_v_timeout = ((PyObject *)Py_None);
      PyObject *__pyx_v_result = NULL;
      PyObject *__pyx_v_gotit = NULL;
      PyObject *__pyx_r = NULL;
      if (__pyx_optional_args) {
        if (__pyx_optional_args->__pyx_n > 0) {
          __pyx_v_timeout = __pyx_optional_args->timeout;
        }
      }
    /* … */
      /* function exit code */
      __pyx_L1_error:;
      __Pyx_XDECREF(__pyx_t_1);
      __Pyx_AddTraceback("gevent._gevent_c_abstract_linkable.AbstractLinkable._wait", __pyx_clineno, __pyx_lineno, __pyx_filename);
      __pyx_r = 0;
      __pyx_L0:;
      __Pyx_XDECREF(__pyx_v_result);
      __Pyx_XDECREF(__pyx_v_gotit);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }

     516:         # Watch where we could potentially release the GIL.

    +517:         self._capture_hub(True) # Must create, we must have an owner. Might release

      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_capture_hub(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     518:

    +519:         if self.ready(): # *might* release, if overridden in Python.

      __pyx_t_2 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->ready(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 519, __pyx_L1_error)
      if (__pyx_t_2) {
    /* … */
      }

    +520:             result = self._wait_return_value(False, False) # pylint:disable=assignment-from-none

        __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 520, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_v_result = __pyx_t_1;
        __pyx_t_1 = 0;

    +521:             if self._notifier:

        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->_notifier); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 521, __pyx_L1_error)
        if (__pyx_t_2) {
    /* … */
        }

     522:                 # We're already notifying waiters; one of them must have run

     523:                 # and switched to this greenlet, which arrived here. Alternately,

     524:                 # we could be in a separate thread (but we're holding the GIL/object lock)

    +525:                 self.__wait_to_be_notified(False) # Use self._notifier.args[0] instead of self.rawlink

          __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_AbstractLinkable__wait_to_be_notified(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 525, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

     526:

    +527:             return result

        __Pyx_XDECREF(__pyx_r);
        __Pyx_INCREF(__pyx_v_result);
        __pyx_r = __pyx_v_result;
        goto __pyx_L0;

     528:

    +529:         gotit = self._wait_core(timeout)

      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_core(__pyx_v_self, __pyx_v_timeout, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_v_gotit = __pyx_t_1;
      __pyx_t_1 = 0;

    +530:         return self._wait_return_value(True, gotit)

      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_gotit); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
      __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self->__pyx_vtab)->_wait_return_value(__pyx_v_self, 1, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_r = __pyx_t_1;
      __pyx_t_1 = 0;
      goto __pyx_L0;

     531:

    +532:     def _at_fork_reinit(self):

    /* Python wrapper */
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
    PyDoc_STRVAR(__pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit, "AbstractLinkable._at_fork_reinit(self)\n\nThis method was added in Python 3.9 and is called by logging.py\n``_after_at_fork_child_reinit_locks`` on Lock objects.\n\nIt is also called from threading.py, ``_after_fork`` in\n``_reset_internal_locks``, and that can hit ``Event`` objects.\n\nSubclasses should reset themselves to an initial state. This\nincludes unlocking/releasing, if possible. This method detaches from the\nprevious hub and drops any existing notifier.");
    static PyMethodDef __pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit = {"_at_fork_reinit", (PyCFunction)__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit, METH_NOARGS, __pyx_doc_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit};
    static PyObject *__pyx_pw_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
      CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
      PyObject *__pyx_r = 0;
      __Pyx_RefNannyDeclarations
      __Pyx_RefNannySetupContext("_at_fork_reinit (wrapper)", 0);
      __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
      __pyx_r = __pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit(((struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *)__pyx_v_self));

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

    static PyObject *__pyx_pf_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_16_at_fork_reinit(struct __pyx_obj_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable *__pyx_v_self) {
      PyObject *__pyx_r = NULL;
    /* … */
      /* function exit code */
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_XGIVEREF(__pyx_r);
      __Pyx_RefNannyFinishContext();
      return __pyx_r;
    }
    /* … */
      __pyx_t_6 = __Pyx_CyFunction_New(&__pyx_mdef_6gevent_27_gevent_c_abstract_linkable_16AbstractLinkable_17_at_fork_reinit, __Pyx_CYFUNCTION_CCLASS, __pyx_mstate_global->__pyx_n_u_AbstractLinkable__at_fork_reinit, NULL, __pyx_mstate_global->__pyx_n_u_gevent__gevent_c_abstract_linkab, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[8])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 532, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_SetItemOnTypeDict(__pyx_mstate_global->__pyx_ptype_6gevent_27_gevent_c_abstract_linkable_AbstractLinkable, __pyx_mstate_global->__pyx_n_u_at_fork_reinit, __pyx_t_6) < 0) __PYX_ERR(0, 532, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

     533:         """

     534:         This method was added in Python 3.9 and is called by logging.py

     535:         ``_after_at_fork_child_reinit_locks`` on Lock objects.

     536:

     537:         It is also called from threading.py, ``_after_fork`` in

     538:         ``_reset_internal_locks``, and that can hit ``Event`` objects.

     539:

     540:         Subclasses should reset themselves to an initial state. This

     541:         includes unlocking/releasing, if possible. This method detaches from the

     542:         previous hub and drops any existing notifier.

     543:         """

    +544:         self.hub = None

      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __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 *)Py_None);

    +545:         self._notifier = None

      __Pyx_INCREF(Py_None);
      __Pyx_GIVEREF(Py_None);
      __Pyx_GOTREF(__pyx_v_self->_notifier);
      __Pyx_DECREF(__pyx_v_self->_notifier);
      __pyx_v_self->_notifier = Py_None;

     546:

    +547: def _init():

    static void __pyx_f_6gevent_27_gevent_c_abstract_linkable__init(void) {

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

      __pyx_f_6gevent_27_gevent_c_abstract_linkable_greenlet_init(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 548, __pyx_L1_error)

     549:

    +550: _init()

      __pyx_f_6gevent_27_gevent_c_abstract_linkable__init(); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 550, __pyx_L1_error)

     551:

     552:

    +553: from gevent._util import import_c_accel

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

    +554: import_c_accel(globals(), 'gevent.__abstract_linkable')

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