#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
/* Generated by cythonpp.py on 2016-03-05 07:11:05 */
/* Generated by Cython 0.23.4 */
#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
    #error Cython requires Python 2.6+ or Python 3.2+.
#else
#define CYTHON_ABI "0_23_4"
#include <stddef.h>
#ifndef offsetof
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
#define CYTHON_COMPILING_IN_PYPY 1
#define CYTHON_COMPILING_IN_CPYTHON 0
#else
#define CYTHON_COMPILING_IN_PYPY 0
#define CYTHON_COMPILING_IN_CPYTHON 1
#endif
#if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
#define CYTHON_USE_PYLONG_INTERNALS 1
#endif
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
#define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
#else
  #define CYTHON_PEP393_ENABLED 0
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if PY_VERSION_HEX >= 0x030500B1
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
#elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
typedef struct {
    unaryfunc am_await;
    unaryfunc am_aiter;
    unaryfunc am_anext;
} __Pyx_PyAsyncMethodsStruct;
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
#else
#define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)

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

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


#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif

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

#define __PYX_HAVE__gevent__corecext
#define __PYX_HAVE_API__gevent__corecext
#include "libev_vfd.h"
#include "libev.h"
#include "frameobject.h"
#include "callbacks.h"
#include "stathelper.c"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif

#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

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


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

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


static const char *__pyx_f[] = {
  "gevent/corecext.pyx",
};

/*--- Type declarations ---*/
struct __pyx_obj_6gevent_8corecext__EVENTSType;
struct PyGeventLoopObject;
struct PyGeventCallbackObject;
struct PyGeventWatcherObject;
struct PyGeventIOObject;
struct PyGeventTimerObject;
struct PyGeventSignalObject;
struct PyGeventIdleObject;
struct PyGeventPrepareObject;
struct PyGeventCheckObject;
struct PyGeventForkObject;
struct PyGeventAsyncObject;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
struct PyGeventChildObject;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
struct PyGeventStatObject;
struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr;

/* "gevent/corecext.pyx":90
 *
 * @cython.internal
 * cdef class _EVENTSType:             # <<<<<<<<<<<<<<
 *
 *     def __repr__(self):
 */
struct __pyx_obj_6gevent_8corecext__EVENTSType {
  PyObject_HEAD
};


/* "gevent/corecext.pyx":239
 *
 *
 * cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:             # <<<<<<<<<<<<<<
 *     cdef libev.ev_loop* _ptr
 *     cdef public object error_handler
 */
struct PyGeventLoopObject {
  PyObject_HEAD
  struct __pyx_vtabstruct_6gevent_8corecext_loop *__pyx_vtab;
  struct ev_loop *_ptr;
  PyObject *error_handler;
  struct ev_prepare _prepare;
  PyObject *_callbacks;
  struct ev_timer _timer0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  struct ev_timer _periodic_signal_checker;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type;

/* "gevent/corecext.pyx":617
 *
 *
 * cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]:             # <<<<<<<<<<<<<<
 *     cdef public object callback
 *     cdef public tuple args
 */
struct PyGeventCallbackObject {
  PyObject_HEAD
  PyObject *callback;
  PyObject *args;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCallback_Type;

/* "gevent/corecext.pyx":685
 *
 *
 * cdef public class watcher [object PyGeventWatcherObject, type PyGeventWatcher_Type]:             # <<<<<<<<<<<<<<
 *     """Abstract base class for all the watchers"""
 *
 */
struct PyGeventWatcherObject {
  PyObject_HEAD
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventWatcher_Type;

/* "gevent/corecext.pyx":710
 *
 *
 * cdef public class io(watcher) [object PyGeventIOObject, type PyGeventIO_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventIOObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_io _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIO_Type;

/* "gevent/corecext.pyx":895
 *
 *
 * cdef public class timer(watcher) [object PyGeventTimerObject, type PyGeventTimer_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventTimerObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_timer _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventTimer_Type;

/* "gevent/corecext.pyx":1040
 *
 *
 * cdef public class signal(watcher) [object PyGeventSignalObject, type PyGeventSignal_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventSignalObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_signal _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventSignal_Type;

/* "gevent/corecext.pyx":1165
 *
 *
 * cdef public class idle(watcher) [object PyGeventIdleObject, type PyGeventIdle_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventIdleObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_idle _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventIdle_Type;

/* "gevent/corecext.pyx":1284
 *
 *
 * cdef public class prepare(watcher) [object PyGeventPrepareObject, type PyGeventPrepare_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventPrepareObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_prepare _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventPrepare_Type;

/* "gevent/corecext.pyx":1403
 *
 *
 * cdef public class check(watcher) [object PyGeventCheckObject, type PyGeventCheck_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventCheckObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_check _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventCheck_Type;

/* "gevent/corecext.pyx":1522
 *
 *
 * cdef public class fork(watcher) [object PyGeventForkObject, type PyGeventFork_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventForkObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_fork _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventFork_Type;

/* "gevent/corecext.pyx":1641
 *
 *
 * cdef public class async(watcher) [object PyGeventAsyncObject, type PyGeventAsync_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventAsyncObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_async _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventAsync_Type;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))

/* "gevent/corecext.pyx":1767
 *
 *
 * cdef public class child(watcher) [object PyGeventChildObject, type PyGeventChild_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventChildObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_child _watcher;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventChild_Type;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/corecext.pyx":1912
 *
 *
 * cdef public class stat(watcher) [object PyGeventStatObject, type PyGeventStat_Type]:             # <<<<<<<<<<<<<<
 *
 *
 */
struct PyGeventStatObject {
  struct PyGeventWatcherObject __pyx_base;
  struct PyGeventLoopObject *loop;
  PyObject *_callback;
  PyObject *args;
  int _flags;
  struct ev_stat _watcher;
  PyObject *path;
  PyObject *_paths;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventStat_Type;

/* "gevent/corecext.pyx":121
 *
 *
 * _flags_str2int = dict((string, flag) for (flag, string) in _flags)             # <<<<<<<<<<<<<<
 *
 *
 */
struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_v_flag;
  PyObject *__pyx_v_string;
};


__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type;

/* "gevent/corecext.pyx":239
 *
 *
 * cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:             # <<<<<<<<<<<<<<
 *     cdef libev.ev_loop* _ptr
 *     cdef public object error_handler
 */

struct __pyx_vtabstruct_6gevent_8corecext_loop {
  PyObject *(*_run_callbacks)(struct PyGeventLoopObject *);
  PyObject *(*handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*_default_handle_error)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_6gevent_8corecext_loop *__pyx_vtabptr_6gevent_8corecext_loop;

/* --- Runtime support code (head) --- */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

static PyObject *__Pyx_GetBuiltinName(PyObject *name);

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static CYTHON_INLINE int __Pyx_IterFinish(void);

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

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

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

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

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb);
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb);

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyString_Join __Pyx_PyBytes_Join
#define __Pyx_PyBaseString_Join(s, v) (PyUnicode_CheckExact(s) ? PyUnicode_Join(s, v) : __Pyx_PyBytes_Join(s, v))
#else
#define __Pyx_PyString_Join PyUnicode_Join
#define __Pyx_PyBaseString_Join PyUnicode_Join
#endif
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION < 3
    #define __Pyx_PyBytes_Join _PyString_Join
    #else
    #define __Pyx_PyBytes_Join _PyBytes_Join
    #endif
#else
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values);
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

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

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

static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact);

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);

#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#define __Pyx_PyCallable_Check(obj)   ((obj)->ob_type->tp_call != NULL)
#else
#define __Pyx_PyCallable_Check(obj)   PyCallable_Check(obj)
#endif

static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);

#include <string.h>

static int __Pyx_SetVtable(PyObject *dict, void *vtable);

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

static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static CYTHON_INLINE vfd_socket_t __Pyx_PyInt_As_vfd_socket_t(PyObject *);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_vfd_socket_t(vfd_socket_t value);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject *type, __pyx_coroutine_body_t body,
                                                   PyObject *closure, PyObject *name, PyObject *qualname);
static int __Pyx_Coroutine_clear(PyObject *self);
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue);
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue) PyGen_FetchStopIterationValue(pvalue)
#endif

static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

static int __Pyx_patch_abc(void);

#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, closure, name, qualname)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, closure, name, qualname)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

static int __Pyx_check_binary_version(void);

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static PyObject *__pyx_f_6gevent_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_6gevent_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_6gevent_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch); /* proto*/

/* Module declarations from 'cython' */

/* Module declarations from 'gevent.libev' */

/* Module declarations from 'gevent.python' */

/* Module declarations from 'gevent.corecext' */
static PyTypeObject *__pyx_ptype_6gevent_8corecext__EVENTSType = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_loop = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_callback = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_watcher = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_io = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_timer = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_signal = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_idle = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_prepare = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_check = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_fork = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext_async = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyTypeObject *__pyx_ptype_6gevent_8corecext_child = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyTypeObject *__pyx_ptype_6gevent_8corecext_stat = 0;
static PyTypeObject *__pyx_ptype_6gevent_8corecext___pyx_scope_struct__genexpr = 0;
static PyObject *__pyx_v_6gevent_8corecext_integer_types = 0;
__PYX_EXTERN_C DL_EXPORT(PyObject) *GEVENT_CORE_EVENTS;
static int __pyx_v_6gevent_8corecext__default_loop_destroyed;
static PyObject *__pyx_f_6gevent_8corecext__flags_to_list(unsigned int, int __pyx_skip_dispatch); /*proto*/
static unsigned int __pyx_f_6gevent_8corecext__flags_to_int(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext__str_hex(PyObject *); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext__check_flags(unsigned int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext__events_to_str(int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_6gevent_8corecext__syserr_cb(char *); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext_set_syserr_cb(PyObject *, int __pyx_skip_dispatch); /*proto*/
#define __Pyx_MODULE_NAME "gevent.corecext"
int __pyx_module_is_main_gevent__corecext = 0;

/* Implementation of 'gevent.corecext' */
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_hex;
static PyObject *__pyx_builtin_SystemError;
static PyObject *__pyx_builtin_id;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_builtin_AttributeError;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_builtin_TypeError;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_builtin_AttributeError;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_[] = ",";
static char __pyx_k__3[] = ", ";
static char __pyx_k__4[] = "|";
static char __pyx_k__5[] = ": ";
static char __pyx_k_fd[] = "fd";
static char __pyx_k_id[] = "id";
static char __pyx_k_os[] = "os";
static char __pyx_k_tb[] = "tb";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static char __pyx_k__21[] = "<...>";
static char __pyx_k__22[] = ">";
static char __pyx_k__23[] = "";
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k__21[] = "";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static char __pyx_k__26[] = "<...>";
static char __pyx_k__27[] = ">";
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static char __pyx_k__27[] = "<...>";
static char __pyx_k__28[] = ">";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_all[] = "__all__";
static char __pyx_k_hex[] = "hex";
static char __pyx_k_how[] = "how";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static char __pyx_k_pid[] = "pid";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_ptr[] = "ptr";
static char __pyx_k_ref[] = "ref";
static char __pyx_k_sys[] = "sys";
static char __pyx_k_FORK[] = "FORK";
static char __pyx_k_IDLE[] = "IDLE";
static char __pyx_k_NONE[] = "NONE";
static char __pyx_k_NSIG[] = "NSIG";
static char __pyx_k_READ[] = "READ";
static char __pyx_k_STAT[] = "STAT";
static char __pyx_k_args[] = "args";
static char __pyx_k_func[] = "func";
static char __pyx_k_join[] = "join";
static char __pyx_k_keys[] = "keys";
static char __pyx_k_loop[] = "loop";
static char __pyx_k_main[] = "__main__";
static char __pyx_k_name[] = "__name__";
static char __pyx_k_once[] = "once";
static char __pyx_k_path[] = "path";
static char __pyx_k_poll[] = "poll";
static char __pyx_k_port[] = "port";
static char __pyx_k_send[] = "send";
static char __pyx_k_test[] = "__test__";
static char __pyx_k_time[] = "time";
static char __pyx_k_type[] = "type";
static char __pyx_k_ASYNC[] = "ASYNC";
static char __pyx_k_CHECK[] = "CHECK";
static char __pyx_k_CHILD[] = "CHILD";
static char __pyx_k_EMBED[] = "EMBED";
static char __pyx_k_ERROR[] = "ERROR";
static char __pyx_k_TIMER[] = "TIMER";
static char __pyx_k_UNDEF[] = "UNDEF";
static char __pyx_k_WRITE[] = "WRITE";
static char __pyx_k_after[] = "after";
static char __pyx_k_class[] = "__class__";
static char __pyx_k_close[] = "close";
static char __pyx_k_epoll[] = "epoll";
static char __pyx_k_errno[] = "errno";
static char __pyx_k_flags[] = "_flags";
static char __pyx_k_level[] = "level";
static char __pyx_k_lower[] = "lower";
static char __pyx_k_noenv[] = "noenv";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_ref_2[] = " ref=";
static char __pyx_k_sigfd[] = "sigfd";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_split[] = "split";
static char __pyx_k_strip[] = "strip";
static char __pyx_k_throw[] = "throw";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static char __pyx_k_trace[] = "trace";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_value[] = "value";
static char __pyx_k_CUSTOM[] = "CUSTOM";
static char __pyx_k_EVENTS[] = "EVENTS";
static char __pyx_k_MAXPRI[] = "MAXPRI";
static char __pyx_k_MINPRI[] = "MINPRI";
static char __pyx_k_SIGNAL[] = "SIGNAL";
static char __pyx_k_active[] = "active";
static char __pyx_k_args_r[] = " args=%r";
static char __pyx_k_decode[] = "decode";
static char __pyx_k_encode[] = "encode";
static char __pyx_k_events[] = "_events";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_fileno[] = "fileno";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_format[] = "_format";
static char __pyx_k_import[] = "__import__";
static char __pyx_k_kqueue[] = "kqueue";
static char __pyx_k_nowait[] = "nowait";
static char __pyx_k_repeat[] = "repeat";
static char __pyx_k_select[] = "select";
static char __pyx_k_signal[] = "signal";
static char __pyx_k_signum[] = "signum";
static char __pyx_k_update[] = "update";
static char __pyx_k_CLEANUP[] = "CLEANUP";
static char __pyx_k_IOFDSET[] = "_IOFDSET";
static char __pyx_k_PREPARE[] = "PREPARE";
static char __pyx_k_backend[] = "backend";
static char __pyx_k_context[] = "context";
static char __pyx_k_default[] = "default";
static char __pyx_k_flags_2[] = "flags";
static char __pyx_k_genexpr[] = "genexpr";
static char __pyx_k_message[] = "message";
static char __pyx_k_pending[] = "pending";
static char __pyx_k_revents[] = "revents";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static char __pyx_k_rstatus[] = "rstatus";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_sigfd_2[] = " sigfd=";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_stopped[] = " stopped";
static char __pyx_k_KeyError[] = "KeyError";
static char __pyx_k_PERIODIC[] = "PERIODIC";
static char __pyx_k_SIGNALFD[] = "SIGNALFD";
static char __pyx_k_active_2[] = " active";
static char __pyx_k_builtins[] = "__builtins__";
static char __pyx_k_callback[] = "callback";
static char __pyx_k_events_2[] = "events";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_fileno_2[] = " fileno=";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_interval[] = "interval";
static char __pyx_k_priority[] = "priority";
static char __pyx_k_signalfd[] = "signalfd";
static char __pyx_k_strerror[] = "strerror";
static char __pyx_k_FORKCHECK[] = "FORKCHECK";
static char __pyx_k_NOINOTIFY[] = "NOINOTIFY";
static char __pyx_k_NOSIGMASK[] = "NOSIGMASK";
static char __pyx_k_READWRITE[] = "READWRITE";
static char __pyx_k_TypeError[] = "TypeError";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_activecnt[] = "activecnt";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_default_2[] = " default";
static char __pyx_k_destroyed[] = "destroyed";
static char __pyx_k_forkcheck[] = "forkcheck";
static char __pyx_k_noinotify[] = "noinotify";
static char __pyx_k_nosigmask[] = "nosigmask";
static char __pyx_k_pending_2[] = " pending";
static char __pyx_k_pending_s[] = " pending=%s";
static char __pyx_k_print_exc[] = "print_exc";
static char __pyx_k_signalnum[] = "signalnum";
static char __pyx_k_traceback[] = "traceback";
static char __pyx_k_ValueError[] = "ValueError";
static char __pyx_k_basestring[] = "basestring";
static char __pyx_k_callback_r[] = " callback=%r";
static char __pyx_k_events_str[] = "events_str";
static char __pyx_k_pendingcnt[] = "pendingcnt";
static char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static char __pyx_k_LIBEV_EMBED[] = "LIBEV_EMBED";
static char __pyx_k_SystemError[] = "SystemError";
static char __pyx_k_get_version[] = "get_version";
static char __pyx_k_libev_d_02d[] = "libev-%d.%02d";
static char __pyx_k_pass_events[] = "pass_events";
static char __pyx_k_s_at_0x_x_s[] = "<%s at 0x%x %s>";
static char __pyx_k_BACKEND_POLL[] = "BACKEND_POLL";
static char __pyx_k_BACKEND_PORT[] = "BACKEND_PORT";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_EV_USE_4HEAP[] = "EV_USE_4HEAP";
static char __pyx_k_EV_USE_FLOOR[] = "EV_USE_FLOOR";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_handle_error[] = "handle_error";
static char __pyx_k_signalmodule[] = "signalmodule";
static char __pyx_k_version_info[] = "version_info";
static char __pyx_k_BACKEND_EPOLL[] = "BACKEND_EPOLL";
static char __pyx_k_fd_s_events_s[] = " fd=%s events=%s";
static char __pyx_k_flags_str2int[] = "_flags_str2int";
static char __pyx_k_handle_syserr[] = "_handle_syserr";
static char __pyx_k_s_at_0x_x_s_2[] = "<%s at 0x%x%s";
static char __pyx_k_stop_watchers[] = "_stop_watchers";
static char __pyx_k_AttributeError[] = "AttributeError";
static char __pyx_k_BACKEND_KQUEUE[] = "BACKEND_KQUEUE";
static char __pyx_k_BACKEND_SELECT[] = "BACKEND_SELECT";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_EV_USE_EVENTFD[] = "EV_USE_EVENTFD";
static char __pyx_k_EV_USE_INOTIFY[] = "EV_USE_INOTIFY";
static char __pyx_k_format_details[] = "_format_details";
static char __pyx_k_EV_USE_REALTIME[] = "EV_USE_REALTIME";
static char __pyx_k_EV_USE_SIGNALFD[] = "EV_USE_SIGNALFD";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_SYSERR_CALLBACK[] = "__SYSERR_CALLBACK";
static char __pyx_k_gevent_corecext[] = "gevent.corecext";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static char __pyx_k_pid_r_rstatus_r[] = " pid=%r rstatus=%r";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_print_exception[] = "print_exception";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_EV_USE_MONOTONIC[] = "EV_USE_MONOTONIC";
static char __pyx_k_EV_USE_NANOSLEEP[] = "EV_USE_NANOSLEEP";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_get_header_version[] = "get_header_version";
static char __pyx_k_gevent_core_EVENTS[] = "gevent.core.EVENTS";
static char __pyx_k_supported_backends[] = "supported_backends";
static char __pyx_k_embeddable_backends[] = "embeddable_backends";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static char __pyx_k_EV_USE_CLOCK_SYSCALL[] = "EV_USE_CLOCK_SYSCALL";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_default_handle_error[] = "_default_handle_error";
static char __pyx_k_ev_loop_new_s_failed[] = "ev_loop_new(%s) failed";
static char __pyx_k_illegal_event_mask_r[] = "illegal event mask: %r";
static char __pyx_k_recommended_backends[] = "recommended_backends";
static char __pyx_k_Unsupported_backend_s[] = "Unsupported backend: %s";
static char __pyx_k_getfilesystemencoding[] = "getfilesystemencoding";
static char __pyx_k_Expected_callable_not_r[] = "Expected callable, not %r";
static char __pyx_k_illegal_signal_number_r[] = "illegal signal number: %r";
static char __pyx_k_ev_default_loop_s_failed[] = "ev_default_loop(%s) failed";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static char __pyx_k_fd_must_be_non_negative_r[] = "fd must be non-negative: %r";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k_operation_on_destroyed_loop[] = "operation on destroyed loop";
static char __pyx_k_Invalid_value_for_backend_0x_x[] = "Invalid value for backend: 0x%x";
static char __pyx_k_io_watcher_attribute_events_is[] = "'io' watcher attribute 'events' is read-only while watcher is active";
static char __pyx_k_Expected_callable_or_None_got_r[] = "Expected callable or None, got %r";
static char __pyx_k_io_watcher_attribute_fd_is_read[] = "'io' watcher attribute 'fd' is read-only while watcher is active";
static char __pyx_k_private_tmp_gevent_python2_7_ge[] = "/private/tmp/gevent/python2.7/gevent/gevent/corecext.pyx";
static char __pyx_k_repeat_must_be_positive_or_zero[] = "repeat must be positive or zero: %r";
static char __pyx_k_Cannot_set_priority_of_an_active[] = "Cannot set priority of an active watcher";
static char __pyx_k_Invalid_backend_or_flag_s_Possib[] = "Invalid backend or flag: %s\nPossible values: %s";
static char __pyx_k_callback_must_be_callable_not_No[] = "callback must be callable, not None";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static char __pyx_k_child_watchers_are_only_availabl[] = "child watchers are only available on the default loop";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_;
static PyObject *__pyx_n_s_ASYNC;
static PyObject *__pyx_n_s_AttributeError;
static PyObject *__pyx_n_s_BACKEND_EPOLL;
static PyObject *__pyx_n_s_BACKEND_KQUEUE;
static PyObject *__pyx_n_s_BACKEND_POLL;
static PyObject *__pyx_n_s_BACKEND_PORT;
static PyObject *__pyx_n_s_BACKEND_SELECT;
static PyObject *__pyx_n_s_CHECK;
static PyObject *__pyx_n_s_CHILD;
static PyObject *__pyx_n_s_CLEANUP;
static PyObject *__pyx_n_s_CUSTOM;
static PyObject *__pyx_kp_s_Cannot_set_priority_of_an_active;
static PyObject *__pyx_n_s_EMBED;
static PyObject *__pyx_n_s_ERROR;
static PyObject *__pyx_n_s_EVENTS;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_n_s_EV_USE_4HEAP;
static PyObject *__pyx_n_s_EV_USE_CLOCK_SYSCALL;
static PyObject *__pyx_n_s_EV_USE_EVENTFD;
static PyObject *__pyx_n_s_EV_USE_FLOOR;
static PyObject *__pyx_n_s_EV_USE_INOTIFY;
static PyObject *__pyx_n_s_EV_USE_MONOTONIC;
static PyObject *__pyx_n_s_EV_USE_NANOSLEEP;
static PyObject *__pyx_n_s_EV_USE_REALTIME;
static PyObject *__pyx_n_s_EV_USE_SIGNALFD;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_Expected_callable_not_r;
static PyObject *__pyx_kp_s_Expected_callable_or_None_got_r;
static PyObject *__pyx_n_s_FORK;
static PyObject *__pyx_n_s_FORKCHECK;
static PyObject *__pyx_n_s_IDLE;
static PyObject *__pyx_n_s_IOFDSET;
static PyObject *__pyx_kp_s_Invalid_backend_or_flag_s_Possib;
static PyObject *__pyx_kp_s_Invalid_value_for_backend_0x_x;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_LIBEV_EMBED;
static PyObject *__pyx_n_s_MAXPRI;
static PyObject *__pyx_n_s_MINPRI;
static PyObject *__pyx_n_s_NOINOTIFY;
static PyObject *__pyx_n_s_NONE;
static PyObject *__pyx_n_s_NOSIGMASK;
static PyObject *__pyx_n_s_NSIG;
static PyObject *__pyx_n_s_PERIODIC;
static PyObject *__pyx_n_s_PREPARE;
static PyObject *__pyx_n_s_READ;
static PyObject *__pyx_n_s_READWRITE;
static PyObject *__pyx_n_s_SIGNAL;
static PyObject *__pyx_n_s_SIGNALFD;
static PyObject *__pyx_n_s_STAT;
static PyObject *__pyx_n_s_SYSERR_CALLBACK;
static PyObject *__pyx_n_s_SystemError;
static PyObject *__pyx_n_s_TIMER;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_UNDEF;
static PyObject *__pyx_kp_s_Unsupported_backend_s;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_WRITE;
static PyObject *__pyx_kp_s__21;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s__22;
static PyObject *__pyx_kp_s__23;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s__26;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s__27;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s__28;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s__3;
static PyObject *__pyx_kp_s__4;
static PyObject *__pyx_kp_s__5;
static PyObject *__pyx_n_s_active;
static PyObject *__pyx_kp_s_active_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_n_s_activecnt;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_n_s_after;
static PyObject *__pyx_n_s_all;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_kp_s_args_r;
static PyObject *__pyx_n_s_backend;
static PyObject *__pyx_n_s_basestring;
static PyObject *__pyx_n_s_builtins;
static PyObject *__pyx_n_s_callback;
static PyObject *__pyx_kp_s_callback_must_be_callable_not_No;
static PyObject *__pyx_kp_s_callback_r;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_kp_s_child_watchers_are_only_availabl;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_context;
static PyObject *__pyx_n_s_decode;
static PyObject *__pyx_n_s_default;
static PyObject *__pyx_kp_s_default_2;
static PyObject *__pyx_n_s_default_handle_error;
static PyObject *__pyx_n_s_destroyed;
static PyObject *__pyx_n_s_embeddable_backends;
static PyObject *__pyx_n_s_encode;
static PyObject *__pyx_n_s_epoll;
static PyObject *__pyx_n_s_errno;
static PyObject *__pyx_kp_s_ev_default_loop_s_failed;
static PyObject *__pyx_kp_s_ev_loop_new_s_failed;
static PyObject *__pyx_n_s_events;
static PyObject *__pyx_n_s_events_2;
static PyObject *__pyx_n_s_events_str;
static PyObject *__pyx_n_s_fd;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_kp_s_fd_must_be_non_negative_r;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_fd_s_events_s;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_n_s_fileno;
static PyObject *__pyx_kp_s_fileno_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_n_s_flags;
static PyObject *__pyx_n_s_flags_2;
static PyObject *__pyx_n_s_flags_str2int;
static PyObject *__pyx_n_s_forkcheck;
static PyObject *__pyx_n_s_format;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_n_s_format_details;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_n_s_func;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get_header_version;
static PyObject *__pyx_n_s_get_version;
static PyObject *__pyx_n_s_getfilesystemencoding;
static PyObject *__pyx_kp_s_gevent_core_EVENTS;
static PyObject *__pyx_n_s_gevent_corecext;
static PyObject *__pyx_n_s_handle_error;
static PyObject *__pyx_n_s_handle_syserr;
static PyObject *__pyx_n_s_hex;
static PyObject *__pyx_n_s_how;
static PyObject *__pyx_n_s_id;
static PyObject *__pyx_kp_s_illegal_event_mask_r;
static PyObject *__pyx_kp_s_illegal_signal_number_r;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_interval;
static PyObject *__pyx_kp_s_io_watcher_attribute_events_is;
static PyObject *__pyx_kp_s_io_watcher_attribute_fd_is_read;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kqueue;
static PyObject *__pyx_n_s_level;
static PyObject *__pyx_kp_s_libev_d_02d;
static PyObject *__pyx_n_s_loop;
static PyObject *__pyx_n_s_lower;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_message;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_noenv;
static PyObject *__pyx_n_s_noinotify;
static PyObject *__pyx_n_s_nosigmask;
static PyObject *__pyx_n_s_nowait;
static PyObject *__pyx_n_s_once;
static PyObject *__pyx_kp_s_operation_on_destroyed_loop;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_pass_events;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pending;
static PyObject *__pyx_kp_s_pending_2;
static PyObject *__pyx_kp_s_pending_s;
static PyObject *__pyx_n_s_pendingcnt;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_n_s_pid;
static PyObject *__pyx_kp_s_pid_r_rstatus_r;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_n_s_poll;
static PyObject *__pyx_n_s_port;
static PyObject *__pyx_n_s_print_exc;
static PyObject *__pyx_n_s_print_exception;
static PyObject *__pyx_n_s_priority;
static PyObject *__pyx_kp_s_private_tmp_gevent_python2_7_ge;
static PyObject *__pyx_n_s_ptr;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_recommended_backends;
static PyObject *__pyx_n_s_ref;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_ref_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_n_s_repeat;
static PyObject *__pyx_kp_s_repeat_must_be_positive_or_zero;
static PyObject *__pyx_n_s_revents;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_n_s_rstatus;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_s_at_0x_x_s;
static PyObject *__pyx_kp_s_s_at_0x_x_s_2;
static PyObject *__pyx_n_s_select;
static PyObject *__pyx_n_s_send;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_n_s_sigfd;
static PyObject *__pyx_kp_s_sigfd_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_n_s_signal;
static PyObject *__pyx_n_s_signalfd;
static PyObject *__pyx_n_s_signalmodule;
static PyObject *__pyx_n_s_signalnum;
static PyObject *__pyx_n_s_signum;
static PyObject *__pyx_n_s_split;
static PyObject *__pyx_n_s_stop_watchers;
static PyObject *__pyx_kp_s_stopped;
static PyObject *__pyx_n_s_strerror;
static PyObject *__pyx_n_s_strip;
static PyObject *__pyx_n_s_supported_backends;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_tb;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_n_s_trace;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_n_s_traceback;
static PyObject *__pyx_n_s_type;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_pf_6gevent_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_8corecext__EVENTSType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4loop___init__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, size_t __pyx_v_ptr); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_2_stop_watchers(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static void __pyx_pf_6gevent_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_26now(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_28update(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_10pendingcnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_pf_6gevent_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_46async(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_52stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_54run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_56_format(struct PyGeventLoopObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_48stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_50run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_52_format(struct PyGeventLoopObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_58_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_60fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_54_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_56fileno(struct PyGeventLoopObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_11sig_pending___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_13origflags_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_pf_6gevent_8corecext_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7watcher___repr__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7watcher_2_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_3ref___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_3ref_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_8callback___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_8callback_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_stop(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_8priority___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_8priority_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_2feed(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_4start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_6active___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_7pending___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static int __pyx_pf_6gevent_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static int __pyx_pf_6gevent_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_pf_6gevent_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static int __pyx_pf_6gevent_8corecext_2io_10__cinit__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static void __pyx_pf_6gevent_8corecext_2io_12__dealloc__(struct PyGeventIOObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_pf_6gevent_8corecext_2io_4loop___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_4loop_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_4loop_4__del__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_4args___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_4args_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_2io_4args_4__del__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_2io_6_flags___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_3ref___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5timer_3ref_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_8callback___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5timer_8callback_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_stop(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_8priority___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5timer_8priority_2__set__(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_2feed(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_6active___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_7pending___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5timer_6__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_8again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_4loop___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5timer_4loop_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_5timer_4loop_4__del__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_4args___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5timer_4args_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_5timer_4args_4__del__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5timer_6_flags___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_3ref___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_6signal_3ref_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_8callback___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_6signal_8callback_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_stop(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_8priority___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_6signal_8priority_2__set__(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_2feed(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_4start(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_6active___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_7pending___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_6signal_6__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_4loop___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_6signal_4loop_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_6signal_4loop_4__del__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_4args___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_6signal_4args_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_6signal_4args_4__del__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_6signal_6_flags___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_3ref___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4idle_3ref_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_8callback___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4idle_8callback_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_stop(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_8priority___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4idle_8priority_2__set__(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_2feed(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_4start(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_6active___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_7pending___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4idle_6__init__(struct PyGeventIdleObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_4loop___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4idle_4loop_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_4idle_4loop_4__del__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_4args___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4idle_4args_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_4idle_4args_4__del__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4idle_6_flags___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_3ref___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_7prepare_3ref_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_8callback___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_7prepare_8callback_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_stop(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_8priority___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_7prepare_8priority_2__set__(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_2feed(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_4start(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_6active___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_7pending___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_7prepare_6__init__(struct PyGeventPrepareObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_4loop___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_7prepare_4loop_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_7prepare_4loop_4__del__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_4args___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_7prepare_4args_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_7prepare_4args_4__del__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_7prepare_6_flags___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_3ref___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5check_3ref_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_8callback___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5check_8callback_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_stop(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_8priority___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5check_8priority_2__set__(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_2feed(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_4start(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_6active___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_7pending___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5check_6__init__(struct PyGeventCheckObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_4loop___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5check_4loop_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_5check_4loop_4__del__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_4args___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5check_4args_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_5check_4args_4__del__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5check_6_flags___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_3ref___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4fork_3ref_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_8callback___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4fork_8callback_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_stop(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_8priority___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4fork_8priority_2__set__(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_2feed(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_4start(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_6active___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_7pending___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4fork_6__init__(struct PyGeventForkObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_4loop___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4fork_4loop_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_4fork_4loop_4__del__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_4args___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4fork_4args_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_4fork_4args_4__del__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4fork_6_flags___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_3ref___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5async_3ref_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_8callback___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5async_8callback_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_stop(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_8priority___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5async_8priority_2__set__(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_2feed(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_4start(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_6active___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_7pending___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5async_6__init__(struct PyGeventAsyncObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_8send(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_4loop___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5async_4loop_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_5async_4loop_4__del__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_4args___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5async_4args_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_5async_4args_4__del__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5async_6_flags___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_5child_3ref___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_3ref_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_8callback___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_8callback_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_stop(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_8priority___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_8priority_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_2feed(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_4start(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_6active___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_7pending___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_6__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_8_format(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_4loop___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_4loop_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_4loop_4__del__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_4args___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_4args_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_5child_4args_4__del__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_5child_6_flags___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_pf_6gevent_8corecext_4stat_3ref___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4stat_3ref_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_8callback___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4stat_8callback_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_stop(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_8priority___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4stat_8priority_2__set__(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_2feed(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_4start(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_6active___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_7pending___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4stat_6__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_4loop___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4stat_4loop_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_4stat_4loop_4__del__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_4args___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_8corecext_4stat_4args_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_8corecext_4stat_4args_4__del__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_6_flags___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_4stat_6_paths___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_tp_new_6gevent_8corecext__EVENTSType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_loop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_callback(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_watcher(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext_async(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_tp_new_6gevent_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_tp_new_6gevent_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_3;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_int_neg_1;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static int __pyx_k__9;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__8;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_tuple__26;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_tuple__27;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD)
static PyObject *__pyx_tuple__28;
#endif /* (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_tuple__90;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_codeobj__90;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__92;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__94;
static PyObject *__pyx_codeobj__95;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_codeobj__96;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_codeobj__97;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_tuple__97;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_codeobj__98;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_codeobj__86;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__88;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__90;
static PyObject *__pyx_codeobj__91;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_codeobj__99;
static PyObject *__pyx_codeobj__100;
static PyObject *__pyx_codeobj__101;
static PyObject *__pyx_codeobj__102;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_codeobj__103;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_gb_6gevent_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

/* "gevent/corecext.pyx":121
 *
 *
 * _flags_str2int = dict((string, flag) for (flag, string) in _flags)             # <<<<<<<<<<<<<<
 *
 *
 */

static PyObject *__pyx_pf_6gevent_8corecext_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *)__pyx_tp_new_6gevent_8corecext___pyx_scope_struct__genexpr(__pyx_ptype_6gevent_8corecext___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_6gevent_8corecext_24generator, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_genexpr); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.corecext.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6gevent_8corecext_24generator(__pyx_CoroutineObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("None", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = PyDict_New(); if (unlikely(!__pyx_r)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_r);
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_flag);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_flag, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_string);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_string, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    __pyx_t_6 = 0;
    if (unlikely(PyDict_SetItem(__pyx_r, (PyObject*)__pyx_cur_scope->__pyx_v_string, (PyObject*)__pyx_cur_scope->__pyx_v_flag))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
PyObject *GEVENT_CORE_EVENTS = 0;

/* "gevent/corecext.pyx":92
 * cdef class _EVENTSType:
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'gevent.core.EVENTS'
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_11_EVENTSType_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_11_EVENTSType___repr__(((struct __pyx_obj_6gevent_8corecext__EVENTSType *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_8corecext__EVENTSType *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__", 0);

/* "gevent/corecext.pyx":93
 *
 *     def __repr__(self):
 *         return 'gevent.core.EVENTS'             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_kp_s_gevent_core_EVENTS);
  __pyx_r = __pyx_kp_s_gevent_core_EVENTS;
  goto __pyx_L0;

/* "gevent/corecext.pyx":92
 * cdef class _EVENTSType:
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return 'gevent.core.EVENTS'
 *
 */

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

/* "gevent/corecext.pyx":100
 *
 *
 * def get_version():             # <<<<<<<<<<<<<<
 *     return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor())
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_8corecext_1get_version = {"get_version", (PyCFunction)__pyx_pw_6gevent_8corecext_1get_version, METH_NOARGS, 0};
static PyObject *__pyx_pw_6gevent_8corecext_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_version (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_get_version(__pyx_self);

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

static PyObject *__pyx_pf_6gevent_8corecext_get_version(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_version", 0);

/* "gevent/corecext.pyx":101
 *
 * def get_version():
 *     return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor())             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_version_major()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(ev_version_minor()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":100
 *
 *
 * def get_version():             # <<<<<<<<<<<<<<
 *     return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor())
 *
 */

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

/* "gevent/corecext.pyx":104
 *
 *
 * def get_header_version():             # <<<<<<<<<<<<<<
 *     return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_8corecext_3get_header_version = {"get_header_version", (PyCFunction)__pyx_pw_6gevent_8corecext_3get_header_version, METH_NOARGS, 0};
static PyObject *__pyx_pw_6gevent_8corecext_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_header_version (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2get_header_version(__pyx_self);

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

static PyObject *__pyx_pf_6gevent_8corecext_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("get_header_version", 0);

/* "gevent/corecext.pyx":105
 *
 * def get_header_version():
 *     return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR)             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(EV_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_VERSION_MINOR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_libev_d_02d, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":104
 *
 *
 * def get_header_version():             # <<<<<<<<<<<<<<
 *     return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR)
 *
 */

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

/* "gevent/corecext.pyx":142
 *
 *
 * cpdef _flags_to_list(unsigned int flags):             # <<<<<<<<<<<<<<
 *     cdef list result = []
 *     for code, value in _flags:
 */

static PyObject *__pyx_pw_6gevent_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext__flags_to_list(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_code = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  unsigned int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_flags_to_list", 0);

/* "gevent/corecext.pyx":143
 *
 * cpdef _flags_to_list(unsigned int flags):
 *     cdef list result = []             # <<<<<<<<<<<<<<
 *     for code, value in _flags:
 *         if flags & code:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

/* "gevent/corecext.pyx":144
 * cpdef _flags_to_list(unsigned int flags):
 *     cdef list result = []
 *     for code, value in _flags:             # <<<<<<<<<<<<<<
 *         if flags & code:
 *             result.append(value)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_code, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
    __pyx_t_6 = 0;

/* "gevent/corecext.pyx":145
 *     cdef list result = []
 *     for code, value in _flags:
 *         if flags & code:             # <<<<<<<<<<<<<<
 *             result.append(value)
 *         flags &= ~code
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_And(__pyx_t_1, __pyx_v_code); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_9) {

/* "gevent/corecext.pyx":146
 *     for code, value in _flags:
 *         if flags & code:
 *             result.append(value)             # <<<<<<<<<<<<<<
 *         flags &= ~code
 *         if not flags:
 */
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_value); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":145
 *     cdef list result = []
 *     for code, value in _flags:
 *         if flags & code:             # <<<<<<<<<<<<<<
 *             result.append(value)
 *         flags &= ~code
 */
    }

/* "gevent/corecext.pyx":147
 *         if flags & code:
 *             result.append(value)
 *         flags &= ~code             # <<<<<<<<<<<<<<
 *         if not flags:
 *             break
 */
    __pyx_t_6 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_1 = PyNumber_Invert(__pyx_v_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_InPlaceAnd(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_flags = __pyx_t_11;

/* "gevent/corecext.pyx":148
 *             result.append(value)
 *         flags &= ~code
 *         if not flags:             # <<<<<<<<<<<<<<
 *             break
 *     if flags:
 */
    __pyx_t_9 = ((!(__pyx_v_flags != 0)) != 0);
    if (__pyx_t_9) {

/* "gevent/corecext.pyx":149
 *         flags &= ~code
 *         if not flags:
 *             break             # <<<<<<<<<<<<<<
 *     if flags:
 *         result.append(flags)
 */
      goto __pyx_L4_break;

/* "gevent/corecext.pyx":148
 *             result.append(value)
 *         flags &= ~code
 *         if not flags:             # <<<<<<<<<<<<<<
 *             break
 *     if flags:
 */
    }

/* "gevent/corecext.pyx":144
 * cpdef _flags_to_list(unsigned int flags):
 *     cdef list result = []
 *     for code, value in _flags:             # <<<<<<<<<<<<<<
 *         if flags & code:
 *             result.append(value)
 */
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":150
 *         if not flags:
 *             break
 *     if flags:             # <<<<<<<<<<<<<<
 *         result.append(flags)
 *     return result
 */
  __pyx_t_9 = (__pyx_v_flags != 0);
  if (__pyx_t_9) {

/* "gevent/corecext.pyx":151
 *             break
 *     if flags:
 *         result.append(flags)             # <<<<<<<<<<<<<<
 *     return result
 *
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":150
 *         if not flags:
 *             break
 *     if flags:             # <<<<<<<<<<<<<<
 *         result.append(flags)
 *     return result
 */
  }

/* "gevent/corecext.pyx":152
 *     if flags:
 *         result.append(flags)
 *     return result             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

/* "gevent/corecext.pyx":142
 *
 *
 * cpdef _flags_to_list(unsigned int flags):             # <<<<<<<<<<<<<<
 *     cdef list result = []
 *     for code, value in _flags:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gevent.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_code);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags) {
  unsigned int __pyx_v_flags;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_flags_to_list (wrapper)", 0);
  assert(__pyx_arg_flags); {
    __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4_flags_to_list(__pyx_self, ((unsigned int)__pyx_v_flags));

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

static PyObject *__pyx_pf_6gevent_8corecext_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_flags_to_list", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __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.corecext._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":161
 *
 *
 * cpdef unsigned int _flags_to_int(object flags) except? -1:             # <<<<<<<<<<<<<<
 *     # Note, that order does not matter, libev has its own predefined order
 *     if not flags:
 */

static PyObject *__pyx_pw_6gevent_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/
static unsigned int __pyx_f_6gevent_8corecext__flags_to_int(PyObject *__pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
  unsigned int __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_v_ex = NULL;
  unsigned int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  int __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_flags_to_int", 0);
  __Pyx_INCREF(__pyx_v_flags);

/* "gevent/corecext.pyx":163
 * cpdef unsigned int _flags_to_int(object flags) except? -1:
 *     # Note, that order does not matter, libev has its own predefined order
 *     if not flags:             # <<<<<<<<<<<<<<
 *         return 0
 *     if isinstance(flags, integer_types):
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":164
 *     # Note, that order does not matter, libev has its own predefined order
 *     if not flags:
 *         return 0             # <<<<<<<<<<<<<<
 *     if isinstance(flags, integer_types):
 *         return flags
 */
    __pyx_r = 0;
    goto __pyx_L0;

/* "gevent/corecext.pyx":163
 * cpdef unsigned int _flags_to_int(object flags) except? -1:
 *     # Note, that order does not matter, libev has its own predefined order
 *     if not flags:             # <<<<<<<<<<<<<<
 *         return 0
 *     if isinstance(flags, integer_types):
 */
  }

/* "gevent/corecext.pyx":165
 *     if not flags:
 *         return 0
 *     if isinstance(flags, integer_types):             # <<<<<<<<<<<<<<
 *         return flags
 *     cdef unsigned int result = 0
 */
  __pyx_t_3 = __pyx_v_6gevent_8corecext_integer_types;
  __Pyx_INCREF(__pyx_t_3);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":166
 *         return 0
 *     if isinstance(flags, integer_types):
 *         return flags             # <<<<<<<<<<<<<<
 *     cdef unsigned int result = 0
 *     try:
 */
    __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_v_flags); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_t_4;
    goto __pyx_L0;

/* "gevent/corecext.pyx":165
 *     if not flags:
 *         return 0
 *     if isinstance(flags, integer_types):             # <<<<<<<<<<<<<<
 *         return flags
 *     cdef unsigned int result = 0
 */
  }

/* "gevent/corecext.pyx":167
 *     if isinstance(flags, integer_types):
 *         return flags
 *     cdef unsigned int result = 0             # <<<<<<<<<<<<<<
 *     try:
 *         if isinstance(flags, basestring):
 */
  __pyx_v_result = 0;

/* "gevent/corecext.pyx":168
 *         return flags
 *     cdef unsigned int result = 0
 *     try:             # <<<<<<<<<<<<<<
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

/* "gevent/corecext.pyx":169
 *     cdef unsigned int result = 0
 *     try:
 *         if isinstance(flags, basestring):             # <<<<<<<<<<<<<<
 *             flags = flags.split(',')
 *         for value in flags:
 */
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_basestring); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyObject_IsInstance(__pyx_v_flags, __pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_2 = (__pyx_t_1 != 0);
      if (__pyx_t_2) {

/* "gevent/corecext.pyx":170
 *     try:
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')             # <<<<<<<<<<<<<<
 *         for value in flags:
 *             value = value.strip().lower()
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_flags, __pyx_n_s_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_8);
        __pyx_t_8 = 0;

/* "gevent/corecext.pyx":169
 *     cdef unsigned int result = 0
 *     try:
 *         if isinstance(flags, basestring):             # <<<<<<<<<<<<<<
 *             flags = flags.split(',')
 *         for value in flags:
 */
      }

/* "gevent/corecext.pyx":171
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')
 *         for value in flags:             # <<<<<<<<<<<<<<
 *             value = value.strip().lower()
 *             if value:
 */
      if (likely(PyList_CheckExact(__pyx_v_flags)) || PyTuple_CheckExact(__pyx_v_flags)) {
        __pyx_t_8 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_8); __pyx_t_9 = 0;
        __pyx_t_10 = NULL;
      } else {
        __pyx_t_9 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_10 = Py_TYPE(__pyx_t_8)->tp_iternext; if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      }
      for (;;) {
        if (likely(!__pyx_t_10)) {
          if (likely(PyList_CheckExact(__pyx_t_8))) {
            if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_3 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          } else {
            if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
            #if CYTHON_COMPILING_IN_CPYTHON
            __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_9); __Pyx_INCREF(__pyx_t_3); __pyx_t_9++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            #else
            __pyx_t_3 = PySequence_ITEM(__pyx_t_8, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            __Pyx_GOTREF(__pyx_t_3);
            #endif
          }
        } else {
          __pyx_t_3 = __pyx_t_10(__pyx_t_8);
          if (unlikely(!__pyx_t_3)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_3);
        }
        __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_3);
        __pyx_t_3 = 0;

/* "gevent/corecext.pyx":172
 *             flags = flags.split(',')
 *         for value in flags:
 *             value = value.strip().lower()             # <<<<<<<<<<<<<<
 *             if value:
 *                 result |= _flags_str2int[value]
 */
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_strip); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        if (__pyx_t_13) {
          __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        } else {
          __pyx_t_11 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        }
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_lower); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_12))) {
          __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
          if (likely(__pyx_t_11)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
            __Pyx_INCREF(__pyx_t_11);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_12, function);
          }
        }
        if (__pyx_t_11) {
          __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        } else {
          __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_12); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        }
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_3);
        __pyx_t_3 = 0;

/* "gevent/corecext.pyx":173
 *         for value in flags:
 *             value = value.strip().lower()
 *             if value:             # <<<<<<<<<<<<<<
 *                 result |= _flags_str2int[value]
 *     except KeyError as ex:
 */
        __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        if (__pyx_t_2) {

/* "gevent/corecext.pyx":174
 *             value = value.strip().lower()
 *             if value:
 *                 result |= _flags_str2int[value]             # <<<<<<<<<<<<<<
 *     except KeyError as ex:
 *         raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys()))))
 */
          __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_result); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_11 = PyObject_GetItem(__pyx_t_12, __pyx_v_value); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L5_error;};
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PyNumber_InPlaceOr(__pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_4 = __Pyx_PyInt_As_unsigned_int(__pyx_t_12); if (unlikely((__pyx_t_4 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_v_result = __pyx_t_4;

/* "gevent/corecext.pyx":173
 *         for value in flags:
 *             value = value.strip().lower()
 *             if value:             # <<<<<<<<<<<<<<
 *                 result |= _flags_str2int[value]
 *     except KeyError as ex:
 */
        }

/* "gevent/corecext.pyx":171
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')
 *         for value in flags:             # <<<<<<<<<<<<<<
 *             value = value.strip().lower()
 *             if value:
 */
      }
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

/* "gevent/corecext.pyx":168
 *         return flags
 *     cdef unsigned int result = 0
 *     try:             # <<<<<<<<<<<<<<
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

/* "gevent/corecext.pyx":175
 *             if value:
 *                 result |= _flags_str2int[value]
 *     except KeyError as ex:             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys()))))
 *     return result
 */
    __pyx_t_14 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_14) {
      __Pyx_AddTraceback("gevent.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_12, &__pyx_t_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_INCREF(__pyx_t_12);
      __pyx_v_ex = __pyx_t_12;

/* "gevent/corecext.pyx":176
 *                 result |= _flags_str2int[value]
 *     except KeyError as ex:
 *         raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys()))))             # <<<<<<<<<<<<<<
 *     return result
 *
 */
      __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags_str2int); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = __Pyx_PyObject_GetAttrStr(__pyx_t_15, __pyx_n_s_keys); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __pyx_t_15 = NULL;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_16))) {
        __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_16);
        if (likely(__pyx_t_15)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_16);
          __Pyx_INCREF(__pyx_t_15);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_16, function);
        }
      }
      if (__pyx_t_15) {
        __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_16, __pyx_t_15); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      } else {
        __pyx_t_13 = __Pyx_PyObject_CallNoArg(__pyx_t_16); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      }
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = PySequence_List(__pyx_t_13); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_3 = ((PyObject*)__pyx_t_16);
      __pyx_t_16 = 0;
      __pyx_t_17 = PyList_Sort(__pyx_t_3); if (unlikely(__pyx_t_17 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __pyx_t_16 = __Pyx_PyString_Join(__pyx_kp_s__3, __pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_v_ex);
      __Pyx_GIVEREF(__pyx_v_ex);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ex);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_16);
      __pyx_t_16 = 0;
      __pyx_t_16 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_t_3); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_16);
      __pyx_t_16 = 0;
      __pyx_t_16 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_16, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
    }
    goto __pyx_L7_except_error;
    __pyx_L7_except_error:;

/* "gevent/corecext.pyx":168
 *         return flags
 *     cdef unsigned int result = 0
 *     try:             # <<<<<<<<<<<<<<
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L12_try_end:;
  }

/* "gevent/corecext.pyx":177
 *     except KeyError as ex:
 *         raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys()))))
 *     return result             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

/* "gevent/corecext.pyx":161
 *
 *
 * cpdef unsigned int _flags_to_int(object flags) except? -1:             # <<<<<<<<<<<<<<
 *     # Note, that order does not matter, libev has its own predefined order
 *     if not flags:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("gevent.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_ex);
  __Pyx_XDECREF(__pyx_v_flags);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_flags_to_int (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6_flags_to_int(__pyx_self, ((PyObject *)__pyx_v_flags));

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

static PyObject *__pyx_pf_6gevent_8corecext_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_flags_to_int", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __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.corecext._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":180
 *
 *
 * cdef str _str_hex(object flag):             # <<<<<<<<<<<<<<
 *     if isinstance(flag, integer_types):
 *         return hex(flag)
 */

static PyObject *__pyx_f_6gevent_8corecext__str_hex(PyObject *__pyx_v_flag) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_str_hex", 0);

/* "gevent/corecext.pyx":181
 *
 * cdef str _str_hex(object flag):
 *     if isinstance(flag, integer_types):             # <<<<<<<<<<<<<<
 *         return hex(flag)
 *     return str(flag)
 */
  __pyx_t_1 = __pyx_v_6gevent_8corecext_integer_types;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_IsInstance(__pyx_v_flag, __pyx_t_1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":182
 * cdef str _str_hex(object flag):
 *     if isinstance(flag, integer_types):
 *         return hex(flag)             # <<<<<<<<<<<<<<
 *     return str(flag)
 *
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_flag);
    __Pyx_GIVEREF(__pyx_v_flag);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_flag);
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_hex, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L0;

/* "gevent/corecext.pyx":181
 *
 * cdef str _str_hex(object flag):
 *     if isinstance(flag, integer_types):             # <<<<<<<<<<<<<<
 *         return hex(flag)
 *     return str(flag)
 */
  }

/* "gevent/corecext.pyx":183
 *     if isinstance(flag, integer_types):
 *         return hex(flag)
 *     return str(flag)             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_flag);
  __Pyx_GIVEREF(__pyx_v_flag);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_flag);
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)(&PyString_Type)), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":180
 *
 *
 * cdef str _str_hex(object flag):             # <<<<<<<<<<<<<<
 *     if isinstance(flag, integer_types):
 *         return hex(flag)
 */

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

/* "gevent/corecext.pyx":186
 *
 *
 * cpdef _check_flags(unsigned int flags):             # <<<<<<<<<<<<<<
 *     cdef list as_list
 *     flags &= libev.EVBACKEND_MASK
 */

static PyObject *__pyx_pw_6gevent_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext__check_flags(unsigned int __pyx_v_flags, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_as_list = 0;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_flags", 0);

/* "gevent/corecext.pyx":188
 * cpdef _check_flags(unsigned int flags):
 *     cdef list as_list
 *     flags &= libev.EVBACKEND_MASK             # <<<<<<<<<<<<<<
 *     if not flags:
 *         return
 */
  __pyx_v_flags = (__pyx_v_flags & EVBACKEND_MASK);

/* "gevent/corecext.pyx":189
 *     cdef list as_list
 *     flags &= libev.EVBACKEND_MASK
 *     if not flags:             # <<<<<<<<<<<<<<
 *         return
 *     if not (flags & libev.EVBACKEND_ALL):
 */
  __pyx_t_1 = ((!(__pyx_v_flags != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":190
 *     flags &= libev.EVBACKEND_MASK
 *     if not flags:
 *         return             # <<<<<<<<<<<<<<
 *     if not (flags & libev.EVBACKEND_ALL):
 *         raise ValueError('Invalid value for backend: 0x%x' % flags)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

/* "gevent/corecext.pyx":189
 *     cdef list as_list
 *     flags &= libev.EVBACKEND_MASK
 *     if not flags:             # <<<<<<<<<<<<<<
 *         return
 *     if not (flags & libev.EVBACKEND_ALL):
 */
  }

/* "gevent/corecext.pyx":191
 *     if not flags:
 *         return
 *     if not (flags & libev.EVBACKEND_ALL):             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid value for backend: 0x%x' % flags)
 *     if not (flags & libev.ev_supported_backends()):
 */
  __pyx_t_1 = ((!((__pyx_v_flags & EVBACKEND_ALL) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":192
 *         return
 *     if not (flags & libev.EVBACKEND_ALL):
 *         raise ValueError('Invalid value for backend: 0x%x' % flags)             # <<<<<<<<<<<<<<
 *     if not (flags & libev.ev_supported_backends()):
 *         as_list = [_str_hex(x) for x in _flags_to_list(flags)]
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":191
 *     if not flags:
 *         return
 *     if not (flags & libev.EVBACKEND_ALL):             # <<<<<<<<<<<<<<
 *         raise ValueError('Invalid value for backend: 0x%x' % flags)
 *     if not (flags & libev.ev_supported_backends()):
 */
  }

/* "gevent/corecext.pyx":193
 *     if not (flags & libev.EVBACKEND_ALL):
 *         raise ValueError('Invalid value for backend: 0x%x' % flags)
 *     if not (flags & libev.ev_supported_backends()):             # <<<<<<<<<<<<<<
 *         as_list = [_str_hex(x) for x in _flags_to_list(flags)]
 *         raise ValueError('Unsupported backend: %s' % '|'.join(as_list))
 */
  __pyx_t_1 = ((!((__pyx_v_flags & ev_supported_backends()) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":194
 *         raise ValueError('Invalid value for backend: 0x%x' % flags)
 *     if not (flags & libev.ev_supported_backends()):
 *         as_list = [_str_hex(x) for x in _flags_to_list(flags)]             # <<<<<<<<<<<<<<
 *         raise ValueError('Unsupported backend: %s' % '|'.join(as_list))
 *
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_6gevent_8corecext__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
      __pyx_t_6 = NULL;
    } else {
      __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_6)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __pyx_f_6gevent_8corecext__str_hex(__pyx_v_x); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_as_list = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

/* "gevent/corecext.pyx":195
 *     if not (flags & libev.ev_supported_backends()):
 *         as_list = [_str_hex(x) for x in _flags_to_list(flags)]
 *         raise ValueError('Unsupported backend: %s' % '|'.join(as_list))             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyString_Join(__pyx_kp_s__4, __pyx_v_as_list); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Unsupported_backend_s, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":193
 *     if not (flags & libev.EVBACKEND_ALL):
 *         raise ValueError('Invalid value for backend: 0x%x' % flags)
 *     if not (flags & libev.ev_supported_backends()):             # <<<<<<<<<<<<<<
 *         as_list = [_str_hex(x) for x in _flags_to_list(flags)]
 *         raise ValueError('Unsupported backend: %s' % '|'.join(as_list))
 */
  }

/* "gevent/corecext.pyx":186
 *
 *
 * cpdef _check_flags(unsigned int flags):             # <<<<<<<<<<<<<<
 *     cdef list as_list
 *     flags &= libev.EVBACKEND_MASK
 */

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

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags) {
  unsigned int __pyx_v_flags;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_check_flags (wrapper)", 0);
  assert(__pyx_arg_flags); {
    __pyx_v_flags = __Pyx_PyInt_As_unsigned_int(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_8_check_flags(__pyx_self, ((unsigned int)__pyx_v_flags));

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

static PyObject *__pyx_pf_6gevent_8corecext_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_check_flags", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext__check_flags(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __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.corecext._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":198
 *
 *
 * cpdef _events_to_str(int events):             # <<<<<<<<<<<<<<
 *     cdef list result = []
 *     cdef int c_flag
 */

static PyObject *__pyx_pw_6gevent_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext__events_to_str(int __pyx_v_events, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_v_result = 0;
  int __pyx_v_c_flag;
  PyObject *__pyx_v_flag = NULL;
  PyObject *__pyx_v_string = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_events_to_str", 0);

/* "gevent/corecext.pyx":199
 *
 * cpdef _events_to_str(int events):
 *     cdef list result = []             # <<<<<<<<<<<<<<
 *     cdef int c_flag
 *     for (flag, string) in _events:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

/* "gevent/corecext.pyx":201
 *     cdef list result = []
 *     cdef int c_flag
 *     for (flag, string) in _events:             # <<<<<<<<<<<<<<
 *         c_flag = flag
 *         if events & c_flag:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_events); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
      PyObject* sequence = __pyx_t_1;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0);
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1);
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0);
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1);
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_flag, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_string, __pyx_t_6);
    __pyx_t_6 = 0;

/* "gevent/corecext.pyx":202
 *     cdef int c_flag
 *     for (flag, string) in _events:
 *         c_flag = flag             # <<<<<<<<<<<<<<
 *         if events & c_flag:
 *             result.append(string)
 */
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_c_flag = __pyx_t_9;

/* "gevent/corecext.pyx":203
 *     for (flag, string) in _events:
 *         c_flag = flag
 *         if events & c_flag:             # <<<<<<<<<<<<<<
 *             result.append(string)
 *             events = events & (~c_flag)
 */
    __pyx_t_10 = ((__pyx_v_events & __pyx_v_c_flag) != 0);
    if (__pyx_t_10) {

/* "gevent/corecext.pyx":204
 *         c_flag = flag
 *         if events & c_flag:
 *             result.append(string)             # <<<<<<<<<<<<<<
 *             events = events & (~c_flag)
 *         if not events:
 */
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_string); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":205
 *         if events & c_flag:
 *             result.append(string)
 *             events = events & (~c_flag)             # <<<<<<<<<<<<<<
 *         if not events:
 *             break
 */
      __pyx_v_events = (__pyx_v_events & (~__pyx_v_c_flag));

/* "gevent/corecext.pyx":203
 *     for (flag, string) in _events:
 *         c_flag = flag
 *         if events & c_flag:             # <<<<<<<<<<<<<<
 *             result.append(string)
 *             events = events & (~c_flag)
 */
    }

/* "gevent/corecext.pyx":206
 *             result.append(string)
 *             events = events & (~c_flag)
 *         if not events:             # <<<<<<<<<<<<<<
 *             break
 *     if events:
 */
    __pyx_t_10 = ((!(__pyx_v_events != 0)) != 0);
    if (__pyx_t_10) {

/* "gevent/corecext.pyx":207
 *             events = events & (~c_flag)
 *         if not events:
 *             break             # <<<<<<<<<<<<<<
 *     if events:
 *         result.append(hex(events))
 */
      goto __pyx_L4_break;

/* "gevent/corecext.pyx":206
 *             result.append(string)
 *             events = events & (~c_flag)
 *         if not events:             # <<<<<<<<<<<<<<
 *             break
 *     if events:
 */
    }

/* "gevent/corecext.pyx":201
 *     cdef list result = []
 *     cdef int c_flag
 *     for (flag, string) in _events:             # <<<<<<<<<<<<<<
 *         c_flag = flag
 *         if events & c_flag:
 */
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":208
 *         if not events:
 *             break
 *     if events:             # <<<<<<<<<<<<<<
 *         result.append(hex(events))
 *     return '|'.join(result)
 */
  __pyx_t_10 = (__pyx_v_events != 0);
  if (__pyx_t_10) {

/* "gevent/corecext.pyx":209
 *             break
 *     if events:
 *         result.append(hex(events))             # <<<<<<<<<<<<<<
 *     return '|'.join(result)
 *
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_hex, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":208
 *         if not events:
 *             break
 *     if events:             # <<<<<<<<<<<<<<
 *         result.append(hex(events))
 *     return '|'.join(result)
 */
  }

/* "gevent/corecext.pyx":210
 *     if events:
 *         result.append(hex(events))
 *     return '|'.join(result)             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyString_Join(__pyx_kp_s__4, __pyx_v_result); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":198
 *
 *
 * cpdef _events_to_str(int events):             # <<<<<<<<<<<<<<
 *     cdef list result = []
 *     cdef int c_flag
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gevent.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_flag);
  __Pyx_XDECREF(__pyx_v_string);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events) {
  int __pyx_v_events;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_events_to_str (wrapper)", 0);
  assert(__pyx_arg_events); {
    __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_10_events_to_str(__pyx_self, ((int)__pyx_v_events));

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

static PyObject *__pyx_pf_6gevent_8corecext_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_events_to_str", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext__events_to_str(__pyx_v_events, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __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.corecext._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":213
 *
 *
 * def supported_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_supported_backends())
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_8corecext_13supported_backends = {"supported_backends", (PyCFunction)__pyx_pw_6gevent_8corecext_13supported_backends, METH_NOARGS, 0};
static PyObject *__pyx_pw_6gevent_8corecext_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("supported_backends (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_12supported_backends(__pyx_self);

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

static PyObject *__pyx_pf_6gevent_8corecext_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("supported_backends", 0);

/* "gevent/corecext.pyx":214
 *
 * def supported_backends():
 *     return _flags_to_list(libev.ev_supported_backends())             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext__flags_to_list(ev_supported_backends(), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":213
 *
 *
 * def supported_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_supported_backends())
 *
 */

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

/* "gevent/corecext.pyx":217
 *
 *
 * def recommended_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_recommended_backends())
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_8corecext_15recommended_backends = {"recommended_backends", (PyCFunction)__pyx_pw_6gevent_8corecext_15recommended_backends, METH_NOARGS, 0};
static PyObject *__pyx_pw_6gevent_8corecext_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("recommended_backends (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_14recommended_backends(__pyx_self);

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

static PyObject *__pyx_pf_6gevent_8corecext_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("recommended_backends", 0);

/* "gevent/corecext.pyx":218
 *
 * def recommended_backends():
 *     return _flags_to_list(libev.ev_recommended_backends())             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext__flags_to_list(ev_recommended_backends(), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":217
 *
 *
 * def recommended_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_recommended_backends())
 *
 */

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

/* "gevent/corecext.pyx":221
 *
 *
 * def embeddable_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_embeddable_backends())
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_8corecext_17embeddable_backends = {"embeddable_backends", (PyCFunction)__pyx_pw_6gevent_8corecext_17embeddable_backends, METH_NOARGS, 0};
static PyObject *__pyx_pw_6gevent_8corecext_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("embeddable_backends (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_16embeddable_backends(__pyx_self);

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

static PyObject *__pyx_pf_6gevent_8corecext_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("embeddable_backends", 0);

/* "gevent/corecext.pyx":222
 *
 * def embeddable_backends():
 *     return _flags_to_list(libev.ev_embeddable_backends())             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext__flags_to_list(ev_embeddable_backends(), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":221
 *
 *
 * def embeddable_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_embeddable_backends())
 *
 */

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

/* "gevent/corecext.pyx":225
 *
 *
 * def time():             # <<<<<<<<<<<<<<
 *     return libev.ev_time()
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_8corecext_19time = {"time", (PyCFunction)__pyx_pw_6gevent_8corecext_19time, METH_NOARGS, 0};
static PyObject *__pyx_pw_6gevent_8corecext_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_18time(__pyx_self);

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

static PyObject *__pyx_pf_6gevent_8corecext_18time(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("time", 0);

/* "gevent/corecext.pyx":226
 *
 * def time():
 *     return libev.ev_time()             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(ev_time()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":225
 *
 *
 * def time():             # <<<<<<<<<<<<<<
 *     return libev.ev_time()
 *
 */

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

/* "gevent/corecext.pyx":249
 *
 *
 *     def __init__(self, object flags=None, object default=None, size_t ptr=0):             # <<<<<<<<<<<<<<
 *         cdef unsigned int c_flags
 *         cdef object old_handler = None
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4loop_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_4loop_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_flags = 0;
  PyObject *__pyx_v_default = 0;
  size_t __pyx_v_ptr;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_flags_2,&__pyx_n_s_default,&__pyx_n_s_ptr,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flags_2);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_default);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ptr);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_flags = values[0];
    __pyx_v_default = values[1];
    if (values[2]) {
      __pyx_v_ptr = __Pyx_PyInt_As_size_t(values[2]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_ptr = ((size_t)0);
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop___init__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr);

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

static int __pyx_pf_6gevent_8corecext_4loop___init__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_flags, PyObject *__pyx_v_default, size_t __pyx_v_ptr) {
  unsigned int __pyx_v_c_flags;
  CYTHON_UNUSED PyObject *__pyx_v_old_handler = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  unsigned int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_default);

/* "gevent/corecext.pyx":251
 *     def __init__(self, object flags=None, object default=None, size_t ptr=0):
 *         cdef unsigned int c_flags
 *         cdef object old_handler = None             # <<<<<<<<<<<<<<
 *         libev.ev_prepare_init(&self._prepare, <void*>gevent_run_callbacks)
 *
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_old_handler = Py_None;

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":252
 *         cdef unsigned int c_flags
 *         cdef object old_handler = None
 *         libev.ev_prepare_init(&self._prepare, <void*>gevent_run_callbacks)             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":252
 *         cdef unsigned int c_flags
 *         cdef object old_handler = None
 *         libev.ev_prepare_init(&self._prepare, <void*>gevent_run_callbacks)             # <<<<<<<<<<<<<<
 *
 *         libev.ev_timer_init(&self._periodic_signal_checker, <void*>gevent_periodic_signal_check, 0.3, 0.3)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  ev_prepare_init((&__pyx_v_self->_prepare), ((void *)gevent_run_callbacks));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":256
 *
 *
 *         libev.ev_timer_init(&self._timer0, <void*>gevent_noop, 0.0, 0.0)             # <<<<<<<<<<<<<<
 *         if ptr:
 *             self._ptr = <libev.ev_loop*>ptr
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":254
 *         libev.ev_prepare_init(&self._prepare, <void*>gevent_run_callbacks)
 *
 *         libev.ev_timer_init(&self._periodic_signal_checker, <void*>gevent_periodic_signal_check, 0.3, 0.3)             # <<<<<<<<<<<<<<
 *
 *         libev.ev_timer_init(&self._timer0, <void*>gevent_noop, 0.0, 0.0)
 */
  ev_timer_init((&__pyx_v_self->_periodic_signal_checker), ((void *)gevent_periodic_signal_check), 0.3, 0.3);

/* "gevent/corecext.pyx":256
 *         libev.ev_timer_init(&self._periodic_signal_checker, <void*>gevent_periodic_signal_check, 0.3, 0.3)
 *
 *         libev.ev_timer_init(&self._timer0, <void*>gevent_noop, 0.0, 0.0)             # <<<<<<<<<<<<<<
 *         if ptr:
 *             self._ptr = <libev.ev_loop*>ptr
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  ev_timer_init((&__pyx_v_self->_timer0), ((void *)gevent_noop), 0.0, 0.0);

/* "gevent/corecext.pyx":257
 *
 *         libev.ev_timer_init(&self._timer0, <void*>gevent_noop, 0.0, 0.0)
 *         if ptr:             # <<<<<<<<<<<<<<
 *             self._ptr = <libev.ev_loop*>ptr
 *         else:
 */
  __pyx_t_1 = (__pyx_v_ptr != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":258
 *         libev.ev_timer_init(&self._timer0, <void*>gevent_noop, 0.0, 0.0)
 *         if ptr:
 *             self._ptr = <libev.ev_loop*>ptr             # <<<<<<<<<<<<<<
 *         else:
 *             c_flags = _flags_to_int(flags)
 */
    __pyx_v_self->_ptr = ((struct ev_loop *)__pyx_v_ptr);

/* "gevent/corecext.pyx":257
 *
 *         libev.ev_timer_init(&self._timer0, <void*>gevent_noop, 0.0, 0.0)
 *         if ptr:             # <<<<<<<<<<<<<<
 *             self._ptr = <libev.ev_loop*>ptr
 *         else:
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":260
 *             self._ptr = <libev.ev_loop*>ptr
 *         else:
 *             c_flags = _flags_to_int(flags)             # <<<<<<<<<<<<<<
 *             _check_flags(c_flags)
 *             c_flags |= libev.EVFLAG_NOENV
 */
  /*else*/ {
    __pyx_t_2 = __pyx_f_6gevent_8corecext__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_2 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_c_flags = __pyx_t_2;

/* "gevent/corecext.pyx":261
 *         else:
 *             c_flags = _flags_to_int(flags)
 *             _check_flags(c_flags)             # <<<<<<<<<<<<<<
 *             c_flags |= libev.EVFLAG_NOENV
 *             c_flags |= libev.EVFLAG_FORKCHECK
 */
    __pyx_t_3 = __pyx_f_6gevent_8corecext__check_flags(__pyx_v_c_flags, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

/* "gevent/corecext.pyx":262
 *             c_flags = _flags_to_int(flags)
 *             _check_flags(c_flags)
 *             c_flags |= libev.EVFLAG_NOENV             # <<<<<<<<<<<<<<
 *             c_flags |= libev.EVFLAG_FORKCHECK
 *             if default is None:
 */
    __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_NOENV);

/* "gevent/corecext.pyx":263
 *             _check_flags(c_flags)
 *             c_flags |= libev.EVFLAG_NOENV
 *             c_flags |= libev.EVFLAG_FORKCHECK             # <<<<<<<<<<<<<<
 *             if default is None:
 *                 default = True
 */
    __pyx_v_c_flags = (__pyx_v_c_flags | EVFLAG_FORKCHECK);

/* "gevent/corecext.pyx":264
 *             c_flags |= libev.EVFLAG_NOENV
 *             c_flags |= libev.EVFLAG_FORKCHECK
 *             if default is None:             # <<<<<<<<<<<<<<
 *                 default = True
 *                 if _default_loop_destroyed:
 */
    __pyx_t_1 = (__pyx_v_default == Py_None);
    __pyx_t_4 = (__pyx_t_1 != 0);
    if (__pyx_t_4) {

/* "gevent/corecext.pyx":265
 *             c_flags |= libev.EVFLAG_FORKCHECK
 *             if default is None:
 *                 default = True             # <<<<<<<<<<<<<<
 *                 if _default_loop_destroyed:
 *                     default = False
 */
      __Pyx_INCREF(Py_True);
      __Pyx_DECREF_SET(__pyx_v_default, Py_True);

/* "gevent/corecext.pyx":266
 *             if default is None:
 *                 default = True
 *                 if _default_loop_destroyed:             # <<<<<<<<<<<<<<
 *                     default = False
 *             if default:
 */
      __pyx_t_4 = (__pyx_v_6gevent_8corecext__default_loop_destroyed != 0);
      if (__pyx_t_4) {

/* "gevent/corecext.pyx":267
 *                 default = True
 *                 if _default_loop_destroyed:
 *                     default = False             # <<<<<<<<<<<<<<
 *             if default:
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)
 */
        __Pyx_INCREF(Py_False);
        __Pyx_DECREF_SET(__pyx_v_default, Py_False);

/* "gevent/corecext.pyx":266
 *             if default is None:
 *                 default = True
 *                 if _default_loop_destroyed:             # <<<<<<<<<<<<<<
 *                     default = False
 *             if default:
 */
      }

/* "gevent/corecext.pyx":264
 *             c_flags |= libev.EVFLAG_NOENV
 *             c_flags |= libev.EVFLAG_FORKCHECK
 *             if default is None:             # <<<<<<<<<<<<<<
 *                 default = True
 *                 if _default_loop_destroyed:
 */
    }

/* "gevent/corecext.pyx":268
 *                 if _default_loop_destroyed:
 *                     default = False
 *             if default:             # <<<<<<<<<<<<<<
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)
 *                 if not self._ptr:
 */
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

/* "gevent/corecext.pyx":269
 *                     default = False
 *             if default:
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)             # <<<<<<<<<<<<<<
 *                 if not self._ptr:
 *                     raise SystemError("ev_default_loop(%s) failed" % (c_flags, ))
 */
      __pyx_v_self->_ptr = gevent_ev_default_loop(__pyx_v_c_flags);

/* "gevent/corecext.pyx":270
 *             if default:
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)
 *                 if not self._ptr:             # <<<<<<<<<<<<<<
 *                     raise SystemError("ev_default_loop(%s) failed" % (c_flags, ))
 *
 */
      __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0);
      if (__pyx_t_4) {

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":271
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)
 *                 if not self._ptr:
 *                     raise SystemError("ev_default_loop(%s) failed" % (c_flags, ))             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":271
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)
 *                 if not self._ptr:
 *                     raise SystemError("ev_default_loop(%s) failed" % (c_flags, ))             # <<<<<<<<<<<<<<
 *
 *                 libev.ev_timer_start(self._ptr, &self._periodic_signal_checker)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
        __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_default_loop_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":270
 *             if default:
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)
 *                 if not self._ptr:             # <<<<<<<<<<<<<<
 *                     raise SystemError("ev_default_loop(%s) failed" % (c_flags, ))
 *
 */
      }
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))

/* "gevent/corecext.pyx":273
 *                     raise SystemError("ev_default_loop(%s) failed" % (c_flags, ))
 *
 *                 libev.ev_timer_start(self._ptr, &self._periodic_signal_checker)             # <<<<<<<<<<<<<<
 *                 libev.ev_unref(self._ptr)
 *
 */
      ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker));

/* "gevent/corecext.pyx":274
 *
 *                 libev.ev_timer_start(self._ptr, &self._periodic_signal_checker)
 *                 libev.ev_unref(self._ptr)             # <<<<<<<<<<<<<<
 *
 *             else:
 */
      ev_unref(__pyx_v_self->_ptr);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/corecext.pyx":268
 *                 if _default_loop_destroyed:
 *                     default = False
 *             if default:             # <<<<<<<<<<<<<<
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)
 *                 if not self._ptr:
 */
      goto __pyx_L6;
    }

/* "gevent/corecext.pyx":277
 *
 *             else:
 *                 self._ptr = libev.ev_loop_new(c_flags)             # <<<<<<<<<<<<<<
 *                 if not self._ptr:
 *                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))
 */
    /*else*/ {
      __pyx_v_self->_ptr = ev_loop_new(__pyx_v_c_flags);

/* "gevent/corecext.pyx":278
 *             else:
 *                 self._ptr = libev.ev_loop_new(c_flags)
 *                 if not self._ptr:             # <<<<<<<<<<<<<<
 *                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))
 *             if default or __SYSERR_CALLBACK is None:
 */
      __pyx_t_4 = ((!(__pyx_v_self->_ptr != 0)) != 0);
      if (__pyx_t_4) {

/* "gevent/corecext.pyx":279
 *                 self._ptr = libev.ev_loop_new(c_flags)
 *                 if not self._ptr:
 *                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))             # <<<<<<<<<<<<<<
 *             if default or __SYSERR_CALLBACK is None:
 *                 set_syserr_cb(self._handle_syserr)
 */
        __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_ev_loop_new_s_failed, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_t_3, 0, 0, 0);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":278
 *             else:
 *                 self._ptr = libev.ev_loop_new(c_flags)
 *                 if not self._ptr:             # <<<<<<<<<<<<<<
 *                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))
 *             if default or __SYSERR_CALLBACK is None:
 */
      }
    }
    __pyx_L6:;

/* "gevent/corecext.pyx":280
 *                 if not self._ptr:
 *                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))
 *             if default or __SYSERR_CALLBACK is None:             # <<<<<<<<<<<<<<
 *                 set_syserr_cb(self._handle_syserr)
 *             libev.ev_prepare_start(self._ptr, &self._prepare)
 */
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_1) {
    } else {
      __pyx_t_4 = __pyx_t_1;
      goto __pyx_L10_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = (__pyx_t_3 == Py_None);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = (__pyx_t_1 != 0);
    __pyx_t_4 = __pyx_t_6;
    __pyx_L10_bool_binop_done:;
    if (__pyx_t_4) {

/* "gevent/corecext.pyx":281
 *                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))
 *             if default or __SYSERR_CALLBACK is None:
 *                 set_syserr_cb(self._handle_syserr)             # <<<<<<<<<<<<<<
 *             libev.ev_prepare_start(self._ptr, &self._prepare)
 *             libev.ev_unref(self._ptr)
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __pyx_f_6gevent_8corecext_set_syserr_cb(__pyx_t_3, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

/* "gevent/corecext.pyx":280
 *                 if not self._ptr:
 *                     raise SystemError("ev_loop_new(%s) failed" % (c_flags, ))
 *             if default or __SYSERR_CALLBACK is None:             # <<<<<<<<<<<<<<
 *                 set_syserr_cb(self._handle_syserr)
 *             libev.ev_prepare_start(self._ptr, &self._prepare)
 */
    }

/* "gevent/corecext.pyx":282
 *             if default or __SYSERR_CALLBACK is None:
 *                 set_syserr_cb(self._handle_syserr)
 *             libev.ev_prepare_start(self._ptr, &self._prepare)             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self._ptr)
 *         self._callbacks = []
 */
    ev_prepare_start(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare));

/* "gevent/corecext.pyx":283
 *                 set_syserr_cb(self._handle_syserr)
 *             libev.ev_prepare_start(self._ptr, &self._prepare)
 *             libev.ev_unref(self._ptr)             # <<<<<<<<<<<<<<
 *         self._callbacks = []
 *
 */
    ev_unref(__pyx_v_self->_ptr);
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":284
 *             libev.ev_prepare_start(self._ptr, &self._prepare)
 *             libev.ev_unref(self._ptr)
 *         self._callbacks = []             # <<<<<<<<<<<<<<
 *
 *     cdef _run_callbacks(self):
 */
  __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_v_self->_callbacks);
  __Pyx_DECREF(__pyx_v_self->_callbacks);
  __pyx_v_self->_callbacks = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

/* "gevent/corecext.pyx":249
 *
 *
 *     def __init__(self, object flags=None, object default=None, size_t ptr=0):             # <<<<<<<<<<<<<<
 *         cdef unsigned int c_flags
 *         cdef object old_handler = None
 */

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

/* "gevent/corecext.pyx":286
 *         self._callbacks = []
 *
 *     cdef _run_callbacks(self):             # <<<<<<<<<<<<<<
 *         cdef callback cb
 *         cdef object callbacks
 */

static PyObject *__pyx_f_6gevent_8corecext_4loop__run_callbacks(struct PyGeventLoopObject *__pyx_v_self) {
  struct PyGeventCallbackObject *__pyx_v_cb = 0;
  PyObject *__pyx_v_callbacks = 0;
  int __pyx_v_count;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_run_callbacks", 0);

/* "gevent/corecext.pyx":289
 *         cdef callback cb
 *         cdef object callbacks
 *         cdef int count = 1000             # <<<<<<<<<<<<<<
 *         libev.ev_timer_stop(self._ptr, &self._timer0)
 *         while self._callbacks and count > 0:
 */
  __pyx_v_count = 0x3E8;

/* "gevent/corecext.pyx":290
 *         cdef object callbacks
 *         cdef int count = 1000
 *         libev.ev_timer_stop(self._ptr, &self._timer0)             # <<<<<<<<<<<<<<
 *         while self._callbacks and count > 0:
 *             callbacks = self._callbacks
 */
  ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0));

/* "gevent/corecext.pyx":291
 *         cdef int count = 1000
 *         libev.ev_timer_stop(self._ptr, &self._timer0)
 *         while self._callbacks and count > 0:             # <<<<<<<<<<<<<<
 *             callbacks = self._callbacks
 *             self._callbacks = []
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_self->_callbacks != Py_None) && (PyList_GET_SIZE(__pyx_v_self->_callbacks) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L5_bool_binop_done;
    }
    __pyx_t_2 = ((__pyx_v_count > 0) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L5_bool_binop_done:;
    if (!__pyx_t_1) break;

/* "gevent/corecext.pyx":292
 *         libev.ev_timer_stop(self._ptr, &self._timer0)
 *         while self._callbacks and count > 0:
 *             callbacks = self._callbacks             # <<<<<<<<<<<<<<
 *             self._callbacks = []
 *             for cb in callbacks:
 */
    __pyx_t_3 = __pyx_v_self->_callbacks;
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_callbacks, __pyx_t_3);
    __pyx_t_3 = 0;

/* "gevent/corecext.pyx":293
 *         while self._callbacks and count > 0:
 *             callbacks = self._callbacks
 *             self._callbacks = []             # <<<<<<<<<<<<<<
 *             for cb in callbacks:
 *                 libev.ev_unref(self._ptr)
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->_callbacks);
    __Pyx_DECREF(__pyx_v_self->_callbacks);
    __pyx_v_self->_callbacks = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

/* "gevent/corecext.pyx":294
 *             callbacks = self._callbacks
 *             self._callbacks = []
 *             for cb in callbacks:             # <<<<<<<<<<<<<<
 *                 libev.ev_unref(self._ptr)
 *                 gevent_call(self, cb)
 */
    if (likely(PyList_CheckExact(__pyx_v_callbacks)) || PyTuple_CheckExact(__pyx_v_callbacks)) {
      __pyx_t_3 = __pyx_v_callbacks; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_callbacks); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_6); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_5(__pyx_t_3);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_6gevent_8corecext_callback))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_XDECREF_SET(__pyx_v_cb, ((struct PyGeventCallbackObject *)__pyx_t_6));
      __pyx_t_6 = 0;

/* "gevent/corecext.pyx":295
 *             self._callbacks = []
 *             for cb in callbacks:
 *                 libev.ev_unref(self._ptr)             # <<<<<<<<<<<<<<
 *                 gevent_call(self, cb)
 *                 count -= 1
 */
      ev_unref(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":296
 *             for cb in callbacks:
 *                 libev.ev_unref(self._ptr)
 *                 gevent_call(self, cb)             # <<<<<<<<<<<<<<
 *                 count -= 1
 *         if self._callbacks:
 */
      gevent_call(__pyx_v_self, __pyx_v_cb);

/* "gevent/corecext.pyx":297
 *                 libev.ev_unref(self._ptr)
 *                 gevent_call(self, cb)
 *                 count -= 1             # <<<<<<<<<<<<<<
 *         if self._callbacks:
 *             libev.ev_timer_start(self._ptr, &self._timer0)
 */
      __pyx_v_count = (__pyx_v_count - 1);

/* "gevent/corecext.pyx":294
 *             callbacks = self._callbacks
 *             self._callbacks = []
 *             for cb in callbacks:             # <<<<<<<<<<<<<<
 *                 libev.ev_unref(self._ptr)
 *                 gevent_call(self, cb)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

/* "gevent/corecext.pyx":298
 *                 gevent_call(self, cb)
 *                 count -= 1
 *         if self._callbacks:             # <<<<<<<<<<<<<<
 *             libev.ev_timer_start(self._ptr, &self._timer0)
 *
 */
  __pyx_t_1 = (__pyx_v_self->_callbacks != Py_None) && (PyList_GET_SIZE(__pyx_v_self->_callbacks) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":299
 *                 count -= 1
 *         if self._callbacks:
 *             libev.ev_timer_start(self._ptr, &self._timer0)             # <<<<<<<<<<<<<<
 *
 *     def _stop_watchers(self):
 */
    ev_timer_start(__pyx_v_self->_ptr, (&__pyx_v_self->_timer0));

/* "gevent/corecext.pyx":298
 *                 gevent_call(self, cb)
 *                 count -= 1
 *         if self._callbacks:             # <<<<<<<<<<<<<<
 *             libev.ev_timer_start(self._ptr, &self._timer0)
 *
 */
  }

/* "gevent/corecext.pyx":286
 *         self._callbacks = []
 *
 *     cdef _run_callbacks(self):             # <<<<<<<<<<<<<<
 *         cdef callback cb
 *         cdef object callbacks
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gevent.corecext.loop._run_callbacks", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cb);
  __Pyx_XDECREF(__pyx_v_callbacks);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":301
 *             libev.ev_timer_start(self._ptr, &self._timer0)
 *
 *     def _stop_watchers(self):             # <<<<<<<<<<<<<<
 *         if libev.ev_is_active(&self._prepare):
 *             libev.ev_ref(self._ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_3_stop_watchers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_3_stop_watchers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_stop_watchers (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_2_stop_watchers(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_2_stop_watchers(struct PyGeventLoopObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("_stop_watchers", 0);

/* "gevent/corecext.pyx":302
 *
 *     def _stop_watchers(self):
 *         if libev.ev_is_active(&self._prepare):             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self._ptr)
 *             libev.ev_prepare_stop(self._ptr, &self._prepare)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_prepare)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":303
 *     def _stop_watchers(self):
 *         if libev.ev_is_active(&self._prepare):
 *             libev.ev_ref(self._ptr)             # <<<<<<<<<<<<<<
 *             libev.ev_prepare_stop(self._ptr, &self._prepare)
 *
 */
    ev_ref(__pyx_v_self->_ptr);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":304
 *         if libev.ev_is_active(&self._prepare):
 *             libev.ev_ref(self._ptr)
 *             libev.ev_prepare_stop(self._ptr, &self._prepare)             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":304
 *         if libev.ev_is_active(&self._prepare):
 *             libev.ev_ref(self._ptr)
 *             libev.ev_prepare_stop(self._ptr, &self._prepare)             # <<<<<<<<<<<<<<
 *
 *         if libev.ev_is_active(&self._periodic_signal_checker):
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    ev_prepare_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_prepare));

/* "gevent/corecext.pyx":302
 *
 *     def _stop_watchers(self):
 *         if libev.ev_is_active(&self._prepare):             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self._ptr)
 *             libev.ev_prepare_stop(self._ptr, &self._prepare)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  }

/* "gevent/corecext.pyx":306
 *             libev.ev_prepare_stop(self._ptr, &self._prepare)
 *
 *         if libev.ev_is_active(&self._periodic_signal_checker):             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self._ptr)
 *             libev.ev_timer_stop(self._ptr, &self._periodic_signal_checker)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_periodic_signal_checker)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":307
 *
 *         if libev.ev_is_active(&self._periodic_signal_checker):
 *             libev.ev_ref(self._ptr)             # <<<<<<<<<<<<<<
 *             libev.ev_timer_stop(self._ptr, &self._periodic_signal_checker)
 *
 */
    ev_ref(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":308
 *         if libev.ev_is_active(&self._periodic_signal_checker):
 *             libev.ev_ref(self._ptr)
 *             libev.ev_timer_stop(self._ptr, &self._periodic_signal_checker)             # <<<<<<<<<<<<<<
 *
 *
 */
    ev_timer_stop(__pyx_v_self->_ptr, (&__pyx_v_self->_periodic_signal_checker));

/* "gevent/corecext.pyx":306
 *             libev.ev_prepare_stop(self._ptr, &self._prepare)
 *
 *         if libev.ev_is_active(&self._periodic_signal_checker):             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self._ptr)
 *             libev.ev_timer_stop(self._ptr, &self._periodic_signal_checker)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  }

/* "gevent/corecext.pyx":301
 *             libev.ev_timer_start(self._ptr, &self._timer0)
 *
 *     def _stop_watchers(self):             # <<<<<<<<<<<<<<
 *         if libev.ev_is_active(&self._prepare):
 *             libev.ev_ref(self._ptr)
 */

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

/* "gevent/corecext.pyx":311
 *
 *
 *     def destroy(self):             # <<<<<<<<<<<<<<
 *         global _default_loop_destroyed
 *         if self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_4destroy(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("destroy", 0);

/* "gevent/corecext.pyx":313
 *     def destroy(self):
 *         global _default_loop_destroyed
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             self._stop_watchers()
 *             if __SYSERR_CALLBACK == self._handle_syserr:
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":314
 *         global _default_loop_destroyed
 *         if self._ptr:
 *             self._stop_watchers()             # <<<<<<<<<<<<<<
 *             if __SYSERR_CALLBACK == self._handle_syserr:
 *                 set_syserr_cb(None)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop_watchers); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __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;

/* "gevent/corecext.pyx":315
 *         if self._ptr:
 *             self._stop_watchers()
 *             if __SYSERR_CALLBACK == self._handle_syserr:             # <<<<<<<<<<<<<<
 *                 set_syserr_cb(None)
 *             if libev.ev_is_default_loop(self._ptr):
 */
    __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_syserr); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":316
 *             self._stop_watchers()
 *             if __SYSERR_CALLBACK == self._handle_syserr:
 *                 set_syserr_cb(None)             # <<<<<<<<<<<<<<
 *             if libev.ev_is_default_loop(self._ptr):
 *                 _default_loop_destroyed = True
 */
      __pyx_t_4 = __pyx_f_6gevent_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

/* "gevent/corecext.pyx":315
 *         if self._ptr:
 *             self._stop_watchers()
 *             if __SYSERR_CALLBACK == self._handle_syserr:             # <<<<<<<<<<<<<<
 *                 set_syserr_cb(None)
 *             if libev.ev_is_default_loop(self._ptr):
 */
    }

/* "gevent/corecext.pyx":317
 *             if __SYSERR_CALLBACK == self._handle_syserr:
 *                 set_syserr_cb(None)
 *             if libev.ev_is_default_loop(self._ptr):             # <<<<<<<<<<<<<<
 *                 _default_loop_destroyed = True
 *             libev.ev_loop_destroy(self._ptr)
 */
    __pyx_t_1 = (ev_is_default_loop(__pyx_v_self->_ptr) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":318
 *                 set_syserr_cb(None)
 *             if libev.ev_is_default_loop(self._ptr):
 *                 _default_loop_destroyed = True             # <<<<<<<<<<<<<<
 *             libev.ev_loop_destroy(self._ptr)
 *             self._ptr = NULL
 */
      __pyx_v_6gevent_8corecext__default_loop_destroyed = 1;

/* "gevent/corecext.pyx":317
 *             if __SYSERR_CALLBACK == self._handle_syserr:
 *                 set_syserr_cb(None)
 *             if libev.ev_is_default_loop(self._ptr):             # <<<<<<<<<<<<<<
 *                 _default_loop_destroyed = True
 *             libev.ev_loop_destroy(self._ptr)
 */
    }

/* "gevent/corecext.pyx":319
 *             if libev.ev_is_default_loop(self._ptr):
 *                 _default_loop_destroyed = True
 *             libev.ev_loop_destroy(self._ptr)             # <<<<<<<<<<<<<<
 *             self._ptr = NULL
 *
 */
    ev_loop_destroy(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":320
 *                 _default_loop_destroyed = True
 *             libev.ev_loop_destroy(self._ptr)
 *             self._ptr = NULL             # <<<<<<<<<<<<<<
 *
 *     def __dealloc__(self):
 */
    __pyx_v_self->_ptr = NULL;

/* "gevent/corecext.pyx":313
 *     def destroy(self):
 *         global _default_loop_destroyed
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             self._stop_watchers()
 *             if __SYSERR_CALLBACK == self._handle_syserr:
 */
  }

/* "gevent/corecext.pyx":311
 *
 *
 *     def destroy(self):             # <<<<<<<<<<<<<<
 *         global _default_loop_destroyed
 *         if self._ptr:
 */

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

/* "gevent/corecext.pyx":322
 *             self._ptr = NULL
 *
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._ptr:
 *             self._stop_watchers()
 */

/* Python wrapper */
static void __pyx_pw_6gevent_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6gevent_8corecext_4loop_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6gevent_8corecext_4loop_6__dealloc__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static void __pyx_pf_6gevent_8corecext_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__dealloc__", 0);

/* "gevent/corecext.pyx":323
 *
 *     def __dealloc__(self):
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             self._stop_watchers()
 *             if not libev.ev_is_default_loop(self._ptr):
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":324
 *     def __dealloc__(self):
 *         if self._ptr:
 *             self._stop_watchers()             # <<<<<<<<<<<<<<
 *             if not libev.ev_is_default_loop(self._ptr):
 *                 libev.ev_loop_destroy(self._ptr)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stop_watchers); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __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;

/* "gevent/corecext.pyx":325
 *         if self._ptr:
 *             self._stop_watchers()
 *             if not libev.ev_is_default_loop(self._ptr):             # <<<<<<<<<<<<<<
 *                 libev.ev_loop_destroy(self._ptr)
 *             self._ptr = NULL
 */
    __pyx_t_1 = ((!(ev_is_default_loop(__pyx_v_self->_ptr) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":326
 *             self._stop_watchers()
 *             if not libev.ev_is_default_loop(self._ptr):
 *                 libev.ev_loop_destroy(self._ptr)             # <<<<<<<<<<<<<<
 *             self._ptr = NULL
 *
 */
      ev_loop_destroy(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":325
 *         if self._ptr:
 *             self._stop_watchers()
 *             if not libev.ev_is_default_loop(self._ptr):             # <<<<<<<<<<<<<<
 *                 libev.ev_loop_destroy(self._ptr)
 *             self._ptr = NULL
 */
    }

/* "gevent/corecext.pyx":327
 *             if not libev.ev_is_default_loop(self._ptr):
 *                 libev.ev_loop_destroy(self._ptr)
 *             self._ptr = NULL             # <<<<<<<<<<<<<<
 *
 *     property ptr:
 */
    __pyx_v_self->_ptr = NULL;

/* "gevent/corecext.pyx":323
 *
 *     def __dealloc__(self):
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             self._stop_watchers()
 *             if not libev.ev_is_default_loop(self._ptr):
 */
  }

/* "gevent/corecext.pyx":322
 *             self._ptr = NULL
 *
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self._ptr:
 *             self._stop_watchers()
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("gevent.corecext.loop.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "gevent/corecext.pyx":331
 *     property ptr:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <size_t>self._ptr
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_3ptr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_3ptr___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":332
 *
 *         def __get__(self):
 *             return <size_t>self._ptr             # <<<<<<<<<<<<<<
 *
 *     property WatcherType:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((size_t)__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":331
 *     property ptr:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return <size_t>self._ptr
 *
 */

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

/* "gevent/corecext.pyx":336
 *     property WatcherType:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_11WatcherType___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":337
 *
 *         def __get__(self):
 *             return watcher             # <<<<<<<<<<<<<<
 *
 *     property MAXPRI:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_6gevent_8corecext_watcher));
  __pyx_r = ((PyObject *)__pyx_ptype_6gevent_8corecext_watcher);
  goto __pyx_L0;

/* "gevent/corecext.pyx":336
 *     property WatcherType:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return watcher
 *
 */

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

/* "gevent/corecext.pyx":341
 *     property MAXPRI:
 *
 *        def __get__(self):             # <<<<<<<<<<<<<<
 *            return libev.EV_MAXPRI
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_6MAXPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":342
 *
 *        def __get__(self):
 *            return libev.EV_MAXPRI             # <<<<<<<<<<<<<<
 *
 *     property MINPRI:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":341
 *     property MAXPRI:
 *
 *        def __get__(self):             # <<<<<<<<<<<<<<
 *            return libev.EV_MAXPRI
 *
 */

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

/* "gevent/corecext.pyx":346
 *     property MINPRI:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.EV_MINPRI
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_6MINPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":347
 *
 *         def __get__(self):
 *             return libev.EV_MINPRI             # <<<<<<<<<<<<<<
 *
 *     def _handle_syserr(self, message, errno):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":346
 *     property MINPRI:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.EV_MINPRI
 *
 */

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

/* "gevent/corecext.pyx":349
 *             return libev.EV_MINPRI
 *
 *     def _handle_syserr(self, message, errno):             # <<<<<<<<<<<<<<
 *         if sys.version_info[0] >= 3:
 *             message = message.decode()
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_message = 0;
  PyObject *__pyx_v_errno = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_handle_syserr (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_message,&__pyx_n_s_errno,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_errno)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_handle_syserr") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_message = values[0];
    __pyx_v_errno = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_handle_syserr", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_8_handle_syserr(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_message, __pyx_v_errno);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_handle_syserr", 0);
  __Pyx_INCREF(__pyx_v_message);

/* "gevent/corecext.pyx":350
 *
 *     def _handle_syserr(self, message, errno):
 *         if sys.version_info[0] >= 3:             # <<<<<<<<<<<<<<
 *             message = message.decode()
 *         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":351
 *     def _handle_syserr(self, message, errno):
 *         if sys.version_info[0] >= 3:
 *             message = message.decode()             # <<<<<<<<<<<<<<
 *         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)
 *
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_message, __pyx_n_s_decode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF_SET(__pyx_v_message, __pyx_t_2);
    __pyx_t_2 = 0;

/* "gevent/corecext.pyx":350
 *
 *     def _handle_syserr(self, message, errno):
 *         if sys.version_info[0] >= 3:             # <<<<<<<<<<<<<<
 *             message = message.decode()
 *         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)
 */
  }

/* "gevent/corecext.pyx":352
 *         if sys.version_info[0] >= 3:
 *             message = message.decode()
 *         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)             # <<<<<<<<<<<<<<
 *
 *     cpdef handle_error(self, context, type, value, tb):
 */
  __pyx_t_2 = PyNumber_Add(__pyx_v_message, __pyx_kp_s__5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_os); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_strerror); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  if (!__pyx_t_4) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_errno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    __Pyx_INCREF(__pyx_v_errno);
    __Pyx_GIVEREF(__pyx_v_errno);
    PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_errno);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_SystemError, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8corecext_loop *)__pyx_v_self->__pyx_vtab)->handle_error(__pyx_v_self, Py_None, __pyx_builtin_SystemError, __pyx_t_5, Py_None, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

/* "gevent/corecext.pyx":349
 *             return libev.EV_MINPRI
 *
 *     def _handle_syserr(self, message, errno):             # <<<<<<<<<<<<<<
 *         if sys.version_info[0] >= 3:
 *             message = message.decode()
 */

  /* 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("gevent.corecext.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_message);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":354
 *         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)
 *
 *     cpdef handle_error(self, context, type, value, tb):             # <<<<<<<<<<<<<<
 *         cdef object handle_error
 *         cdef object error_handler = self.error_handler
 */

static PyObject *__pyx_pw_6gevent_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext_4loop_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_handle_error = 0;
  PyObject *__pyx_v_error_handler = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_error", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_handle_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_11handle_error)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_context);
      __Pyx_GIVEREF(__pyx_v_context);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
      __Pyx_INCREF(__pyx_v_type);
      __Pyx_GIVEREF(__pyx_v_type);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
      __Pyx_INCREF(__pyx_v_tb);
      __Pyx_GIVEREF(__pyx_v_tb);
      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

/* "gevent/corecext.pyx":356
 *     cpdef handle_error(self, context, type, value, tb):
 *         cdef object handle_error
 *         cdef object error_handler = self.error_handler             # <<<<<<<<<<<<<<
 *         if error_handler is not None:
 *             # we do want to do getattr every time so that setting Hub.handle_error property just works
 */
  __pyx_t_1 = __pyx_v_self->error_handler;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_error_handler = __pyx_t_1;
  __pyx_t_1 = 0;

/* "gevent/corecext.pyx":357
 *         cdef object handle_error
 *         cdef object error_handler = self.error_handler
 *         if error_handler is not None:             # <<<<<<<<<<<<<<
 *             # we do want to do getattr every time so that setting Hub.handle_error property just works
 *             handle_error = getattr(error_handler, 'handle_error', error_handler)
 */
  __pyx_t_7 = (__pyx_v_error_handler != Py_None);
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

/* "gevent/corecext.pyx":359
 *         if error_handler is not None:
 *             # we do want to do getattr every time so that setting Hub.handle_error property just works
 *             handle_error = getattr(error_handler, 'handle_error', error_handler)             # <<<<<<<<<<<<<<
 *             handle_error(context, type, value, tb)
 *         else:
 */
    __pyx_t_1 = __Pyx_GetAttr3(__pyx_v_error_handler, __pyx_n_s_handle_error, __pyx_v_error_handler); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_v_handle_error = __pyx_t_1;
    __pyx_t_1 = 0;

/* "gevent/corecext.pyx":360
 *             # we do want to do getattr every time so that setting Hub.handle_error property just works
 *             handle_error = getattr(error_handler, 'handle_error', error_handler)
 *             handle_error(context, type, value, tb)             # <<<<<<<<<<<<<<
 *         else:
 *             self._default_handle_error(context, type, value, tb)
 */
    __Pyx_INCREF(__pyx_v_handle_error);
    __pyx_t_2 = __pyx_v_handle_error; __pyx_t_3 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_5 = 1;
      }
    }
    __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_context);
    __Pyx_GIVEREF(__pyx_v_context);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
    __Pyx_INCREF(__pyx_v_type);
    __Pyx_GIVEREF(__pyx_v_type);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
    __Pyx_INCREF(__pyx_v_tb);
    __Pyx_GIVEREF(__pyx_v_tb);
    PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

/* "gevent/corecext.pyx":357
 *         cdef object handle_error
 *         cdef object error_handler = self.error_handler
 *         if error_handler is not None:             # <<<<<<<<<<<<<<
 *             # we do want to do getattr every time so that setting Hub.handle_error property just works
 *             handle_error = getattr(error_handler, 'handle_error', error_handler)
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":362
 *             handle_error(context, type, value, tb)
 *         else:
 *             self._default_handle_error(context, type, value, tb)             # <<<<<<<<<<<<<<
 *
 *     cpdef _default_handle_error(self, context, type, value, tb):
 */
  /*else*/ {
    __pyx_t_1 = ((struct __pyx_vtabstruct_6gevent_8corecext_loop *)__pyx_v_self->__pyx_vtab)->_default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":354
 *         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)
 *
 *     cpdef handle_error(self, context, type, value, tb):             # <<<<<<<<<<<<<<
 *         cdef object handle_error
 *         cdef object error_handler = self.error_handler
 */

  /* 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_6);
  __Pyx_AddTraceback("gevent.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_handle_error);
  __Pyx_XDECREF(__pyx_v_error_handler);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_tb = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("handle_error (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "handle_error") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_context = values[0];
    __pyx_v_type = values[1];
    __pyx_v_value = values[2];
    __pyx_v_tb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_10handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_10handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("handle_error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext_4loop_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __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.corecext.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":364
 *             self._default_handle_error(context, type, value, tb)
 *
 *     cpdef _default_handle_error(self, context, type, value, tb):             # <<<<<<<<<<<<<<
 *         # note: Hub sets its own error handler so this is not used by gevent
 *         # this is here to make core.loop usable without the rest of gevent
 */

static PyObject *__pyx_pw_6gevent_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext_4loop__default_handle_error(struct PyGeventLoopObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb, int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_default_handle_error", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default_handle_error); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_13_default_handle_error)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_context);
      __Pyx_GIVEREF(__pyx_v_context);
      PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_context);
      __Pyx_INCREF(__pyx_v_type);
      __Pyx_GIVEREF(__pyx_v_type);
      PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_type);
      __Pyx_INCREF(__pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_value);
      __Pyx_INCREF(__pyx_v_tb);
      __Pyx_GIVEREF(__pyx_v_tb);
      PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_v_tb);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

/* "gevent/corecext.pyx":367
 *         # note: Hub sets its own error handler so this is not used by gevent
 *         # this is here to make core.loop usable without the rest of gevent
 *         traceback.print_exception(type, value, tb)             # <<<<<<<<<<<<<<
 *         if self._ptr:
 *             libev.ev_break(self._ptr, libev.EVBREAK_ONE)
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_traceback); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_print_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  if (__pyx_t_2) {
    __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
  }
  __Pyx_INCREF(__pyx_v_type);
  __Pyx_GIVEREF(__pyx_v_type);
  PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_type);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
  __Pyx_INCREF(__pyx_v_tb);
  __Pyx_GIVEREF(__pyx_v_tb);
  PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_tb);
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

/* "gevent/corecext.pyx":368
 *         # this is here to make core.loop usable without the rest of gevent
 *         traceback.print_exception(type, value, tb)
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             libev.ev_break(self._ptr, libev.EVBREAK_ONE)
 *
 */
  __pyx_t_7 = (__pyx_v_self->_ptr != 0);
  if (__pyx_t_7) {

/* "gevent/corecext.pyx":369
 *         traceback.print_exception(type, value, tb)
 *         if self._ptr:
 *             libev.ev_break(self._ptr, libev.EVBREAK_ONE)             # <<<<<<<<<<<<<<
 *
 *     def run(self, nowait=False, once=False):
 */
    ev_break(__pyx_v_self->_ptr, EVBREAK_ONE);

/* "gevent/corecext.pyx":368
 *         # this is here to make core.loop usable without the rest of gevent
 *         traceback.print_exception(type, value, tb)
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             libev.ev_break(self._ptr, libev.EVBREAK_ONE)
 *
 */
  }

/* "gevent/corecext.pyx":364
 *             self._default_handle_error(context, type, value, tb)
 *
 *     cpdef _default_handle_error(self, context, type, value, tb):             # <<<<<<<<<<<<<<
 *         # note: Hub sets its own error handler so this is not used by gevent
 *         # this is here to make core.loop usable without the rest of gevent
 */

  /* 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_6);
  __Pyx_AddTraceback("gevent.corecext.loop._default_handle_error", __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_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_context = 0;
  PyObject *__pyx_v_type = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_tb = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_default_handle_error (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,&__pyx_n_s_type,&__pyx_n_s_value,&__pyx_n_s_tb,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_context)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_type)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  3:
        if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tb)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_default_handle_error") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_context = values[0];
    __pyx_v_type = values[1];
    __pyx_v_value = values[2];
    __pyx_v_tb = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_default_handle_error", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_12_default_handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_12_default_handle_error(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_context, PyObject *__pyx_v_type, PyObject *__pyx_v_value, PyObject *__pyx_v_tb) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_default_handle_error", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext_4loop__default_handle_error(__pyx_v_self, __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __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.corecext.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":371
 *             libev.ev_break(self._ptr, libev.EVBREAK_ONE)
 *
 *     def run(self, nowait=False, once=False):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nowait = 0;
  PyObject *__pyx_v_once = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("run (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nowait,&__pyx_n_s_once,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_False);
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nowait);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_once);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nowait = values[0];
    __pyx_v_once = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("run", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_14run(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_nowait, __pyx_v_once);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once) {
  unsigned int __pyx_v_flags;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("run", 0);

/* "gevent/corecext.pyx":373
 *     def run(self, nowait=False, once=False):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         cdef unsigned int flags = 0
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":374
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         cdef unsigned int flags = 0
 *         if nowait:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":373
 *     def run(self, nowait=False, once=False):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         cdef unsigned int flags = 0
 */
  }

/* "gevent/corecext.pyx":375
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         cdef unsigned int flags = 0             # <<<<<<<<<<<<<<
 *         if nowait:
 *             flags |= libev.EVRUN_NOWAIT
 */
  __pyx_v_flags = 0;

/* "gevent/corecext.pyx":376
 *             raise ValueError('operation on destroyed loop')
 *         cdef unsigned int flags = 0
 *         if nowait:             # <<<<<<<<<<<<<<
 *             flags |= libev.EVRUN_NOWAIT
 *         if once:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_nowait); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":377
 *         cdef unsigned int flags = 0
 *         if nowait:
 *             flags |= libev.EVRUN_NOWAIT             # <<<<<<<<<<<<<<
 *         if once:
 *             flags |= libev.EVRUN_ONCE
 */
    __pyx_v_flags = (__pyx_v_flags | EVRUN_NOWAIT);

/* "gevent/corecext.pyx":376
 *             raise ValueError('operation on destroyed loop')
 *         cdef unsigned int flags = 0
 *         if nowait:             # <<<<<<<<<<<<<<
 *             flags |= libev.EVRUN_NOWAIT
 *         if once:
 */
  }

/* "gevent/corecext.pyx":378
 *         if nowait:
 *             flags |= libev.EVRUN_NOWAIT
 *         if once:             # <<<<<<<<<<<<<<
 *             flags |= libev.EVRUN_ONCE
 *         with nogil:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_once); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":379
 *             flags |= libev.EVRUN_NOWAIT
 *         if once:
 *             flags |= libev.EVRUN_ONCE             # <<<<<<<<<<<<<<
 *         with nogil:
 *             libev.ev_run(self._ptr, flags)
 */
    __pyx_v_flags = (__pyx_v_flags | EVRUN_ONCE);

/* "gevent/corecext.pyx":378
 *         if nowait:
 *             flags |= libev.EVRUN_NOWAIT
 *         if once:             # <<<<<<<<<<<<<<
 *             flags |= libev.EVRUN_ONCE
 *         with nogil:
 */
  }

/* "gevent/corecext.pyx":380
 *         if once:
 *             flags |= libev.EVRUN_ONCE
 *         with nogil:             # <<<<<<<<<<<<<<
 *             libev.ev_run(self._ptr, flags)
 *
 */
  {
      #ifdef WITH_THREAD
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      #endif
      /*try:*/ {

/* "gevent/corecext.pyx":381
 *             flags |= libev.EVRUN_ONCE
 *         with nogil:
 *             libev.ev_run(self._ptr, flags)             # <<<<<<<<<<<<<<
 *
 *     def reinit(self):
 */
        ev_run(__pyx_v_self->_ptr, __pyx_v_flags);
      }

/* "gevent/corecext.pyx":380
 *         if once:
 *             flags |= libev.EVRUN_ONCE
 *         with nogil:             # <<<<<<<<<<<<<<
 *             libev.ev_run(self._ptr, flags)
 *
 */
      /*finally:*/ {
        /*normal exit:*/{
          #ifdef WITH_THREAD
          Py_BLOCK_THREADS
          #endif
          goto __pyx_L8;
        }
        __pyx_L8:;
      }
  }

/* "gevent/corecext.pyx":371
 *             libev.ev_break(self._ptr, libev.EVBREAK_ONE)
 *
 *     def run(self, nowait=False, once=False):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":383
 *             libev.ev_run(self._ptr, flags)
 *
 *     def reinit(self):             # <<<<<<<<<<<<<<
 *         if self._ptr:
 *             libev.ev_loop_fork(self._ptr)
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reinit (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_16reinit(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("reinit", 0);

/* "gevent/corecext.pyx":384
 *
 *     def reinit(self):
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             libev.ev_loop_fork(self._ptr)
 *
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":385
 *     def reinit(self):
 *         if self._ptr:
 *             libev.ev_loop_fork(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     def ref(self):
 */
    ev_loop_fork(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":384
 *
 *     def reinit(self):
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             libev.ev_loop_fork(self._ptr)
 *
 */
  }

/* "gevent/corecext.pyx":383
 *             libev.ev_run(self._ptr, flags)
 *
 *     def reinit(self):             # <<<<<<<<<<<<<<
 *         if self._ptr:
 *             libev.ev_loop_fork(self._ptr)
 */

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

/* "gevent/corecext.pyx":387
 *             libev.ev_loop_fork(self._ptr)
 *
 *     def ref(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ref (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_18ref(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":389
 *     def ref(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_ref(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":390
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_ref(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":389
 *     def ref(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_ref(self._ptr)
 */
  }

/* "gevent/corecext.pyx":391
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_ref(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     def unref(self):
 */
  ev_ref(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":387
 *             libev.ev_loop_fork(self._ptr)
 *
 *     def ref(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.loop.ref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":393
 *         libev.ev_ref(self._ptr)
 *
 *     def unref(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("unref (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_20unref(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":395
 *     def unref(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_unref(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":396
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_unref(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":395
 *     def unref(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_unref(self._ptr)
 */
  }

/* "gevent/corecext.pyx":397
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_unref(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     def break_(self, int how=libev.EVBREAK_ONE):
 */
  ev_unref(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":393
 *         libev.ev_ref(self._ptr)
 *
 *     def unref(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.loop.unref", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":399
 *         libev.ev_unref(self._ptr)
 *
 *     def break_(self, int how=libev.EVBREAK_ONE):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_how;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("break_ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_how,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_how);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "break_") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    if (values[0]) {
      __pyx_v_how = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_how == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_how = __pyx_k__9;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("break_", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_22break_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_how);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("break_", 0);

/* "gevent/corecext.pyx":401
 *     def break_(self, int how=libev.EVBREAK_ONE):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_break(self._ptr, how)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":402
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_break(self._ptr, how)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":401
 *     def break_(self, int how=libev.EVBREAK_ONE):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_break(self._ptr, how)
 */
  }

/* "gevent/corecext.pyx":403
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_break(self._ptr, how)             # <<<<<<<<<<<<<<
 *
 *     def verify(self):
 */
  ev_break(__pyx_v_self->_ptr, __pyx_v_how);

/* "gevent/corecext.pyx":399
 *         libev.ev_unref(self._ptr)
 *
 *     def break_(self, int how=libev.EVBREAK_ONE):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":405
 *         libev.ev_break(self._ptr, how)
 *
 *     def verify(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("verify (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_24verify(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":407
 *     def verify(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_verify(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":408
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_verify(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":407
 *     def verify(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_verify(self._ptr)
 */
  }

/* "gevent/corecext.pyx":409
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_verify(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     def now(self):
 */
  ev_verify(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":405
 *         libev.ev_break(self._ptr, how)
 *
 *     def verify(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.loop.verify", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":411
 *         libev.ev_verify(self._ptr)
 *
 *     def now(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("now (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_26now(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":413
 *     def now(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         return libev.ev_now(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":414
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         return libev.ev_now(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":413
 *     def now(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         return libev.ev_now(self._ptr)
 */
  }

/* "gevent/corecext.pyx":415
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         return libev.ev_now(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     def update(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(ev_now(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":411
 *         libev.ev_verify(self._ptr)
 *
 *     def now(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

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

/* "gevent/corecext.pyx":417
 *         return libev.ev_now(self._ptr)
 *
 *     def update(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_29update(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_29update(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("update (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_28update(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":419
 *     def update(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_now_update(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":420
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_now_update(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":419
 *     def update(self):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_now_update(self._ptr)
 */
  }

/* "gevent/corecext.pyx":421
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_now_update(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     def __repr__(self):
 */
  ev_now_update(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":417
 *         return libev.ev_now(self._ptr)
 *
 *     def update(self):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.loop.update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":423
 *         libev.ev_now_update(self._ptr)
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format())
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_31__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_31__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_30__repr__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":424
 *
 *     def __repr__(self):
 *         return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format())             # <<<<<<<<<<<<<<
 *
 *     property default:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  if (__pyx_t_5) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s, __pyx_t_4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":423
 *         libev.ev_now_update(self._ptr)
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return '<%s at 0x%x %s>' % (self.__class__.__name__, id(self), self._format())
 *
 */

  /* 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_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.loop.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":428
 *     property default:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_7default_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_7default___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":430
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return True if libev.ev_is_default_loop(self._ptr) else False
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":431
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_default_loop(self._ptr) else False
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":430
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return True if libev.ev_is_default_loop(self._ptr) else False
 */
  }

/* "gevent/corecext.pyx":432
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return True if libev.ev_is_default_loop(self._ptr) else False             # <<<<<<<<<<<<<<
 *
 *     property iteration:
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_default_loop(__pyx_v_self->_ptr) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_2 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_2 = Py_False;
  }
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":428
 *     property default:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

/* "gevent/corecext.pyx":436
 *     property iteration:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9iteration_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_9iteration___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":438
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_iteration(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":439
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_iteration(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":438
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_iteration(self._ptr)
 */
  }

/* "gevent/corecext.pyx":440
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_iteration(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     property depth:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_iteration(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":436
 *     property iteration:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

/* "gevent/corecext.pyx":444
 *     property depth:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_5depth_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_5depth___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":446
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_depth(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":447
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_depth(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":446
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_depth(self._ptr)
 */
  }

/* "gevent/corecext.pyx":448
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_depth(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     property backend_int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_depth(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":444
 *     property depth:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

/* "gevent/corecext.pyx":452
 *     property backend_int:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_11backend_int_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_11backend_int___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":454
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_backend(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":455
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_backend(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":454
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_backend(self._ptr)
 */
  }

/* "gevent/corecext.pyx":456
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_backend(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     property backend:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_backend(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":452
 *     property backend_int:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

/* "gevent/corecext.pyx":460
 *     property backend:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_7backend_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_7backend___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self) {
  unsigned int __pyx_v_backend;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_value = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":462
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":463
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 *             for key, value in _flags:
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":462
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 */
  }

/* "gevent/corecext.pyx":464
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)             # <<<<<<<<<<<<<<
 *             for key, value in _flags:
 *                 if key == backend:
 */
  __pyx_v_backend = ev_backend(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":465
 *                 raise ValueError('operation on destroyed loop')
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 *             for key, value in _flags:             # <<<<<<<<<<<<<<
 *                 if key == backend:
 *                     return value
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_COMPILING_IN_CPYTHON
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      #if CYTHON_COMPILING_IN_CPYTHON
      Py_ssize_t size = Py_SIZE(sequence);
      #else
      Py_ssize_t size = PySequence_Size(sequence);
      #endif
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      #if CYTHON_COMPILING_IN_CPYTHON
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1);
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0);
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1);
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L6_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L7_unpacking_done;
      __pyx_L6_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_L7_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_7);
    __pyx_t_7 = 0;

/* "gevent/corecext.pyx":466
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 *             for key, value in _flags:
 *                 if key == backend:             # <<<<<<<<<<<<<<
 *                     return value
 *             return backend
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_key, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":467
 *             for key, value in _flags:
 *                 if key == backend:
 *                     return value             # <<<<<<<<<<<<<<
 *             return backend
 *
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_v_value);
      __pyx_r = __pyx_v_value;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":466
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 *             for key, value in _flags:
 *                 if key == backend:             # <<<<<<<<<<<<<<
 *                     return value
 *             return backend
 */
    }

/* "gevent/corecext.pyx":465
 *                 raise ValueError('operation on destroyed loop')
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 *             for key, value in _flags:             # <<<<<<<<<<<<<<
 *                 if key == backend:
 *                     return value
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

/* "gevent/corecext.pyx":468
 *                 if key == backend:
 *                     return value
 *             return backend             # <<<<<<<<<<<<<<
 *
 *     property pendingcnt:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_backend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":460
 *     property backend:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gevent.corecext.loop.backend.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":472
 *     property pendingcnt:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_10pendingcnt___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":474
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_pending_count(self._ptr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":475
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_pending_count(self._ptr)
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":474
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_pending_count(self._ptr)
 */
  }

/* "gevent/corecext.pyx":476
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return libev.ev_pending_count(self._ptr)             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(ev_pending_count(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":472
 *     property pendingcnt:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":482
 *
 *
 *     def io(self, int fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return io(self, fd, events, ref, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":479
 *
 *
 *     def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return io(self, fd, events, ref, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  int __pyx_v_fd;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  vfd_socket_t __pyx_v_fd;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  int __pyx_v_events;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("io (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--;
        else {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
          __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
          __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "io") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __pyx_v_fd = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
    __pyx_v_fd = __Pyx_PyInt_As_vfd_socket_t(values[0]); if (unlikely((__pyx_v_fd == (vfd_socket_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_events = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __pyx_v_ref = values[2];
    __pyx_v_priority = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __Pyx_RaiseArgtupleInvalid("io", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_32io(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_32io(struct PyGeventLoopObject *__pyx_v_self, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("io", 0);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":483
 *
 *     def io(self, int fd, int events, ref=True, priority=None):
 *         return io(self, fd, events, ref, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":480
 *
 *     def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None):
 *         return io(self, fd, events, ref, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_XDECREF(__pyx_r);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_t_1 = __Pyx_PyInt_From_vfd_socket_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_t_1);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_io), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":482
 *
 *
 *     def io(self, int fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return io(self, fd, events, ref, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":479
 *
 *
 *     def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return io(self, fd, events, ref, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

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

/* "gevent/corecext.pyx":486
 *
 *
 *     def timer(self, double after, double repeat=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return timer(self, after, repeat, ref, priority)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  double __pyx_v_after;
  double __pyx_v_repeat;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("timer (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_after)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repeat);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_after = __pyx_PyFloat_AsDouble(values[0]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_repeat = ((double)0.0);
    }
    __pyx_v_ref = values[2];
    __pyx_v_priority = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_34timer(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_34timer(struct PyGeventLoopObject *__pyx_v_self, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("timer", 0);

/* "gevent/corecext.pyx":487
 *
 *     def timer(self, double after, double repeat=0.0, ref=True, priority=None):
 *         return timer(self, after, repeat, ref, priority)             # <<<<<<<<<<<<<<
 *
 *     def signal(self, int signum, ref=True, priority=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_after); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_timer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":486
 *
 *
 *     def timer(self, double after, double repeat=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return timer(self, after, repeat, ref, priority)
 *
 */

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

/* "gevent/corecext.pyx":489
 *         return timer(self, after, repeat, ref, priority)
 *
 *     def signal(self, int signum, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return signal(self, signum, ref, priority)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_signum;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("signal (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_signum,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_True);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signum)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "signal") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_signum = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_signum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ref = values[1];
    __pyx_v_priority = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("signal", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_36signal(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_signum, __pyx_v_ref, __pyx_v_priority);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_36signal(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_signum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("signal", 0);

/* "gevent/corecext.pyx":490
 *
 *     def signal(self, int signum, ref=True, priority=None):
 *         return signal(self, signum, ref, priority)             # <<<<<<<<<<<<<<
 *
 *     def idle(self, ref=True, priority=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_signum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_priority);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_signal), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":489
 *         return timer(self, after, repeat, ref, priority)
 *
 *     def signal(self, int signum, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return signal(self, signum, ref, priority)
 *
 */

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

/* "gevent/corecext.pyx":492
 *         return signal(self, signum, ref, priority)
 *
 *     def idle(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return idle(self, ref, priority)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("idle (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_True);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "idle") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ref = values[0];
    __pyx_v_priority = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("idle", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_38idle(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("idle", 0);

/* "gevent/corecext.pyx":493
 *
 *     def idle(self, ref=True, priority=None):
 *         return idle(self, ref, priority)             # <<<<<<<<<<<<<<
 *
 *     def prepare(self, ref=True, priority=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_idle), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":492
 *         return signal(self, signum, ref, priority)
 *
 *     def idle(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return idle(self, ref, priority)
 *
 */

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

/* "gevent/corecext.pyx":495
 *         return idle(self, ref, priority)
 *
 *     def prepare(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return prepare(self, ref, priority)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("prepare (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_True);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "prepare") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ref = values[0];
    __pyx_v_priority = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("prepare", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_40prepare(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("prepare", 0);

/* "gevent/corecext.pyx":496
 *
 *     def prepare(self, ref=True, priority=None):
 *         return prepare(self, ref, priority)             # <<<<<<<<<<<<<<
 *
 *     def check(self, ref=True, priority=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_prepare), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":495
 *         return idle(self, ref, priority)
 *
 *     def prepare(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return prepare(self, ref, priority)
 *
 */

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

/* "gevent/corecext.pyx":498
 *         return prepare(self, ref, priority)
 *
 *     def check(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return check(self, ref, priority)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("check (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_True);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "check") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ref = values[0];
    __pyx_v_priority = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("check", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_42check(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("check", 0);

/* "gevent/corecext.pyx":499
 *
 *     def check(self, ref=True, priority=None):
 *         return check(self, ref, priority)             # <<<<<<<<<<<<<<
 *
 *     def fork(self, ref=True, priority=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_check), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":498
 *         return prepare(self, ref, priority)
 *
 *     def check(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return check(self, ref, priority)
 *
 */

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

/* "gevent/corecext.pyx":501
 *         return check(self, ref, priority)
 *
 *     def fork(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return fork(self, ref, priority)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fork (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_True);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "fork") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ref = values[0];
    __pyx_v_priority = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("fork", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_44fork(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fork", 0);

/* "gevent/corecext.pyx":502
 *
 *     def fork(self, ref=True, priority=None):
 *         return fork(self, ref, priority)             # <<<<<<<<<<<<<<
 *
 *     def async(self, ref=True, priority=None):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_fork), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":501
 *         return check(self, ref, priority)
 *
 *     def fork(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return fork(self, ref, priority)
 *
 */

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

/* "gevent/corecext.pyx":504
 *         return fork(self, ref, priority)
 *
 *     def async(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return async(self, ref, priority)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_47async(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_47async(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("async (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_True);
    values[1] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[0] = value; kw_args--; }
        }
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "async") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_ref = values[0];
    __pyx_v_priority = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("async", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.async", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_46async(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_46async(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("async", 0);

/* "gevent/corecext.pyx":505
 *
 *     def async(self, ref=True, priority=None):
 *         return async(self, ref, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_async), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":504
 *         return fork(self, ref, priority)
 *
 *     def async(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return async(self, ref, priority)
 *
 */

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":510
 *
 *
 *     def child(self, int pid, bint trace=0, ref=True):             # <<<<<<<<<<<<<<
 *         return child(self, pid, trace, ref)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":518
 *
 *
 *     def stat(self, str path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return stat(self, path, interval, ref, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* Python wrapper */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_pid;
  int __pyx_v_trace;
  PyObject *__pyx_v_ref = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("child (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trace);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "child") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pid = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[1]) {
      __pyx_v_trace = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_trace = ((int)0);
    }
    __pyx_v_ref = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("child", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_48child(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_48child(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("child", 0);

/* "gevent/corecext.pyx":511
 *
 *     def child(self, int pid, bint trace=0, ref=True):
 *         return child(self, pid, trace, ref)             # <<<<<<<<<<<<<<
 *
 *     def install_sigchld(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_pid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_trace); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_child), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":510
 *
 *
 *     def child(self, int pid, bint trace=0, ref=True):             # <<<<<<<<<<<<<<
 *         return child(self, pid, trace, ref)
 *
 */

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

/* "gevent/corecext.pyx":513
 *         return child(self, pid, trace, ref)
 *
 *     def install_sigchld(self):             # <<<<<<<<<<<<<<
 *         libev.gevent_install_sigchld_handler()
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("install_sigchld (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_50install_sigchld(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("install_sigchld", 0);

/* "gevent/corecext.pyx":514
 *
 *     def install_sigchld(self):
 *         libev.gevent_install_sigchld_handler()             # <<<<<<<<<<<<<<
 *
 *
 */
  gevent_install_sigchld_handler();

/* "gevent/corecext.pyx":513
 *         return child(self, pid, trace, ref)
 *
 *     def install_sigchld(self):             # <<<<<<<<<<<<<<
 *         libev.gevent_install_sigchld_handler()
 *
 */

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

/* "gevent/corecext.pyx":518
 *
 *
 *     def stat(self, str path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return stat(self, path, interval, ref, priority)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_53stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_53stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_49stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_49stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  PyObject *__pyx_v_path = 0;
  float __pyx_v_interval;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stat (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_interval);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "stat") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_path = ((PyObject*)values[0]);
    if (values[1]) {
      __pyx_v_interval = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_interval = ((float)0.0);
    }
    __pyx_v_ref = values[2];
    __pyx_v_priority = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("stat", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_52stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_48stat(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_52stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_48stat(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("stat", 0);

/* "gevent/corecext.pyx":519
 *
 *     def stat(self, str path, float interval=0.0, ref=True, priority=None):
 *         return stat(self, path, interval, ref, priority)             # <<<<<<<<<<<<<<
 *
 *     def run_callback(self, func, *args):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_interval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_path);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_priority);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_stat), __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":518
 *
 *
 *     def stat(self, str path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return stat(self, path, interval, ref, priority)
 *
 */

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

/* "gevent/corecext.pyx":521
 *         return stat(self, path, interval, ref, priority)
 *
 *     def run_callback(self, func, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

/* Python wrapper */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_55run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_55run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_51run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_51run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  PyObject *__pyx_v_func = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("run_callback (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "run_callback") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_func = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("run_callback", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_54run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_50run_callback(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_func, __pyx_v_args);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_54run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_pf_6gevent_8corecext_4loop_50run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  struct PyGeventCallbackObject *__pyx_v_cb = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("run_callback", 0);

/* "gevent/corecext.pyx":523
 *     def run_callback(self, func, *args):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         cdef callback cb = callback(func, args)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":524
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         cdef callback cb = callback(func, args)
 *         self._callbacks.append(cb)
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":523
 *     def run_callback(self, func, *args):
 *
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         cdef callback cb = callback(func, args)
 */
  }

/* "gevent/corecext.pyx":525
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         cdef callback cb = callback(func, args)             # <<<<<<<<<<<<<<
 *         self._callbacks.append(cb)
 *         libev.ev_ref(self._ptr)
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func);
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_args);
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext_callback), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cb = ((struct PyGeventCallbackObject *)__pyx_t_3);
  __pyx_t_3 = 0;

/* "gevent/corecext.pyx":526
 *             raise ValueError('operation on destroyed loop')
 *         cdef callback cb = callback(func, args)
 *         self._callbacks.append(cb)             # <<<<<<<<<<<<<<
 *         libev.ev_ref(self._ptr)
 *         return cb
 */
  if (unlikely(__pyx_v_self->_callbacks == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_t_4 = __Pyx_PyList_Append(__pyx_v_self->_callbacks, ((PyObject *)__pyx_v_cb)); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":527
 *         cdef callback cb = callback(func, args)
 *         self._callbacks.append(cb)
 *         libev.ev_ref(self._ptr)             # <<<<<<<<<<<<<<
 *         return cb
 *
 */
  ev_ref(__pyx_v_self->_ptr);

/* "gevent/corecext.pyx":528
 *         self._callbacks.append(cb)
 *         libev.ev_ref(self._ptr)
 *         return cb             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_cb));
  __pyx_r = ((PyObject *)__pyx_v_cb);
  goto __pyx_L0;

/* "gevent/corecext.pyx":521
 *         return stat(self, path, interval, ref, priority)
 *
 *     def run_callback(self, func, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.corecext.loop.run_callback", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_cb);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":530
 *         return cb
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         if not self._ptr:
 *             return 'destroyed'
 */

/* Python wrapper */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_57_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_57_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_53_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_53_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_56_format(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_56_format(struct PyGeventLoopObject *__pyx_v_self) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_52_format(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_52_format(struct PyGeventLoopObject *__pyx_v_self) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  PyObject *__pyx_t_4 = NULL;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_format", 0);

/* "gevent/corecext.pyx":531
 *
 *     def _format(self):
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             return 'destroyed'
 *         cdef object msg = self.backend
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":532
 *     def _format(self):
 *         if not self._ptr:
 *             return 'destroyed'             # <<<<<<<<<<<<<<
 *         cdef object msg = self.backend
 *         if self.default:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_n_s_destroyed);
    __pyx_r = __pyx_n_s_destroyed;
    goto __pyx_L0;

/* "gevent/corecext.pyx":531
 *
 *     def _format(self):
 *         if not self._ptr:             # <<<<<<<<<<<<<<
 *             return 'destroyed'
 *         cdef object msg = self.backend
 */
  }

/* "gevent/corecext.pyx":533
 *         if not self._ptr:
 *             return 'destroyed'
 *         cdef object msg = self.backend             # <<<<<<<<<<<<<<
 *         if self.default:
 *             msg += ' default'
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_backend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_msg = __pyx_t_2;
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":534
 *             return 'destroyed'
 *         cdef object msg = self.backend
 *         if self.default:             # <<<<<<<<<<<<<<
 *             msg += ' default'
 *         msg += ' pending=%s' % self.pendingcnt
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_default); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":535
 *         cdef object msg = self.backend
 *         if self.default:
 *             msg += ' default'             # <<<<<<<<<<<<<<
 *         msg += ' pending=%s' % self.pendingcnt
 *
 */
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_kp_s_default_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2);
    __pyx_t_2 = 0;

/* "gevent/corecext.pyx":534
 *             return 'destroyed'
 *         cdef object msg = self.backend
 *         if self.default:             # <<<<<<<<<<<<<<
 *             msg += ' default'
 *         msg += ' pending=%s' % self.pendingcnt
 */
  }

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":536
 *         if self.default:
 *             msg += ' default'
 *         msg += ' pending=%s' % self.pendingcnt             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":536
 *         if self.default:
 *             msg += ' default'
 *         msg += ' pending=%s' % self.pendingcnt             # <<<<<<<<<<<<<<
 *
 *         msg += self._format_details()
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pendingcnt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_pending_s, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_2);
  __pyx_t_2 = 0;

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":540
 *
 *
 *         return msg             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":538
 *         msg += ' pending=%s' % self.pendingcnt
 *
 *         msg += self._format_details()             # <<<<<<<<<<<<<<
 *
 *         return msg
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format_details); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (__pyx_t_4) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_msg, __pyx_t_3);
  __pyx_t_3 = 0;

/* "gevent/corecext.pyx":540
 *         msg += self._format_details()
 *
 *         return msg             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_msg);
  __pyx_r = __pyx_v_msg;
  goto __pyx_L0;

/* "gevent/corecext.pyx":530
 *         return cb
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         if not self._ptr:
 *             return 'destroyed'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_XDECREF(__pyx_t_4);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_AddTraceback("gevent.corecext.loop._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":544
 *
 *
 *     def _format_details(self):             # <<<<<<<<<<<<<<
 *         cdef str msg = ''
 *         cdef object fileno = self.fileno()
 */

/* Python wrapper */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_59_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_59_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_55_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_55_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format_details (wrapper)", 0);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_58_format_details(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_58_format_details(struct PyGeventLoopObject *__pyx_v_self) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_54_format_details(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_54_format_details(struct PyGeventLoopObject *__pyx_v_self) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  PyObject *__pyx_v_msg = 0;
  PyObject *__pyx_v_fileno = 0;
  PyObject *__pyx_v_sigfd = 0;
  PyObject *__pyx_v_activecnt = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_format_details", 0);

/* "gevent/corecext.pyx":545
 *
 *     def _format_details(self):
 *         cdef str msg = ''             # <<<<<<<<<<<<<<
 *         cdef object fileno = self.fileno()
 *         cdef object sigfd = None
 */
  __Pyx_INCREF(__pyx_kp_s__21);
  __pyx_v_msg = __pyx_kp_s__21;

/* "gevent/corecext.pyx":546
 *     def _format_details(self):
 *         cdef str msg = ''
 *         cdef object fileno = self.fileno()             # <<<<<<<<<<<<<<
 *         cdef object sigfd = None
 *         cdef object activecnt = None
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fileno); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_fileno = __pyx_t_1;
  __pyx_t_1 = 0;

/* "gevent/corecext.pyx":547
 *         cdef str msg = ''
 *         cdef object fileno = self.fileno()
 *         cdef object sigfd = None             # <<<<<<<<<<<<<<
 *         cdef object activecnt = None
 *         try:
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_sigfd = Py_None;

/* "gevent/corecext.pyx":548
 *         cdef object fileno = self.fileno()
 *         cdef object sigfd = None
 *         cdef object activecnt = None             # <<<<<<<<<<<<<<
 *         try:
 *             sigfd = self.sigfd
 */
  __Pyx_INCREF(Py_None);
  __pyx_v_activecnt = Py_None;

/* "gevent/corecext.pyx":549
 *         cdef object sigfd = None
 *         cdef object activecnt = None
 *         try:             # <<<<<<<<<<<<<<
 *             sigfd = self.sigfd
 *         except AttributeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_4, &__pyx_t_5, &__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    /*try:*/ {

/* "gevent/corecext.pyx":550
 *         cdef object activecnt = None
 *         try:
 *             sigfd = self.sigfd             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             sigfd = None
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sigfd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_sigfd, __pyx_t_1);
      __pyx_t_1 = 0;

/* "gevent/corecext.pyx":549
 *         cdef object sigfd = None
 *         cdef object activecnt = None
 *         try:             # <<<<<<<<<<<<<<
 *             sigfd = self.sigfd
 *         except AttributeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;

/* "gevent/corecext.pyx":551
 *         try:
 *             sigfd = self.sigfd
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             sigfd = None
 *         try:
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("gevent.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_3);

/* "gevent/corecext.pyx":552
 *             sigfd = self.sigfd
 *         except AttributeError:
 *             sigfd = None             # <<<<<<<<<<<<<<
 *         try:
 *             activecnt = self.activecnt
 */
      __Pyx_INCREF(Py_None);
      __Pyx_DECREF_SET(__pyx_v_sigfd, Py_None);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

/* "gevent/corecext.pyx":549
 *         cdef object sigfd = None
 *         cdef object activecnt = None
 *         try:             # <<<<<<<<<<<<<<
 *             sigfd = self.sigfd
 *         except AttributeError:
 */
    __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_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_ExceptionReset(__pyx_t_4, __pyx_t_5, __pyx_t_6);
    __pyx_L10_try_end:;
  }

/* "gevent/corecext.pyx":553
 *         except AttributeError:
 *             sigfd = None
 *         try:             # <<<<<<<<<<<<<<
 *             activecnt = self.activecnt
 *         except AttributeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_6, &__pyx_t_5, &__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    /*try:*/ {

/* "gevent/corecext.pyx":554
 *             sigfd = None
 *         try:
 *             activecnt = self.activecnt             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             pass
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_activecnt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_activecnt, __pyx_t_3);
      __pyx_t_3 = 0;

/* "gevent/corecext.pyx":553
 *         except AttributeError:
 *             sigfd = None
 *         try:             # <<<<<<<<<<<<<<
 *             activecnt = self.activecnt
 *         except AttributeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L20_try_end;
    __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_3); __pyx_t_3 = 0;

/* "gevent/corecext.pyx":555
 *         try:
 *             activecnt = self.activecnt
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             pass
 *         if activecnt is not None:
 */
    __pyx_t_7 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_7) {
      PyErr_Restore(0,0,0);
      goto __pyx_L14_exception_handled;
    }
    goto __pyx_L15_except_error;
    __pyx_L15_except_error:;

/* "gevent/corecext.pyx":553
 *         except AttributeError:
 *             sigfd = None
 *         try:             # <<<<<<<<<<<<<<
 *             activecnt = self.activecnt
 *         except AttributeError:
 */
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
    goto __pyx_L1_error;
    __pyx_L14_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_5, __pyx_t_4);
    __pyx_L20_try_end:;
  }

/* "gevent/corecext.pyx":557
 *         except AttributeError:
 *             pass
 *         if activecnt is not None:             # <<<<<<<<<<<<<<
 *             msg += ' ref=' + repr(activecnt)
 *         if fileno is not None:
 */
  __pyx_t_8 = (__pyx_v_activecnt != Py_None);
  __pyx_t_9 = (__pyx_t_8 != 0);
  if (__pyx_t_9) {

/* "gevent/corecext.pyx":558
 *             pass
 *         if activecnt is not None:
 *             msg += ' ref=' + repr(activecnt)             # <<<<<<<<<<<<<<
 *         if fileno is not None:
 *             msg += ' fileno=' + repr(fileno)
 */
    __pyx_t_3 = PyObject_Repr(__pyx_v_activecnt); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_ref_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 558; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

/* "gevent/corecext.pyx":557
 *         except AttributeError:
 *             pass
 *         if activecnt is not None:             # <<<<<<<<<<<<<<
 *             msg += ' ref=' + repr(activecnt)
 *         if fileno is not None:
 */
  }

/* "gevent/corecext.pyx":559
 *         if activecnt is not None:
 *             msg += ' ref=' + repr(activecnt)
 *         if fileno is not None:             # <<<<<<<<<<<<<<
 *             msg += ' fileno=' + repr(fileno)
 *         if sigfd is not None and sigfd != -1:
 */
  __pyx_t_9 = (__pyx_v_fileno != Py_None);
  __pyx_t_8 = (__pyx_t_9 != 0);
  if (__pyx_t_8) {

/* "gevent/corecext.pyx":560
 *             msg += ' ref=' + repr(activecnt)
 *         if fileno is not None:
 *             msg += ' fileno=' + repr(fileno)             # <<<<<<<<<<<<<<
 *         if sigfd is not None and sigfd != -1:
 *             msg += ' sigfd=' + repr(sigfd)
 */
    __pyx_t_3 = PyObject_Repr(__pyx_v_fileno); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_fileno_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

/* "gevent/corecext.pyx":559
 *         if activecnt is not None:
 *             msg += ' ref=' + repr(activecnt)
 *         if fileno is not None:             # <<<<<<<<<<<<<<
 *             msg += ' fileno=' + repr(fileno)
 *         if sigfd is not None and sigfd != -1:
 */
  }

/* "gevent/corecext.pyx":561
 *         if fileno is not None:
 *             msg += ' fileno=' + repr(fileno)
 *         if sigfd is not None and sigfd != -1:             # <<<<<<<<<<<<<<
 *             msg += ' sigfd=' + repr(sigfd)
 *         return msg
 */
  __pyx_t_9 = (__pyx_v_sigfd != Py_None);
  __pyx_t_10 = (__pyx_t_9 != 0);
  if (__pyx_t_10) {
  } else {
    __pyx_t_8 = __pyx_t_10;
    goto __pyx_L24_bool_binop_done;
  }
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_sigfd, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_8 = __pyx_t_10;
  __pyx_L24_bool_binop_done:;
  if (__pyx_t_8) {

/* "gevent/corecext.pyx":562
 *             msg += ' fileno=' + repr(fileno)
 *         if sigfd is not None and sigfd != -1:
 *             msg += ' sigfd=' + repr(sigfd)             # <<<<<<<<<<<<<<
 *         return msg
 *
 */
    __pyx_t_3 = PyObject_Repr(__pyx_v_sigfd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyNumber_Add(__pyx_kp_s_sigfd_2, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_msg, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

/* "gevent/corecext.pyx":561
 *         if fileno is not None:
 *             msg += ' fileno=' + repr(fileno)
 *         if sigfd is not None and sigfd != -1:             # <<<<<<<<<<<<<<
 *             msg += ' sigfd=' + repr(sigfd)
 *         return msg
 */
  }

/* "gevent/corecext.pyx":563
 *         if sigfd is not None and sigfd != -1:
 *             msg += ' sigfd=' + repr(sigfd)
 *         return msg             # <<<<<<<<<<<<<<
 *
 *     def fileno(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_msg);
  __pyx_r = __pyx_v_msg;
  goto __pyx_L0;

/* "gevent/corecext.pyx":544
 *
 *
 *     def _format_details(self):             # <<<<<<<<<<<<<<
 *         cdef str msg = ''
 *         cdef object fileno = self.fileno()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.corecext.loop._format_details", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_msg);
  __Pyx_XDECREF(__pyx_v_fileno);
  __Pyx_XDECREF(__pyx_v_sigfd);
  __Pyx_XDECREF(__pyx_v_activecnt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":565
 *         return msg
 *
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         cdef int fd
 *         if self._ptr:
 */

/* Python wrapper */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_61fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_61fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_57fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_57fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("fileno (wrapper)", 0);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_60fileno(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_60fileno(struct PyGeventLoopObject *__pyx_v_self) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_56fileno(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_56fileno(struct PyGeventLoopObject *__pyx_v_self) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  int __pyx_v_fd;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("fileno", 0);

/* "gevent/corecext.pyx":567
 *     def fileno(self):
 *         cdef int fd
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             fd = self._ptr.backend_fd
 *             if fd >= 0:
 */
  __pyx_t_1 = (__pyx_v_self->_ptr != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":568
 *         cdef int fd
 *         if self._ptr:
 *             fd = self._ptr.backend_fd             # <<<<<<<<<<<<<<
 *             if fd >= 0:
 *                 return fd
 */
    __pyx_t_2 = __pyx_v_self->_ptr->backend_fd;
    __pyx_v_fd = __pyx_t_2;

/* "gevent/corecext.pyx":569
 *         if self._ptr:
 *             fd = self._ptr.backend_fd
 *             if fd >= 0:             # <<<<<<<<<<<<<<
 *                 return fd
 *
 */
    __pyx_t_1 = ((__pyx_v_fd >= 0) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":570
 *             fd = self._ptr.backend_fd
 *             if fd >= 0:
 *                 return fd             # <<<<<<<<<<<<<<
 *
 *     property activecnt:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 570; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":569
 *         if self._ptr:
 *             fd = self._ptr.backend_fd
 *             if fd >= 0:             # <<<<<<<<<<<<<<
 *                 return fd
 *
 */
    }

/* "gevent/corecext.pyx":567
 *     def fileno(self):
 *         cdef int fd
 *         if self._ptr:             # <<<<<<<<<<<<<<
 *             fd = self._ptr.backend_fd
 *             if fd >= 0:
 */
  }

/* "gevent/corecext.pyx":565
 *         return msg
 *
 *     def fileno(self):             # <<<<<<<<<<<<<<
 *         cdef int fd
 *         if self._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.corecext.loop.fileno", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":574
 *     property activecnt:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9activecnt_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_9activecnt___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":576
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.activecnt
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":577
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.activecnt
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":576
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.activecnt
 */
  }

/* "gevent/corecext.pyx":578
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.activecnt             # <<<<<<<<<<<<<<
 *
 *     property sig_pending:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_ptr->activecnt); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":574
 *     property activecnt:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

/* "gevent/corecext.pyx":582
 *     property sig_pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_11sig_pending___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":584
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.sig_pending
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":585
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sig_pending
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":584
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.sig_pending
 */
  }

/* "gevent/corecext.pyx":586
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.sig_pending             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_ptr->sig_pending); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":582
 *     property sig_pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":600
 *     property origflags:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":591
 *     property sigfd:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))

/* Python wrapper */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) {
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_pw_6gevent_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_5sigfd_1__get__(PyObject *__pyx_v_self) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self) {
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_5sigfd___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4loop_5sigfd___get__(struct PyGeventLoopObject *__pyx_v_self) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":593
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.sigfd
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":594
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sigfd
 *
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":593
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.sigfd
 */
  }

/* "gevent/corecext.pyx":595
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.sigfd             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->_ptr->sigfd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":591
 *     property sigfd:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

/* "gevent/corecext.pyx":600
 *     property origflags:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_9origflags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":602
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return _flags_to_list(self._ptr.origflags)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":603
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return _flags_to_list(self._ptr.origflags)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":602
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return _flags_to_list(self._ptr.origflags)
 */
  }

/* "gevent/corecext.pyx":604
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return _flags_to_list(self._ptr.origflags)             # <<<<<<<<<<<<<<
 *
 *     property origflags_int:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __pyx_f_6gevent_8corecext__flags_to_list(__pyx_v_self->_ptr->origflags, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":600
 *     property origflags:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

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

/* "gevent/corecext.pyx":608
 *     property origflags_int:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_13origflags_int___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":610
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.origflags
 */
  __pyx_t_1 = ((!(__pyx_v_self->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":611
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.origflags
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":610
 *         def __get__(self):
 *
 *             if not self._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.origflags
 */
  }

/* "gevent/corecext.pyx":612
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             return self._ptr.origflags             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_ptr->origflags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 612; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":608
 *     property origflags_int:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *
 *             if not self._ptr:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.loop.origflags_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":241
 * cdef public class loop [object PyGeventLoopObject, type PyGeventLoop_Type]:
 *     cdef libev.ev_loop* _ptr
 *     cdef public object error_handler             # <<<<<<<<<<<<<<
 *     cdef libev.ev_prepare _prepare
 *     cdef public list _callbacks
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_13error_handler_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_13error_handler___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_13error_handler_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->error_handler);
  __Pyx_DECREF(__pyx_v_self->error_handler);
  __pyx_v_self->error_handler = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_4loop_13error_handler_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_13error_handler_4__del__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->error_handler);
  __Pyx_DECREF(__pyx_v_self->error_handler);
  __pyx_v_self->error_handler = Py_None;

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

/* "gevent/corecext.pyx":243
 *     cdef public object error_handler
 *     cdef libev.ev_prepare _prepare
 *     cdef public list _callbacks             # <<<<<<<<<<<<<<
 *     cdef libev.ev_timer _timer0
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_10_callbacks___get__(((struct PyGeventLoopObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_10_callbacks_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyList_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->_callbacks);
  __Pyx_DECREF(__pyx_v_self->_callbacks);
  __pyx_v_self->_callbacks = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.loop._callbacks.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4loop_10_callbacks_4__del__(((struct PyGeventLoopObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callbacks);
  __Pyx_DECREF(__pyx_v_self->_callbacks);
  __pyx_v_self->_callbacks = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":621
 *     cdef public tuple args
 *
 *     def __init__(self, callback, args):             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_args,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_args)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_callback = values[0];
    __pyx_v_args = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 621; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback___init__(((struct PyGeventCallbackObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static int __pyx_pf_6gevent_8corecext_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":622
 *
 *     def __init__(self, callback, args):
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->callback);
  __Pyx_DECREF(__pyx_v_self->callback);
  __pyx_v_self->callback = __pyx_v_callback;

/* "gevent/corecext.pyx":623
 *     def __init__(self, callback, args):
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v_args))||((__pyx_v_args) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_args)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_args;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

/* "gevent/corecext.pyx":621
 *     cdef public tuple args
 *
 *     def __init__(self, callback, args):             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */

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

/* "gevent/corecext.pyx":625
 *         self.args = args
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *         self.callback = None
 *         self.args = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_2stop(((struct PyGeventCallbackObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop", 0);

/* "gevent/corecext.pyx":626
 *
 *     def stop(self):
 *         self.callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->callback);
  __Pyx_DECREF(__pyx_v_self->callback);
  __pyx_v_self->callback = Py_None;

/* "gevent/corecext.pyx":627
 *     def stop(self):
 *         self.callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *
 *     # Note, that __nonzero__ and pending are different
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":625
 *         self.args = args
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *         self.callback = None
 *         self.args = None
 */

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

/* "gevent/corecext.pyx":634
 *     # 'pending' has the same meaning as libev watchers: it is cleared before entering callback
 *
 *     def __nonzero__(self):             # <<<<<<<<<<<<<<
 *         # it's nonzero if it's pending or currently executing
 *         return self.args is not None
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_8callback_5__nonzero__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_4__nonzero__(((struct PyGeventCallbackObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__nonzero__", 0);

/* "gevent/corecext.pyx":636
 *     def __nonzero__(self):
 *         # it's nonzero if it's pending or currently executing
 *         return self.args is not None             # <<<<<<<<<<<<<<
 *
 *     property pending:
 */
  __pyx_t_1 = (__pyx_v_self->args != ((PyObject*)Py_None));
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

/* "gevent/corecext.pyx":634
 *     # 'pending' has the same meaning as libev watchers: it is cleared before entering callback
 *
 *     def __nonzero__(self):             # <<<<<<<<<<<<<<
 *         # it's nonzero if it's pending or currently executing
 *         return self.args is not None
 */

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

/* "gevent/corecext.pyx":640
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.callback is not None
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_8callback_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_7pending___get__(((struct PyGeventCallbackObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":641
 *
 *         def __get__(self):
 *             return self.callback is not None             # <<<<<<<<<<<<<<
 *
 *     def __repr__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (__pyx_v_self->callback != Py_None);
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":640
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.callback is not None
 *
 */

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

/* "gevent/corecext.pyx":643
 *             return self.callback is not None
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_8callback_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_8callback_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_6__repr__(((struct PyGeventCallbackObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self) {
  PyObject *__pyx_v_format = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  char const *__pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

/* "gevent/corecext.pyx":644
 *
 *     def __repr__(self):
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:             # <<<<<<<<<<<<<<
 *             return "<...>"
 *         try:
 */
  __pyx_t_1 = ((Py_ReprEnter(((PyObject*)__pyx_v_self)) != 0) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":645
 *     def __repr__(self):
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"             # <<<<<<<<<<<<<<
 *         try:
 *             format = self._format()
 */
    __Pyx_XDECREF(__pyx_r);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __Pyx_INCREF(__pyx_kp_s__21);
    __pyx_r = __pyx_kp_s__21;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __Pyx_INCREF(__pyx_kp_s__26);
    __pyx_r = __pyx_kp_s__26;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __Pyx_INCREF(__pyx_kp_s__27);
    __pyx_r = __pyx_kp_s__27;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    goto __pyx_L0;

/* "gevent/corecext.pyx":644
 *
 *     def __repr__(self):
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:             # <<<<<<<<<<<<<<
 *             return "<...>"
 *         try:
 */
  }

/* "gevent/corecext.pyx":646
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"
 *         try:             # <<<<<<<<<<<<<<
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 */
  /*try:*/ {

/* "gevent/corecext.pyx":647
 *             return "<...>"
 *         try:
 *             format = self._format()             # <<<<<<<<<<<<<<
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.pending:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_format = __pyx_t_2;
    __pyx_t_2 = 0;

/* "gevent/corecext.pyx":648
 *         try:
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)             # <<<<<<<<<<<<<<
 *             if self.pending:
 *                 result += " pending"
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_format);
    __Pyx_GIVEREF(__pyx_v_format);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_format);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_result = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

/* "gevent/corecext.pyx":649
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.pending:             # <<<<<<<<<<<<<<
 *                 result += " pending"
 *             if self.callback is not None:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":650
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.pending:
 *                 result += " pending"             # <<<<<<<<<<<<<<
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )
 */
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

/* "gevent/corecext.pyx":649
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.pending:             # <<<<<<<<<<<<<<
 *                 result += " pending"
 *             if self.callback is not None:
 */
    }

/* "gevent/corecext.pyx":651
 *             if self.pending:
 *                 result += " pending"
 *             if self.callback is not None:             # <<<<<<<<<<<<<<
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:
 */
    __pyx_t_1 = (__pyx_v_self->callback != Py_None);
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

/* "gevent/corecext.pyx":652
 *                 result += " pending"
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )             # <<<<<<<<<<<<<<
 *             if self.args is not None:
 *                 result += " args=%r" % (self.args, )
 */
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_self->callback);
      __Pyx_GIVEREF(__pyx_v_self->callback);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->callback);
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

/* "gevent/corecext.pyx":651
 *             if self.pending:
 *                 result += " pending"
 *             if self.callback is not None:             # <<<<<<<<<<<<<<
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:
 */
    }

/* "gevent/corecext.pyx":653
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:             # <<<<<<<<<<<<<<
 *                 result += " args=%r" % (self.args, )
 *             if self.callback is None and self.args is None:
 */
    __pyx_t_5 = (__pyx_v_self->args != ((PyObject*)Py_None));
    __pyx_t_1 = (__pyx_t_5 != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":654
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:
 *                 result += " args=%r" % (self.args, )             # <<<<<<<<<<<<<<
 *             if self.callback is None and self.args is None:
 *                 result += " stopped"
 */
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_self->args);
      __Pyx_GIVEREF(__pyx_v_self->args);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->args);
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 654; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

/* "gevent/corecext.pyx":653
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:             # <<<<<<<<<<<<<<
 *                 result += " args=%r" % (self.args, )
 *             if self.callback is None and self.args is None:
 */
    }

/* "gevent/corecext.pyx":655
 *             if self.args is not None:
 *                 result += " args=%r" % (self.args, )
 *             if self.callback is None and self.args is None:             # <<<<<<<<<<<<<<
 *                 result += " stopped"
 *             return result + ">"
 */
    __pyx_t_5 = (__pyx_v_self->callback == Py_None);
    __pyx_t_6 = (__pyx_t_5 != 0);
    if (__pyx_t_6) {
    } else {
      __pyx_t_1 = __pyx_t_6;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->args == ((PyObject*)Py_None));
    __pyx_t_5 = (__pyx_t_6 != 0);
    __pyx_t_1 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":656
 *                 result += " args=%r" % (self.args, )
 *             if self.callback is None and self.args is None:
 *                 result += " stopped"             # <<<<<<<<<<<<<<
 *             return result + ">"
 *         finally:
 */
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_stopped); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

/* "gevent/corecext.pyx":655
 *             if self.args is not None:
 *                 result += " args=%r" % (self.args, )
 *             if self.callback is None and self.args is None:             # <<<<<<<<<<<<<<
 *                 result += " stopped"
 *             return result + ">"
 */
    }

/* "gevent/corecext.pyx":657
 *             if self.callback is None and self.args is None:
 *                 result += " stopped"
 *             return result + ">"             # <<<<<<<<<<<<<<
 *         finally:
 *             Py_ReprLeave(<PyObjectPtr>self)
 */
    __Pyx_XDECREF(__pyx_r);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__22); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__27); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__28); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L4_return;
  }

/* "gevent/corecext.pyx":659
 *             return result + ">"
 *         finally:
 *             Py_ReprLeave(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
  /*finally:*/ {
    /*exception exit:*/{
      __pyx_L5_error:;
      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_13, &__pyx_t_14, &__pyx_t_15);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12) < 0)) __Pyx_ErrFetch(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __Pyx_XGOTREF(__pyx_t_15);
      __pyx_t_7 = __pyx_lineno; __pyx_t_8 = __pyx_clineno; __pyx_t_9 = __pyx_filename;
      {
        Py_ReprLeave(((PyObject*)__pyx_v_self));
      }
      if (PY_MAJOR_VERSION >= 3) {
        __Pyx_XGIVEREF(__pyx_t_13);
        __Pyx_XGIVEREF(__pyx_t_14);
        __Pyx_XGIVEREF(__pyx_t_15);
        __Pyx_ExceptionReset(__pyx_t_13, __pyx_t_14, __pyx_t_15);
      }
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_XGIVEREF(__pyx_t_12);
      __Pyx_ErrRestore(__pyx_t_10, __pyx_t_11, __pyx_t_12);
      __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0; __pyx_t_15 = 0;
      __pyx_lineno = __pyx_t_7; __pyx_clineno = __pyx_t_8; __pyx_filename = __pyx_t_9;
      goto __pyx_L1_error;
    }
    __pyx_L4_return: {
      __pyx_t_15 = __pyx_r;
      __pyx_r = 0;
      Py_ReprLeave(((PyObject*)__pyx_v_self));
      __pyx_r = __pyx_t_15;
      __pyx_t_15 = 0;
      goto __pyx_L0;
    }
  }

/* "gevent/corecext.pyx":643
 *             return self.callback is not None
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gevent.corecext.callback.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":661
 *             Py_ReprLeave(<PyObjectPtr>self)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ''
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_8_format(((struct PyGeventCallbackObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format", 0);

/* "gevent/corecext.pyx":662
 *
 *     def _format(self):
 *         return ''             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_INCREF(__pyx_kp_s__23);
  __pyx_r = __pyx_kp_s__23;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_INCREF(__pyx_kp_s__21);
  __pyx_r = __pyx_kp_s__21;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  goto __pyx_L0;

/* "gevent/corecext.pyx":661
 *             Py_ReprLeave(<PyObjectPtr>self)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ''
 *
 */

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

/* "gevent/corecext.pyx":618
 *
 * cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]:
 *     cdef public object callback             # <<<<<<<<<<<<<<
 *     cdef public tuple args
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_8callback_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_8callback___get__(((struct PyGeventCallbackObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_8callback_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->callback);
  __Pyx_DECREF(__pyx_v_self->callback);
  __pyx_v_self->callback = __pyx_v_value;

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_8callback_8callback_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_8callback_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->callback);
  __Pyx_DECREF(__pyx_v_self->callback);
  __pyx_v_self->callback = Py_None;

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

/* "gevent/corecext.pyx":619
 * cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]:
 *     cdef public object callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *
 *     def __init__(self, callback, args):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_8callback_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_4args___get__(((struct PyGeventCallbackObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_4args_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.callback.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_8callback_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_8callback_4args_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":688
 *     """Abstract base class for all the watchers"""
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7watcher_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7watcher_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7watcher___repr__(((struct PyGeventWatcherObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_7watcher___repr__(struct PyGeventWatcherObject *__pyx_v_self) {
  PyObject *__pyx_v_format = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  char const *__pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

/* "gevent/corecext.pyx":689
 *
 *     def __repr__(self):
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:             # <<<<<<<<<<<<<<
 *             return "<...>"
 *         try:
 */
  __pyx_t_1 = ((Py_ReprEnter(((PyObject*)__pyx_v_self)) != 0) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":690
 *     def __repr__(self):
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"             # <<<<<<<<<<<<<<
 *         try:
 *             format = self._format()
 */
    __Pyx_XDECREF(__pyx_r);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __Pyx_INCREF(__pyx_kp_s__21);
    __pyx_r = __pyx_kp_s__21;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __Pyx_INCREF(__pyx_kp_s__26);
    __pyx_r = __pyx_kp_s__26;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __Pyx_INCREF(__pyx_kp_s__27);
    __pyx_r = __pyx_kp_s__27;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    goto __pyx_L0;

/* "gevent/corecext.pyx":689
 *
 *     def __repr__(self):
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:             # <<<<<<<<<<<<<<
 *             return "<...>"
 *         try:
 */
  }

/* "gevent/corecext.pyx":691
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"
 *         try:             # <<<<<<<<<<<<<<
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 */
  /*try:*/ {

/* "gevent/corecext.pyx":692
 *             return "<...>"
 *         try:
 *             format = self._format()             # <<<<<<<<<<<<<<
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.active:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (__pyx_t_4) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    }
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_format = __pyx_t_2;
    __pyx_t_2 = 0;

/* "gevent/corecext.pyx":693
 *         try:
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)             # <<<<<<<<<<<<<<
 *             if self.active:
 *                 result += " active"
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_class); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_id, __pyx_t_2, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_format);
    __Pyx_GIVEREF(__pyx_v_format);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_format);
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_s_at_0x_x_s_2, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_result = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

/* "gevent/corecext.pyx":694
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.active:             # <<<<<<<<<<<<<<
 *                 result += " active"
 *             if self.pending:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_active); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":695
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.active:
 *                 result += " active"             # <<<<<<<<<<<<<<
 *             if self.pending:
 *                 result += " pending"
 */
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_active_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

/* "gevent/corecext.pyx":694
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.active:             # <<<<<<<<<<<<<<
 *                 result += " active"
 *             if self.pending:
 */
    }

/* "gevent/corecext.pyx":696
 *             if self.active:
 *                 result += " active"
 *             if self.pending:             # <<<<<<<<<<<<<<
 *                 result += " pending"
 *             if self.callback is not None:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pending); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":697
 *                 result += " active"
 *             if self.pending:
 *                 result += " pending"             # <<<<<<<<<<<<<<
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )
 */
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s_pending_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 697; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

/* "gevent/corecext.pyx":696
 *             if self.active:
 *                 result += " active"
 *             if self.pending:             # <<<<<<<<<<<<<<
 *                 result += " pending"
 *             if self.callback is not None:
 */
    }

/* "gevent/corecext.pyx":698
 *             if self.pending:
 *                 result += " pending"
 *             if self.callback is not None:             # <<<<<<<<<<<<<<
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = (__pyx_t_4 != Py_None);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = (__pyx_t_1 != 0);
    if (__pyx_t_5) {

/* "gevent/corecext.pyx":699
 *                 result += " pending"
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )             # <<<<<<<<<<<<<<
 *             if self.args is not None:
 *                 result += " args=%r" % (self.args, )
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_callback_r, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 699; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

/* "gevent/corecext.pyx":698
 *             if self.pending:
 *                 result += " pending"
 *             if self.callback is not None:             # <<<<<<<<<<<<<<
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:
 */
    }

/* "gevent/corecext.pyx":700
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:             # <<<<<<<<<<<<<<
 *                 result += " args=%r" % (self.args, )
 *             return result + ">"
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 700; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = (__pyx_t_2 != Py_None);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = (__pyx_t_5 != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":701
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:
 *                 result += " args=%r" % (self.args, )             # <<<<<<<<<<<<<<
 *             return result + ">"
 *         finally:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_args_r, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_4));
      __pyx_t_4 = 0;

/* "gevent/corecext.pyx":700
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:             # <<<<<<<<<<<<<<
 *                 result += " args=%r" % (self.args, )
 *             return result + ">"
 */
    }

/* "gevent/corecext.pyx":702
 *             if self.args is not None:
 *                 result += " args=%r" % (self.args, )
 *             return result + ">"             # <<<<<<<<<<<<<<
 *         finally:
 *             Py_ReprLeave(<PyObjectPtr>self)
 */
    __Pyx_XDECREF(__pyx_r);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__22); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__27); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, __pyx_kp_s__28); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L4_return;
  }

/* "gevent/corecext.pyx":704
 *             return result + ">"
 *         finally:
 *             Py_ReprLeave(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
  /*finally:*/ {
    /*exception exit:*/{
      __pyx_L5_error:;
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
      if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11) < 0)) __Pyx_ErrFetch(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_11);
      __Pyx_XGOTREF(__pyx_t_12);
      __Pyx_XGOTREF(__pyx_t_13);
      __Pyx_XGOTREF(__pyx_t_14);
      __pyx_t_6 = __pyx_lineno; __pyx_t_7 = __pyx_clineno; __pyx_t_8 = __pyx_filename;
      {
        Py_ReprLeave(((PyObject*)__pyx_v_self));
      }
      if (PY_MAJOR_VERSION >= 3) {
        __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_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_XGIVEREF(__pyx_t_11);
      __Pyx_ErrRestore(__pyx_t_9, __pyx_t_10, __pyx_t_11);
      __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0; __pyx_t_13 = 0; __pyx_t_14 = 0;
      __pyx_lineno = __pyx_t_6; __pyx_clineno = __pyx_t_7; __pyx_filename = __pyx_t_8;
      goto __pyx_L1_error;
    }
    __pyx_L4_return: {
      __pyx_t_14 = __pyx_r;
      __pyx_r = 0;
      Py_ReprLeave(((PyObject*)__pyx_v_self));
      __pyx_r = __pyx_t_14;
      __pyx_t_14 = 0;
      goto __pyx_L0;
    }
  }

/* "gevent/corecext.pyx":688
 *     """Abstract base class for all the watchers"""
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gevent.corecext.watcher.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":706
 *             Py_ReprLeave(<PyObjectPtr>self)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ''
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7watcher_3_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7watcher_3_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7watcher_2_format(((struct PyGeventWatcherObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_7watcher_2_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format", 0);

/* "gevent/corecext.pyx":707
 *
 *     def _format(self):
 *         return ''             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_INCREF(__pyx_kp_s__23);
  __pyx_r = __pyx_kp_s__23;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_INCREF(__pyx_kp_s__21);
  __pyx_r = __pyx_kp_s__21;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  goto __pyx_L0;

/* "gevent/corecext.pyx":706
 *             Py_ReprLeave(<PyObjectPtr>self)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ''
 *
 */

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

/* "gevent/corecext.pyx":721
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_3ref___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_3ref___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":722
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":721
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":724
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_3ref_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_2io_3ref_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":726
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":727
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":726
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":728
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":729
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":730
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":729
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":731
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":732
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":731
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":733
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":728
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":735
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":736
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":735
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":737
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":738
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":739
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":740
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":738
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":724
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.io.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":744
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_8callback___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_8callback___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":745
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":744
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":747
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_8callback_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":748
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":749
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":748
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":750
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":747
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.io.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":752
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_stop(((struct PyGeventIOObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":754
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":755
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":754
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":756
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":757
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_io_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":758
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_io_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":756
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":759
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_io_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_io_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":760
 *             self._flags &= ~2
 *         libev.ev_io_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":761
 *         libev.ev_io_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":762
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":763
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":764
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":762
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":752
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.io.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":768
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_8priority___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_8priority___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":769
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":768
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":771
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.io.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_8priority_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_2io_8priority_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":772
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":773
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":772
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":774
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":771
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.io.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":776
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.io.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_2feed(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_2feed(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":778
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":779
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":778
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":780
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":781
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":782
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":783
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":784
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":782
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":785
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":786
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":787
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":788
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args, pass_events=False):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":786
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":776
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.io.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":790
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args, pass_events=False):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_pass_events = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_pass_events,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_False);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (kw_args == 1) {
        const Py_ssize_t index = 1;
        PyObject* value = PyDict_GetItem(__pyx_kwds, *__pyx_pyargnames[index]);
        if (value) { values[index] = value; kw_args--; }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
    __pyx_v_pass_events = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_4start(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_pass_events, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_4start(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_pass_events, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":792
 *     def start(self, object callback, *args, pass_events=False):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":793
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":792
 *     def start(self, object callback, *args, pass_events=False):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":794
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":795
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         if pass_events:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":794
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":796
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         if pass_events:
 *             self.args = (GEVENT_CORE_EVENTS, ) + args
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":797
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         if pass_events:             # <<<<<<<<<<<<<<
 *             self.args = (GEVENT_CORE_EVENTS, ) + args
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_pass_events); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":798
 *         self.callback = callback
 *         if pass_events:
 *             self.args = (GEVENT_CORE_EVENTS, ) + args             # <<<<<<<<<<<<<<
 *         else:
 *             self.args = args
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(GEVENT_CORE_EVENTS);
    __Pyx_GIVEREF(GEVENT_CORE_EVENTS);
    PyTuple_SET_ITEM(__pyx_t_2, 0, GEVENT_CORE_EVENTS);
    __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(__pyx_v_self->args);
    __pyx_v_self->args = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;

/* "gevent/corecext.pyx":797
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         if pass_events:             # <<<<<<<<<<<<<<
 *             self.args = (GEVENT_CORE_EVENTS, ) + args
 *         else:
 */
    goto __pyx_L5;
  }

/* "gevent/corecext.pyx":800
 *             self.args = (GEVENT_CORE_EVENTS, ) + args
 *         else:
 *             self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  /*else*/ {
    __Pyx_INCREF(__pyx_v_args);
    __Pyx_GIVEREF(__pyx_v_args);
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(__pyx_v_self->args);
    __pyx_v_self->args = __pyx_v_args;
  }
  __pyx_L5:;

/* "gevent/corecext.pyx":801
 *         else:
 *             self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":802
 *             self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_io_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":803
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_io_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":801
 *         else:
 *             self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":804
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_io_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_io_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":805
 *             self._flags |= 2
 *         libev.ev_io_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":806
 *         libev.ev_io_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":807
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":805
 *             self._flags |= 2
 *         libev.ev_io_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":790
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args, pass_events=False):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

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

/* "gevent/corecext.pyx":811
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_6active___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_6active___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":812
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":811
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":817
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_7pending___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_7pending___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":818
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":817
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":838
 *
 *
 *     def __init__(self, loop loop, int fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         if fd < 0:
 *             raise ValueError('fd must be non-negative: %r' % fd)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":822
 *
 *
 *     def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 *             raise ValueError('illegal event mask: %r' % events)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  int __pyx_v_fd;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  vfd_socket_t __pyx_v_fd;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  int __pyx_v_events;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_fd,&__pyx_n_s_events_2,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_fd)) != 0)) kw_args--;
        else {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
        }
        case  2:
        if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_events_2)) != 0)) kw_args--;
        else {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __pyx_v_fd = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
    __pyx_v_fd = __Pyx_PyInt_As_vfd_socket_t(values[1]); if (unlikely((__pyx_v_fd == (vfd_socket_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_events = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __pyx_v_ref = values[3];
    __pyx_v_priority = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_6__init__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);

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

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static int __pyx_pf_6gevent_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static int __pyx_pf_6gevent_8corecext_2io_6__init__(struct PyGeventIOObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, vfd_socket_t __pyx_v_fd, int __pyx_v_events, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  int __pyx_v_vfd;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":839
 *
 *     def __init__(self, loop loop, int fd, int events, ref=True, priority=None):
 *         if fd < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('fd must be non-negative: %r' % fd)
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 */
  __pyx_t_1 = ((__pyx_v_fd < 0) != 0);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":823
 *
 *     def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):             # <<<<<<<<<<<<<<
 *             raise ValueError('illegal event mask: %r' % events)
 *         cdef int vfd = libev.vfd_open(fd)
 */
  __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  if (__pyx_t_1) {

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":840
 *     def __init__(self, loop loop, int fd, int events, ref=True, priority=None):
 *         if fd < 0:
 *             raise ValueError('fd must be non-negative: %r' % fd)             # <<<<<<<<<<<<<<
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 *             raise ValueError('illegal event mask: %r' % events)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_fd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":824
 *     def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 *             raise ValueError('illegal event mask: %r' % events)             # <<<<<<<<<<<<<<
 *         cdef int vfd = libev.vfd_open(fd)
 *         libev.vfd_free(self._watcher.fd)
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_fd_must_be_non_negative_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":839
 *
 *     def __init__(self, loop loop, int fd, int events, ref=True, priority=None):
 *         if fd < 0:             # <<<<<<<<<<<<<<
 *             raise ValueError('fd must be non-negative: %r' % fd)
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 */
  }

/* "gevent/corecext.pyx":841
 *         if fd < 0:
 *             raise ValueError('fd must be non-negative: %r' % fd)
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):             # <<<<<<<<<<<<<<
 *             raise ValueError('illegal event mask: %r' % events)
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events)
 */
  __pyx_t_1 = ((__pyx_v_events & (~((EV__IOFDSET | EV_READ) | EV_WRITE))) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":842
 *             raise ValueError('fd must be non-negative: %r' % fd)
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 *             raise ValueError('illegal event mask: %r' % events)             # <<<<<<<<<<<<<<
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events)
 *         self.loop = loop
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_events); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_illegal_event_mask_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":841
 *         if fd < 0:
 *             raise ValueError('fd must be non-negative: %r' % fd)
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):             # <<<<<<<<<<<<<<
 *             raise ValueError('illegal event mask: %r' % events)
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events)
 */
  }

/* "gevent/corecext.pyx":843
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 *             raise ValueError('illegal event mask: %r' % events)
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events)             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_fd, __pyx_v_events);

/* "gevent/corecext.pyx":844
 *             raise ValueError('illegal event mask: %r' % events)
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events)
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":823
 *
 *     def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):             # <<<<<<<<<<<<<<
 *             raise ValueError('illegal event mask: %r' % events)
 *         cdef int vfd = libev.vfd_open(fd)
 */
  }

/* "gevent/corecext.pyx":825
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 *             raise ValueError('illegal event mask: %r' % events)
 *         cdef int vfd = libev.vfd_open(fd)             # <<<<<<<<<<<<<<
 *         libev.vfd_free(self._watcher.fd)
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
 */
  __pyx_t_4 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_vfd = __pyx_t_4;

/* "gevent/corecext.pyx":826
 *             raise ValueError('illegal event mask: %r' % events)
 *         cdef int vfd = libev.vfd_open(fd)
 *         libev.vfd_free(self._watcher.fd)             # <<<<<<<<<<<<<<
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
 *         self.loop = loop
 */
  vfd_free(__pyx_v_self->_watcher.fd);

/* "gevent/corecext.pyx":827
 *         cdef int vfd = libev.vfd_open(fd)
 *         libev.vfd_free(self._watcher.fd)
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_events);

/* "gevent/corecext.pyx":828
 *         libev.vfd_free(self._watcher.fd)
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":845
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":829
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  if (__pyx_t_1) {

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":846
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":830
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __pyx_v_self->_flags = 0;

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":845
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, fd, events)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L5;
  }

/* "gevent/corecext.pyx":848
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":829
 *         libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, events)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":832
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_L5:;

/* "gevent/corecext.pyx":849
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_L4:;

/* "gevent/corecext.pyx":833
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __pyx_t_1 = (__pyx_v_priority != Py_None);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (__pyx_t_4) {

/* "gevent/corecext.pyx":850
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_5);

/* "gevent/corecext.pyx":849
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":838
 *
 *
 *     def __init__(self, loop loop, int fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         if fd < 0:
 *             raise ValueError('fd must be non-negative: %r' % fd)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __pyx_t_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

/* "gevent/corecext.pyx":834
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_4);

/* "gevent/corecext.pyx":833
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":822
 *
 *
 *     def __init__(self, loop loop, libev.vfd_socket_t fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         if events & ~(libev.EV__IOFDSET | libev.EV_READ | libev.EV_WRITE):
 *             raise ValueError('illegal event mask: %r' % events)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

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

/* "gevent/corecext.pyx":856
 *     property fd:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.vfd_get(self._watcher.fd)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_2fd_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_2fd___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":857
 *
 *         def __get__(self):
 *             return libev.vfd_get(self._watcher.fd)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, long fd):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(vfd_get(__pyx_v_self->_watcher.fd)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":856
 *     property fd:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.vfd_get(self._watcher.fd)
 *
 */

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

/* "gevent/corecext.pyx":859
 *             return libev.vfd_get(self._watcher.fd)
 *
 *         def __set__(self, long fd):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd) {
  long __pyx_v_fd;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_fd); {
    __pyx_v_fd = __Pyx_PyInt_As_long(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_2fd_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((long)__pyx_v_fd));

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

static int __pyx_pf_6gevent_8corecext_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd) {
  int __pyx_v_vfd;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":860
 *
 *         def __set__(self, long fd):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
 *             cdef int vfd = libev.vfd_open(fd)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":861
 *         def __set__(self, long fd):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")             # <<<<<<<<<<<<<<
 *             cdef int vfd = libev.vfd_open(fd)
 *             libev.vfd_free(self._watcher.fd)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":860
 *
 *         def __set__(self, long fd):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
 *             cdef int vfd = libev.vfd_open(fd)
 */
  }

/* "gevent/corecext.pyx":862
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
 *             cdef int vfd = libev.vfd_open(fd)             # <<<<<<<<<<<<<<
 *             libev.vfd_free(self._watcher.fd)
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, self._watcher.events)
 */
  __pyx_t_3 = vfd_open(__pyx_v_fd); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_vfd = __pyx_t_3;

/* "gevent/corecext.pyx":863
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
 *             cdef int vfd = libev.vfd_open(fd)
 *             libev.vfd_free(self._watcher.fd)             # <<<<<<<<<<<<<<
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, self._watcher.events)
 *
 */
  vfd_free(__pyx_v_self->_watcher.fd);

/* "gevent/corecext.pyx":864
 *             cdef int vfd = libev.vfd_open(fd)
 *             libev.vfd_free(self._watcher.fd)
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, vfd, self._watcher.events)             # <<<<<<<<<<<<<<
 *
 *     property events:
 */
  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_vfd, __pyx_v_self->_watcher.events);

/* "gevent/corecext.pyx":859
 *             return libev.vfd_get(self._watcher.fd)
 *
 *         def __set__(self, long fd):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":868
 *     property events:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.events
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_6events_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_6events___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":869
 *
 *         def __get__(self):
 *             return self._watcher.events             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int events):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.events); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":868
 *     property events:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.events
 *
 */

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

/* "gevent/corecext.pyx":871
 *             return self._watcher.events
 *
 *         def __set__(self, int events):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events) {
  int __pyx_v_events;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_events); {
    __pyx_v_events = __Pyx_PyInt_As_int(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_6events_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_events));

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

static int __pyx_pf_6gevent_8corecext_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":872
 *
 *         def __set__(self, int events):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":873
 *         def __set__(self, int events):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")             # <<<<<<<<<<<<<<
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":872
 *
 *         def __set__(self, int events):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)
 */
  }

/* "gevent/corecext.pyx":874
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)             # <<<<<<<<<<<<<<
 *
 *     property events_str:
 */
  ev_io_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_io), __pyx_v_self->_watcher.fd, __pyx_v_events);

/* "gevent/corecext.pyx":871
 *             return self._watcher.events
 *
 *         def __set__(self, int events):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":878
 *     property events_str:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _events_to_str(self._watcher.events)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_10events_str_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_10events_str___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":879
 *
 *         def __get__(self):
 *             return _events_to_str(self._watcher.events)             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext__events_to_str(__pyx_v_self->_watcher.events, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":878
 *     property events_str:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _events_to_str(self._watcher.events)
 *
 */

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

/* "gevent/corecext.pyx":881
 *             return _events_to_str(self._watcher.events)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ' fd=%s events=%s' % (self.fd, self.events_str)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_8_format(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_8_format(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_format", 0);

/* "gevent/corecext.pyx":882
 *
 *     def _format(self):
 *         return ' fd=%s events=%s' % (self.fd, self.events_str)             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_events_str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_fd_s_events_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":881
 *             return _events_to_str(self._watcher.events)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ' fd=%s events=%s' % (self.fd, self.events_str)
 *
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.corecext.io._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
/* "gevent/corecext.pyx":886
 *
 *
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._watcher.fd = -1;
 *
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_11__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_11__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_10__cinit__(((struct PyGeventIOObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_2io_10__cinit__(struct PyGeventIOObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

/* "gevent/corecext.pyx":887
 *
 *     def __cinit__(self):
 *         self._watcher.fd = -1;             # <<<<<<<<<<<<<<
 *
 *     def __dealloc__(self):
 */
  __pyx_v_self->_watcher.fd = -1;

/* "gevent/corecext.pyx":886
 *
 *
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._watcher.fd = -1;
 *
 */

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

/* "gevent/corecext.pyx":889
 *         self._watcher.fd = -1;
 *
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         libev.vfd_free(self._watcher.fd)
 *
 */

/* Python wrapper */
static void __pyx_pw_6gevent_8corecext_2io_13__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6gevent_8corecext_2io_13__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6gevent_8corecext_2io_12__dealloc__(((struct PyGeventIOObject *)__pyx_v_self));

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

static void __pyx_pf_6gevent_8corecext_2io_12__dealloc__(struct PyGeventIOObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

/* "gevent/corecext.pyx":890
 *
 *     def __dealloc__(self):
 *         libev.vfd_free(self._watcher.fd)             # <<<<<<<<<<<<<<
 *
 *
 */
  vfd_free(__pyx_v_self->_watcher.fd);

/* "gevent/corecext.pyx":889
 *         self._watcher.fd = -1;
 *
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         libev.vfd_free(self._watcher.fd)
 *
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32))
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
/* "gevent/corecext.pyx":713
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_4loop___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_4loop_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_2io_4loop_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.io.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_4loop_4__del__(((struct PyGeventIOObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_2io_4loop_4__del__(struct PyGeventIOObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":715
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_io _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_4args___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_4args_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_2io_4args_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.io.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_2io_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_2io_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_4args_4__del__(((struct PyGeventIOObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_2io_4args_4__del__(struct PyGeventIOObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":716
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_io _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_2io_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_2io_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_2io_6_flags___get__(((struct PyGeventIOObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_2io_6_flags___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 716; __pyx_clineno = __LINE__; goto __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.corecext.io._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":906
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_3ref___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_3ref___get__(struct PyGeventTimerObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":907
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":906
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":909
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5timer_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5timer_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_3ref_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5timer_3ref_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":911
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":912
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":911
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":913
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":914
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":915
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":914
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":916
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":917
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":916
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":918
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":913
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":920
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":921
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":920
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":922
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":923
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":924
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":925
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":923
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":909
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.timer.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":929
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_8callback___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_8callback___get__(struct PyGeventTimerObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":930
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":929
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":932
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5timer_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_5timer_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_8callback_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":933
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":934
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":933
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":935
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":932
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.timer.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":937
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_stop(((struct PyGeventTimerObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":939
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":940
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":939
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":941
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":942
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_timer_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":943
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_timer_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":941
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":944
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_timer_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_timer_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":945
 *             self._flags &= ~2
 *         libev.ev_timer_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":946
 *         libev.ev_timer_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":947
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":948
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":949
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":947
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":937
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.timer.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":953
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_8priority___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_8priority___get__(struct PyGeventTimerObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":954
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":953
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":956
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5timer_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_5timer_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 956; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.timer.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_8priority_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_5timer_8priority_2__set__(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":957
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":958
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":957
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":959
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":956
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.timer.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":961
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.timer.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_2feed(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_2feed(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":963
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":964
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":963
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":965
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 965; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":966
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":967
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":968
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":969
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":967
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":970
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":971
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":972
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":973
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args, update=True):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":971
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":961
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.timer.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":975
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_update = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (kw_args == 1) {
        const Py_ssize_t index = 1;
        PyObject* value = PyDict_GetItem(__pyx_kwds, *__pyx_pyargnames[index]);
        if (value) { values[index] = value; kw_args--; }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
    __pyx_v_update = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 975; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_4start(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_4start(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":977
 *     def start(self, object callback, *args, update=True):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":978
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":977
 *     def start(self, object callback, *args, update=True):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":979
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":980
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":979
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":981
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":982
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":983
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":984
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         if update:
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":985
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         if update:
 *             libev.ev_now_update(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":983
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":986
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         if update:             # <<<<<<<<<<<<<<
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_start(self.loop._ptr, &self._watcher)
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":987
 *             self._flags |= 2
 *         if update:
 *             libev.ev_now_update(self.loop._ptr)             # <<<<<<<<<<<<<<
 *         libev.ev_timer_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    ev_now_update(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":986
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         if update:             # <<<<<<<<<<<<<<
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_start(self.loop._ptr, &self._watcher)
 */
  }

/* "gevent/corecext.pyx":988
 *         if update:
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_timer_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":989
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":990
 *         libev.ev_timer_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":991
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":989
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":975
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":995
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_6active___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_6active___get__(struct PyGeventTimerObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":996
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":995
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1001
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_7pending___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_7pending___get__(struct PyGeventTimerObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1002
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *     def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1001
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1004
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 *     def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         if repeat < 0.0:
 *             raise ValueError("repeat must be positive or zero: %r" % repeat)
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5timer_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_5timer_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  double __pyx_v_after;
  double __pyx_v_repeat;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_after,&__pyx_n_s_repeat,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_after);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repeat);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    if (values[1]) {
      __pyx_v_after = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_after == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_after = ((double)0.0);
    }
    if (values[2]) {
      __pyx_v_repeat = __pyx_PyFloat_AsDouble(values[2]); if (unlikely((__pyx_v_repeat == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_repeat = ((double)0.0);
    }
    __pyx_v_ref = values[3];
    __pyx_v_priority = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1004; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_6__init__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);

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

static int __pyx_pf_6gevent_8corecext_5timer_6__init__(struct PyGeventTimerObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, double __pyx_v_after, double __pyx_v_repeat, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":1005
 *
 *     def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
 *         if repeat < 0.0:             # <<<<<<<<<<<<<<
 *             raise ValueError("repeat must be positive or zero: %r" % repeat)
 *         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
 */
  __pyx_t_1 = ((__pyx_v_repeat < 0.0) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1006
 *     def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
 *         if repeat < 0.0:
 *             raise ValueError("repeat must be positive or zero: %r" % repeat)             # <<<<<<<<<<<<<<
 *         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
 *         self.loop = loop
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_repeat); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1006; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1005
 *
 *     def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):
 *         if repeat < 0.0:             # <<<<<<<<<<<<<<
 *             raise ValueError("repeat must be positive or zero: %r" % repeat)
 *         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
 */
  }

/* "gevent/corecext.pyx":1007
 *         if repeat < 0.0:
 *             raise ValueError("repeat must be positive or zero: %r" % repeat)
 *         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_timer_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_timer), __pyx_v_after, __pyx_v_repeat);

/* "gevent/corecext.pyx":1008
 *             raise ValueError("repeat must be positive or zero: %r" % repeat)
 *         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":1009
 *         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1009; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1010
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":1009
 *         libev.ev_timer_init(&self._watcher, <void *>gevent_callback_timer, after, repeat)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1012
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1013
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_1 = (__pyx_v_priority != Py_None);
  __pyx_t_4 = (__pyx_t_1 != 0);
  if (__pyx_t_4) {

/* "gevent/corecext.pyx":1014
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     property at:
 */
    __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_5);

/* "gevent/corecext.pyx":1013
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":1004
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 *     def __init__(self, loop loop, double after=0.0, double repeat=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         if repeat < 0.0:
 *             raise ValueError("repeat must be positive or zero: %r" % repeat)
 */

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

/* "gevent/corecext.pyx":1018
 *     property at:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.at
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_2at_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_2at___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1019
 *
 *         def __get__(self):
 *             return self._watcher.at             # <<<<<<<<<<<<<<
 *
 *     # QQQ: add 'after' and 'repeat' properties?
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.at); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1018
 *     property at:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.at
 *
 */

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

/* "gevent/corecext.pyx":1023
 *     # QQQ: add 'after' and 'repeat' properties?
 *
 *     def again(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_9again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_9again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_update = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("again (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,&__pyx_n_s_update,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (kw_args == 1) {
        const Py_ssize_t index = 1;
        PyObject* value = PyDict_GetItem(__pyx_kwds, *__pyx_pyargnames[index]);
        if (value) { values[index] = value; kw_args--; }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "again") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
    __pyx_v_update = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("again", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1023; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_8again(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_8again(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_update, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("again", 0);

/* "gevent/corecext.pyx":1025
 *     def again(self, object callback, *args, update=True):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1026
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1025
 *     def again(self, object callback, *args, update=True):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1027
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1028
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1029
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1030
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         if update:
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1031
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         if update:
 *             libev.ev_now_update(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1029
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1032
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         if update:             # <<<<<<<<<<<<<<
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_again(self.loop._ptr, &self._watcher)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_update); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1033
 *             self._flags |= 2
 *         if update:
 *             libev.ev_now_update(self.loop._ptr)             # <<<<<<<<<<<<<<
 *         libev.ev_timer_again(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    ev_now_update(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1032
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         if update:             # <<<<<<<<<<<<<<
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_again(self.loop._ptr, &self._watcher)
 */
  }

/* "gevent/corecext.pyx":1034
 *         if update:
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_again(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_timer_again(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1035
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_again(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1036
 *         libev.ev_timer_again(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1037
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1035
 *             libev.ev_now_update(self.loop._ptr)
 *         libev.ev_timer_again(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1023
 *     # QQQ: add 'after' and 'repeat' properties?
 *
 *     def again(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":898
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_4loop___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5timer_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5timer_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_4loop_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5timer_4loop_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 898; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.timer.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5timer_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_5timer_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_4loop_4__del__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_5timer_4loop_4__del__(struct PyGeventTimerObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":900
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_timer _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_4args___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5timer_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5timer_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_4args_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5timer_4args_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.timer.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5timer_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_5timer_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_4args_4__del__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_5timer_4args_4__del__(struct PyGeventTimerObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":901
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_timer _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5timer_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5timer_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5timer_6_flags___get__(((struct PyGeventTimerObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5timer_6_flags___get__(struct PyGeventTimerObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__; goto __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.corecext.timer._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1051
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_3ref___get__(((struct PyGeventSignalObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_6signal_3ref___get__(struct PyGeventSignalObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1052
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1051
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":1054
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_6signal_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_6signal_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_3ref_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_6signal_3ref_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1056
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1057
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1056
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":1058
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1058; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1059
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1060
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1059
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":1061
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1062
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1061
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":1063
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":1058
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1065
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1066
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1065
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":1067
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":1068
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1069
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1070
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1068
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1054
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.signal.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1074
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_8callback___get__(((struct PyGeventSignalObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_6signal_8callback___get__(struct PyGeventSignalObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1075
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1074
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":1077
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_6signal_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_6signal_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_8callback_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":1078
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1079
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1078
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":1080
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":1077
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.signal.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1082
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_stop(((struct PyGeventSignalObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1084
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1085
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1084
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":1086
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1087
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_signal_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1088
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_signal_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":1086
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":1089
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_signal_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_signal_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1090
 *             self._flags &= ~2
 *         libev.ev_signal_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":1091
 *         libev.ev_signal_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":1092
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1093
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1094
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":1092
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":1082
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.signal.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1098
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_8priority___get__(((struct PyGeventSignalObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_6signal_8priority___get__(struct PyGeventSignalObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1099
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1098
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":1101
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_6signal_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_6signal_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1101; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.signal.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_8priority_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_6signal_8priority_2__set__(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1102
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1103
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1102
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":1104
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":1101
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.signal.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1106
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1106; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.signal.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_2feed(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_6signal_2feed(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":1108
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1109
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1108
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1110
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1111
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1112
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1113
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1114
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1112
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1115
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":1116
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1117
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1118
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1116
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1106
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.signal.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1120
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.signal.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_4start(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_6signal_4start(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":1122
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1123
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1122
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":1124
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1125
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1124
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1126
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1127
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1128
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1129
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_signal_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1130
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_signal_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1128
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1131
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_signal_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_signal_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1132
 *             self._flags |= 2
 *         libev.ev_signal_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1133
 *         libev.ev_signal_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1134
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1132
 *             self._flags |= 2
 *         libev.ev_signal_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1120
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.signal.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1138
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_6active___get__(((struct PyGeventSignalObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_6signal_6active___get__(struct PyGeventSignalObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1139
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1138
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1144
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_7pending___get__(((struct PyGeventSignalObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_6signal_7pending___get__(struct PyGeventSignalObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1145
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *     def __init__(self, loop loop, int signalnum, ref=True, priority=None):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1144
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1147
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 *     def __init__(self, loop loop, int signalnum, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         if signalnum < 1 or signalnum >= signalmodule.NSIG:
 *             raise ValueError('illegal signal number: %r' % signalnum)
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_6signal_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_6signal_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  int __pyx_v_signalnum;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_signalnum,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject *)Py_True);
    values[3] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_signalnum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    __pyx_v_signalnum = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_ref = values[2];
    __pyx_v_priority = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_6__init__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority);

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

static int __pyx_pf_6gevent_8corecext_6signal_6__init__(struct PyGeventSignalObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_signalnum, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":1148
 *
 *     def __init__(self, loop loop, int signalnum, ref=True, priority=None):
 *         if signalnum < 1 or signalnum >= signalmodule.NSIG:             # <<<<<<<<<<<<<<
 *             raise ValueError('illegal signal number: %r' % signalnum)
 *         # still possible to crash on one of libev's asserts:
 */
  __pyx_t_2 = ((__pyx_v_signalnum < 1) != 0);
  if (!__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_signalmodule); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_NSIG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1149
 *     def __init__(self, loop loop, int signalnum, ref=True, priority=None):
 *         if signalnum < 1 or signalnum >= signalmodule.NSIG:
 *             raise ValueError('illegal signal number: %r' % signalnum)             # <<<<<<<<<<<<<<
 *         # still possible to crash on one of libev's asserts:
 *         # 1) "libev: ev_signal_start called with illegal signal number"
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_signalnum); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_illegal_signal_number_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1148
 *
 *     def __init__(self, loop loop, int signalnum, ref=True, priority=None):
 *         if signalnum < 1 or signalnum >= signalmodule.NSIG:             # <<<<<<<<<<<<<<
 *             raise ValueError('illegal signal number: %r' % signalnum)
 *         # still possible to crash on one of libev's asserts:
 */
  }

/* "gevent/corecext.pyx":1155
 *         # 2) "libev: a signal must not be attached to two different loops"
 *         #    we probably could check that in LIBEV_EMBED mode, but not in general
 *         libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_signal_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_signal), __pyx_v_signalnum);

/* "gevent/corecext.pyx":1156
 *         #    we probably could check that in LIBEV_EMBED mode, but not in general
 *         libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":1157
 *         libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1158
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":1157
 *         libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L6;
  }

/* "gevent/corecext.pyx":1160
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L6:;

/* "gevent/corecext.pyx":1161
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_1 = (__pyx_v_priority != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":1162
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_6);

/* "gevent/corecext.pyx":1161
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":1147
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 *     def __init__(self, loop loop, int signalnum, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         if signalnum < 1 or signalnum >= signalmodule.NSIG:
 *             raise ValueError('illegal signal number: %r' % signalnum)
 */

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

/* "gevent/corecext.pyx":1043
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_4loop___get__(((struct PyGeventSignalObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_6signal_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_6signal_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_4loop_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_6signal_4loop_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1043; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.signal.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_6signal_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_6signal_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_4loop_4__del__(((struct PyGeventSignalObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_6signal_4loop_4__del__(struct PyGeventSignalObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":1045
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_signal _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_4args___get__(((struct PyGeventSignalObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_6signal_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_6signal_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_4args_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_6signal_4args_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.signal.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_6signal_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_6signal_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_4args_4__del__(((struct PyGeventSignalObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_6signal_4args_4__del__(struct PyGeventSignalObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":1046
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_signal _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_6signal_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_6signal_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_6signal_6_flags___get__(((struct PyGeventSignalObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_6signal_6_flags___get__(struct PyGeventSignalObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1046; __pyx_clineno = __LINE__; goto __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.corecext.signal._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1176
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_3ref___get__(((struct PyGeventIdleObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4idle_3ref___get__(struct PyGeventIdleObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1177
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1176
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":1179
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4idle_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4idle_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_3ref_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4idle_3ref_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1181
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1182
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1181
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":1183
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1184
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1185
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1184
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":1186
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1187
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1186
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":1188
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":1183
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1190
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1191
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1190
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":1192
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":1193
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1194
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1195
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1193
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1179
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.idle.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1199
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_8callback___get__(((struct PyGeventIdleObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4idle_8callback___get__(struct PyGeventIdleObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1200
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1199
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":1202
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4idle_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_4idle_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_8callback_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":1203
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1204
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1203
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":1205
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":1202
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.idle.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1207
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_stop(((struct PyGeventIdleObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1209
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1210
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1209
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":1211
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1212
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_idle_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1213
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_idle_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":1211
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":1214
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_idle_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_idle_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1215
 *             self._flags &= ~2
 *         libev.ev_idle_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":1216
 *         libev.ev_idle_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":1217
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1218
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1219
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":1217
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":1207
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.idle.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1223
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_8priority___get__(((struct PyGeventIdleObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4idle_8priority___get__(struct PyGeventIdleObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1224
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1223
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":1226
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4idle_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_4idle_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.idle.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_8priority_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_4idle_8priority_2__set__(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1227
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1228
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1227
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":1229
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":1226
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.idle.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1231
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.idle.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_2feed(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_4idle_2feed(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":1233
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1234
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1233
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1235
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1236
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1237
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1238
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1239
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1237
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1240
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":1241
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1242
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1243
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1241
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1231
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.idle.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1245
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.idle.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_4start(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_4idle_4start(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":1247
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1248
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1247
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":1249
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1250
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1249
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1251
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1252
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1253
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1254
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_idle_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1255
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_idle_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1253
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1256
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_idle_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_idle_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1257
 *             self._flags |= 2
 *         libev.ev_idle_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1258
 *         libev.ev_idle_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1259
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1257
 *             self._flags |= 2
 *         libev.ev_idle_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1245
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.idle.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1263
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_6active___get__(((struct PyGeventIdleObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4idle_6active___get__(struct PyGeventIdleObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1264
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1263
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1269
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_7pending___get__(((struct PyGeventIdleObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4idle_7pending___get__(struct PyGeventIdleObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1270
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1269
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1273
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle )
 *         self.loop = loop
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4idle_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_4idle_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_True);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    __pyx_v_ref = values[1];
    __pyx_v_priority = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.idle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_6__init__(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);

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

static int __pyx_pf_6gevent_8corecext_4idle_6__init__(struct PyGeventIdleObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":1274
 *
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle )             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_idle_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_idle));

/* "gevent/corecext.pyx":1275
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle )
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":1276
 *         libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1277
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":1276
 *         libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":1279
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":1280
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_1 = (__pyx_v_priority != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":1281
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);

/* "gevent/corecext.pyx":1280
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":1273
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle )
 *         self.loop = loop
 */

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

/* "gevent/corecext.pyx":1168
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_4loop___get__(((struct PyGeventIdleObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4idle_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4idle_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_4loop_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4idle_4loop_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.idle.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4idle_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_4idle_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_4loop_4__del__(((struct PyGeventIdleObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_4idle_4loop_4__del__(struct PyGeventIdleObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":1170
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_idle _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_4args___get__(((struct PyGeventIdleObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4idle_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4idle_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_4args_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4idle_4args_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.idle.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4idle_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_4idle_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_4args_4__del__(((struct PyGeventIdleObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_4idle_4args_4__del__(struct PyGeventIdleObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":1171
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_idle _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4idle_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4idle_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4idle_6_flags___get__(((struct PyGeventIdleObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4idle_6_flags___get__(struct PyGeventIdleObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1171; __pyx_clineno = __LINE__; goto __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.corecext.idle._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1295
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_3ref___get__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_7prepare_3ref___get__(struct PyGeventPrepareObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1296
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1295
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":1298
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_7prepare_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_7prepare_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_3ref_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_7prepare_3ref_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1300
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1301
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1300
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":1302
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1303
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1304
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1303
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":1305
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1306
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1305
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":1307
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":1302
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1309
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1310
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1309
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":1311
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":1312
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1313
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1314
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1312
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1298
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.prepare.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1318
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_8callback___get__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_7prepare_8callback___get__(struct PyGeventPrepareObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1319
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1318
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":1321
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_7prepare_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_7prepare_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_8callback_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":1322
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1323
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1322
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":1324
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":1321
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.prepare.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1326
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_stop(((struct PyGeventPrepareObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1328
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1329
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1328
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":1330
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1331
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_prepare_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1332
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_prepare_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":1330
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":1333
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_prepare_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_prepare_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1334
 *             self._flags &= ~2
 *         libev.ev_prepare_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":1335
 *         libev.ev_prepare_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":1336
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1337
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1338
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":1336
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":1326
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.prepare.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1342
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_8priority___get__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_7prepare_8priority___get__(struct PyGeventPrepareObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1343
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1342
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":1345
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_7prepare_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_7prepare_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1345; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.prepare.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_8priority_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_7prepare_8priority_2__set__(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1346
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1347
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1346
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":1348
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":1345
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.prepare.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1350
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1350; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.prepare.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_2feed(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_7prepare_2feed(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":1352
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1353
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1352
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1354
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1355
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1356
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1357
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1358
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1356
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1359
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":1360
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1361
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1362
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1360
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1350
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.prepare.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1364
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1364; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.prepare.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_4start(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_7prepare_4start(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":1366
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1367
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1366
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":1368
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1369
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1368
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1370
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1371
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1372
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1373
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_prepare_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1374
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_prepare_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1372
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1375
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_prepare_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_prepare_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1376
 *             self._flags |= 2
 *         libev.ev_prepare_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1377
 *         libev.ev_prepare_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1378
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1376
 *             self._flags |= 2
 *         libev.ev_prepare_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1364
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.prepare.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1382
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_6active___get__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_7prepare_6active___get__(struct PyGeventPrepareObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1383
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1382
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1388
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_7pending___get__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_7prepare_7pending___get__(struct PyGeventPrepareObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1389
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1388
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1392
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare )
 *         self.loop = loop
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_7prepare_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_7prepare_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_True);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    __pyx_v_ref = values[1];
    __pyx_v_priority = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.prepare.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_6__init__(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);

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

static int __pyx_pf_6gevent_8corecext_7prepare_6__init__(struct PyGeventPrepareObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":1393
 *
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare )             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_prepare_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_prepare));

/* "gevent/corecext.pyx":1394
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare )
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":1395
 *         libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1396
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":1395
 *         libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":1398
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":1399
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_1 = (__pyx_v_priority != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":1400
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1400; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);

/* "gevent/corecext.pyx":1399
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":1392
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare )
 *         self.loop = loop
 */

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

/* "gevent/corecext.pyx":1287
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_4loop___get__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_7prepare_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_7prepare_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_4loop_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_7prepare_4loop_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.prepare.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_7prepare_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_7prepare_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_4loop_4__del__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_7prepare_4loop_4__del__(struct PyGeventPrepareObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":1289
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_prepare _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_4args___get__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_7prepare_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_7prepare_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_4args_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_7prepare_4args_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.prepare.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_7prepare_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_7prepare_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_4args_4__del__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_7prepare_4args_4__del__(struct PyGeventPrepareObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":1290
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_prepare _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_7prepare_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_7prepare_6_flags___get__(((struct PyGeventPrepareObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_7prepare_6_flags___get__(struct PyGeventPrepareObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1290; __pyx_clineno = __LINE__; goto __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.corecext.prepare._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1414
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_3ref___get__(((struct PyGeventCheckObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5check_3ref___get__(struct PyGeventCheckObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1415
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1414
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":1417
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5check_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5check_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_3ref_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5check_3ref_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1419
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1420
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1419
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":1421
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1422
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1423
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1422
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":1424
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1425
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1424
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":1426
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":1421
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1428
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1429
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1428
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":1430
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":1431
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1432
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1433
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1431
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1417
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.check.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1437
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_8callback___get__(((struct PyGeventCheckObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5check_8callback___get__(struct PyGeventCheckObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1438
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1437
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":1440
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5check_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_5check_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_8callback_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":1441
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1442
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1441
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":1443
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":1440
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.check.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1445
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_stop(((struct PyGeventCheckObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1447
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1448
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1447
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":1449
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1450
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_check_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1451
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_check_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":1449
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":1452
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_check_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_check_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1453
 *             self._flags &= ~2
 *         libev.ev_check_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":1454
 *         libev.ev_check_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":1455
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1456
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1457
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":1455
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":1445
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.check.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1461
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_8priority___get__(((struct PyGeventCheckObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5check_8priority___get__(struct PyGeventCheckObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1462
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1461
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":1464
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5check_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_5check_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1464; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.check.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_8priority_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_5check_8priority_2__set__(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1465
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1466
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1465
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":1467
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":1464
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.check.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1469
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.check.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_2feed(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5check_2feed(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":1471
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1472
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1471
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1473
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1473; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1474
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1475
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1476
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1477
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1475
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1478
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":1479
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1480
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1481
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1479
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1469
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.check.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1483
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.check.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_4start(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5check_4start(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":1485
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1486
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1485
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":1487
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1488
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1487
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1489
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1490
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1491
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1492
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_check_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1493
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_check_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1491
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1494
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_check_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_check_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1495
 *             self._flags |= 2
 *         libev.ev_check_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1496
 *         libev.ev_check_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1497
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1495
 *             self._flags |= 2
 *         libev.ev_check_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1483
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.check.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1501
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_6active___get__(((struct PyGeventCheckObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5check_6active___get__(struct PyGeventCheckObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1502
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1501
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1507
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_7pending___get__(((struct PyGeventCheckObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5check_7pending___get__(struct PyGeventCheckObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1508
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1507
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1511
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_check_init(&self._watcher, <void *>gevent_callback_check )
 *         self.loop = loop
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5check_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_5check_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_True);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    __pyx_v_ref = values[1];
    __pyx_v_priority = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.check.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1511; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_6__init__(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);

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

static int __pyx_pf_6gevent_8corecext_5check_6__init__(struct PyGeventCheckObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":1512
 *
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_check_init(&self._watcher, <void *>gevent_callback_check )             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_check_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_check));

/* "gevent/corecext.pyx":1513
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_check_init(&self._watcher, <void *>gevent_callback_check )
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":1514
 *         libev.ev_check_init(&self._watcher, <void *>gevent_callback_check )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1515
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":1514
 *         libev.ev_check_init(&self._watcher, <void *>gevent_callback_check )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":1517
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":1518
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_1 = (__pyx_v_priority != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":1519
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1519; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);

/* "gevent/corecext.pyx":1518
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":1511
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_check_init(&self._watcher, <void *>gevent_callback_check )
 *         self.loop = loop
 */

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

/* "gevent/corecext.pyx":1406
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_4loop___get__(((struct PyGeventCheckObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5check_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5check_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_4loop_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5check_4loop_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.check.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5check_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_5check_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_4loop_4__del__(((struct PyGeventCheckObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_5check_4loop_4__del__(struct PyGeventCheckObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":1408
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_check _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_4args___get__(((struct PyGeventCheckObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5check_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5check_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_4args_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5check_4args_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.check.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5check_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_5check_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_4args_4__del__(((struct PyGeventCheckObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_5check_4args_4__del__(struct PyGeventCheckObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":1409
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_check _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5check_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5check_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5check_6_flags___get__(((struct PyGeventCheckObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5check_6_flags___get__(struct PyGeventCheckObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; __pyx_clineno = __LINE__; goto __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.corecext.check._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1533
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_3ref___get__(((struct PyGeventForkObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4fork_3ref___get__(struct PyGeventForkObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1534
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1533
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":1536
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4fork_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4fork_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_3ref_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4fork_3ref_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1538
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1539
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1538
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":1540
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1541
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1542
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1541
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":1543
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1544
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1543
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":1545
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":1540
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1547
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1548
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1547
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":1549
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":1550
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1551
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1552
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1550
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1536
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.fork.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1556
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_8callback___get__(((struct PyGeventForkObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4fork_8callback___get__(struct PyGeventForkObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1557
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1556
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":1559
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4fork_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_4fork_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_8callback_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":1560
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1561
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1560
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":1562
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":1559
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.fork.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1564
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_stop(((struct PyGeventForkObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1566
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1567
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1566
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":1568
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1569
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_fork_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1570
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_fork_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":1568
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":1571
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_fork_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_fork_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1572
 *             self._flags &= ~2
 *         libev.ev_fork_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":1573
 *         libev.ev_fork_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":1574
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1575
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1576
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":1574
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":1564
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.fork.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1580
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_8priority___get__(((struct PyGeventForkObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4fork_8priority___get__(struct PyGeventForkObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1581
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1581; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1580
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":1583
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4fork_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_4fork_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.fork.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_8priority_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_4fork_8priority_2__set__(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1584
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1585
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1584
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":1586
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":1583
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.fork.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1588
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1588; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.fork.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_2feed(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_4fork_2feed(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":1590
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1591
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1590
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1592
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1593
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1594
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1595
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1596
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1594
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1597
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":1598
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1599
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1600
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1598
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1588
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.fork.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1602
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1602; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.fork.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_4start(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_4fork_4start(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":1604
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1605
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1604
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":1606
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1607
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1606
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1608
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1609
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1610
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1611
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_fork_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1612
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_fork_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1610
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1613
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_fork_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_fork_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1614
 *             self._flags |= 2
 *         libev.ev_fork_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1615
 *         libev.ev_fork_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1616
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1614
 *             self._flags |= 2
 *         libev.ev_fork_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1602
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.fork.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1620
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_6active___get__(((struct PyGeventForkObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4fork_6active___get__(struct PyGeventForkObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1621
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1620
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1626
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_7pending___get__(((struct PyGeventForkObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4fork_7pending___get__(struct PyGeventForkObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1627
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1626
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1630
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork )
 *         self.loop = loop
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4fork_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_4fork_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_True);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    __pyx_v_ref = values[1];
    __pyx_v_priority = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.fork.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_6__init__(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);

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

static int __pyx_pf_6gevent_8corecext_4fork_6__init__(struct PyGeventForkObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":1631
 *
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork )             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_fork_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_fork));

/* "gevent/corecext.pyx":1632
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork )
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":1633
 *         libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1634
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":1633
 *         libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":1636
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":1637
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_1 = (__pyx_v_priority != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":1638
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);

/* "gevent/corecext.pyx":1637
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":1630
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork )
 *         self.loop = loop
 */

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

/* "gevent/corecext.pyx":1525
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_4loop___get__(((struct PyGeventForkObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4fork_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4fork_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_4loop_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4fork_4loop_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.fork.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4fork_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_4fork_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_4loop_4__del__(((struct PyGeventForkObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_4fork_4loop_4__del__(struct PyGeventForkObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":1527
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_fork _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_4args___get__(((struct PyGeventForkObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4fork_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4fork_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_4args_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4fork_4args_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.fork.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4fork_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_4fork_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_4args_4__del__(((struct PyGeventForkObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_4fork_4args_4__del__(struct PyGeventForkObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":1528
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_fork _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4fork_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4fork_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4fork_6_flags___get__(((struct PyGeventForkObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4fork_6_flags___get__(struct PyGeventForkObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1528; __pyx_clineno = __LINE__; goto __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.corecext.fork._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1652
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_3ref___get__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5async_3ref___get__(struct PyGeventAsyncObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1653
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1652
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":1655
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5async_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5async_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_3ref_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5async_3ref_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1657
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1658
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1657
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":1659
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1660
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1661
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1660
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":1662
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1663
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1662
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":1664
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":1659
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1666
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1667
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1666
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":1668
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":1669
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1670
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1671
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1669
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1655
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.async.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1675
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_8callback___get__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5async_8callback___get__(struct PyGeventAsyncObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1676
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1675
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":1678
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5async_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_5async_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_8callback_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":1679
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1680
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1679
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":1681
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":1678
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.async.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1683
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_stop(((struct PyGeventAsyncObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1685
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1686
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1685
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":1687
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1688
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_async_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1689
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_async_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":1687
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":1690
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_async_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_async_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1691
 *             self._flags &= ~2
 *         libev.ev_async_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":1692
 *         libev.ev_async_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":1693
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1694
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1695
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":1693
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":1683
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.async.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1699
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_8priority___get__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5async_8priority___get__(struct PyGeventAsyncObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1700
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1699
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":1702
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5async_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_5async_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1702; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.async.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_8priority_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_5async_8priority_2__set__(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1703
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1704
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1703
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":1705
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":1702
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.async.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1707
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1707; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.async.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_2feed(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5async_2feed(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":1709
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1710
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1709
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1711
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1712
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1713
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1714
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1715
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1713
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1716
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":1717
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1718
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1719
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1717
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1707
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.async.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1721
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.async.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_4start(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5async_4start(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":1723
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1724
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1723
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":1725
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1726
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1725
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1727
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1728
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1729
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1730
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_async_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1731
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_async_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1729
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1732
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_async_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_async_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1733
 *             self._flags |= 2
 *         libev.ev_async_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1734
 *         libev.ev_async_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1735
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1733
 *             self._flags |= 2
 *         libev.ev_async_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1721
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.async.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1739
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_6active___get__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5async_6active___get__(struct PyGeventAsyncObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1740
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *     property pending:
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1739
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1744
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_async_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_7pending___get__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5async_7pending___get__(struct PyGeventAsyncObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1745
 *
 *         def __get__(self):
 *             return True if libev.ev_async_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_async_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1744
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_async_pending(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1748
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )
 *         self.loop = loop
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5async_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_5async_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject *)Py_True);
    values[2] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[1] = value; kw_args--; }
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    __pyx_v_ref = values[1];
    __pyx_v_priority = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.async.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_6__init__(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);

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

static int __pyx_pf_6gevent_8corecext_5async_6__init__(struct PyGeventAsyncObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":1749
 *
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_async_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_async));

/* "gevent/corecext.pyx":1750
 *     def __init__(self, loop loop , ref=True, priority=None):
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":1751
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1752
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":1751
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":1754
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":1755
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_1 = (__pyx_v_priority != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":1756
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def send(self):
 */
    __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);

/* "gevent/corecext.pyx":1755
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":1748
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )
 *         self.loop = loop
 */

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

/* "gevent/corecext.pyx":1758
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def send(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_9send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_9send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("send (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_8send(((struct PyGeventAsyncObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1760
 *     def send(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1761
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1760
 *     def send(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)
 */
  }

/* "gevent/corecext.pyx":1762
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *
 *
 */
  ev_async_send(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1758
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def send(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.async.send", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1644
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_4loop___get__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5async_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5async_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_4loop_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5async_4loop_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1644; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.async.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5async_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_5async_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_4loop_4__del__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_5async_4loop_4__del__(struct PyGeventAsyncObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":1646
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_async _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_4args___get__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5async_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5async_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_4args_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5async_4args_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.async.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5async_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_5async_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_4args_4__del__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_5async_4args_4__del__(struct PyGeventAsyncObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":1647
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_async _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5async_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5async_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5async_6_flags___get__(((struct PyGeventAsyncObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5async_6_flags___get__(struct PyGeventAsyncObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; __pyx_clineno = __LINE__; goto __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.corecext.async._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/corecext.pyx":1778
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_3ref___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_3ref___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1779
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1778
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":1781
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_3ref_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5child_3ref_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1783
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1784
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1783
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":1785
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1786
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1787
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1786
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":1788
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1789
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1788
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":1790
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":1785
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1792
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1793
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1792
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":1794
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":1795
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1796
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1797
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1795
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1781
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.child.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1801
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_8callback___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_8callback___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1802
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1801
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":1804
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_8callback_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":1805
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1806
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1805
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":1807
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":1804
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.child.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1809
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_stop(((struct PyGeventChildObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1811
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1812
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1811
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":1813
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1814
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_child_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1815
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_child_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":1813
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":1816
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_child_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_child_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1817
 *             self._flags &= ~2
 *         libev.ev_child_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":1818
 *         libev.ev_child_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":1819
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1820
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1821
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":1819
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":1809
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.child.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1825
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_8priority___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_8priority___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1826
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1825
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":1828
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.child.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_8priority_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_5child_8priority_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1829
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1830
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1829
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":1831
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":1828
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.child.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1833
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1833; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.child.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_2feed(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_2feed(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":1835
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1836
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1835
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1837
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1838
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1839
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1840
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1841
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1839
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1842
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":1843
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1844
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1845
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1843
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1833
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.child.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1847
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1847; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.child.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4start(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_4start(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":1849
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1850
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1849
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":1851
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1852
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1851
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1853
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1853; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1854
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1855
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1856
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_child_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1857
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_child_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1855
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1858
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_child_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_child_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1859
 *             self._flags |= 2
 *         libev.ev_child_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1860
 *         libev.ev_child_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1861
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1859
 *             self._flags |= 2
 *         libev.ev_child_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1847
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.child.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1865
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_6active___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_6active___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1866
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1865
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1871
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_7pending___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_7pending___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1872
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1871
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":1874
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):             # <<<<<<<<<<<<<<
 *         if not loop.default:
 *             raise TypeError('child watchers are only available on the default loop')
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  int __pyx_v_pid;
  int __pyx_v_trace;
  PyObject *__pyx_v_ref = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_pid,&__pyx_n_s_trace,&__pyx_n_s_ref,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pid)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trace);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    __pyx_v_pid = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[2]) {
      __pyx_v_trace = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_trace == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_trace = ((int)0);
    }
    __pyx_v_ref = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_6__init__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);

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

static int __pyx_pf_6gevent_8corecext_5child_6__init__(struct PyGeventChildObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, int __pyx_v_pid, int __pyx_v_trace, PyObject *__pyx_v_ref) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":1875
 *
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
 *         if not loop.default:             # <<<<<<<<<<<<<<
 *             raise TypeError('child watchers are only available on the default loop')
 *         libev.gevent_install_sigchld_handler()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_loop), __pyx_n_s_default); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1875; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1876
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
 *         if not loop.default:
 *             raise TypeError('child watchers are only available on the default loop')             # <<<<<<<<<<<<<<
 *         libev.gevent_install_sigchld_handler()
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1875
 *
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
 *         if not loop.default:             # <<<<<<<<<<<<<<
 *             raise TypeError('child watchers are only available on the default loop')
 *         libev.gevent_install_sigchld_handler()
 */
  }

/* "gevent/corecext.pyx":1877
 *         if not loop.default:
 *             raise TypeError('child watchers are only available on the default loop')
 *         libev.gevent_install_sigchld_handler()             # <<<<<<<<<<<<<<
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
 *         self.loop = loop
 */
  gevent_install_sigchld_handler();

/* "gevent/corecext.pyx":1878
 *             raise TypeError('child watchers are only available on the default loop')
 *         libev.gevent_install_sigchld_handler()
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  ev_child_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_child), __pyx_v_pid, __pyx_v_trace);

/* "gevent/corecext.pyx":1879
 *         libev.gevent_install_sigchld_handler()
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":1880
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1880; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1881
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":1880
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1883
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1874
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):             # <<<<<<<<<<<<<<
 *         if not loop.default:
 *             raise TypeError('child watchers are only available on the default loop')
 */

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

/* "gevent/corecext.pyx":1885
 *             self._flags = 4
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ' pid=%r rstatus=%r' % (self.pid, self.rstatus)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_8_format(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_8_format(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_format", 0);

/* "gevent/corecext.pyx":1886
 *
 *     def _format(self):
 *         return ' pid=%r rstatus=%r' % (self.pid, self.rstatus)             # <<<<<<<<<<<<<<
 *
 *     property pid:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_pid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rstatus); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_pid_r_rstatus_r, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1885
 *             self._flags = 4
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ' pid=%r rstatus=%r' % (self.pid, self.rstatus)
 *
 */

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

/* "gevent/corecext.pyx":1890
 *     property pid:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.pid
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_3pid_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_3pid___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1891
 *
 *         def __get__(self):
 *             return self._watcher.pid             # <<<<<<<<<<<<<<
 *
 *     property rpid:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.pid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1890
 *     property pid:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.pid
 *
 */

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

/* "gevent/corecext.pyx":1895
 *     property rpid:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.rpid
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_4rpid_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4rpid___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1896
 *
 *         def __get__(self):
 *             return self._watcher.rpid             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1896; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1895
 *     property rpid:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.rpid
 *
 */

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

/* "gevent/corecext.pyx":1898
 *             return self._watcher.rpid
 *
 *         def __set__(self, int value):             # <<<<<<<<<<<<<<
 *             self._watcher.rpid = value
 *
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  int __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1898; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.child.rpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4rpid_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1899
 *
 *         def __set__(self, int value):
 *             self._watcher.rpid = value             # <<<<<<<<<<<<<<
 *
 *     property rstatus:
 */
  __pyx_v_self->_watcher.rpid = __pyx_v_value;

/* "gevent/corecext.pyx":1898
 *             return self._watcher.rpid
 *
 *         def __set__(self, int value):             # <<<<<<<<<<<<<<
 *             self._watcher.rpid = value
 *
 */

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

/* "gevent/corecext.pyx":1903
 *     property rstatus:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.rstatus
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_7rstatus_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_7rstatus___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1904
 *
 *         def __get__(self):
 *             return self._watcher.rstatus             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_watcher.rstatus); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1904; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1903
 *     property rstatus:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.rstatus
 *
 */

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

/* "gevent/corecext.pyx":1906
 *             return self._watcher.rstatus
 *
 *         def __set__(self, int value):             # <<<<<<<<<<<<<<
 *             self._watcher.rstatus = value
 *
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value) {
  int __pyx_v_value;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.child.rstatus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_7rstatus_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1907
 *
 *         def __set__(self, int value):
 *             self._watcher.rstatus = value             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_v_self->_watcher.rstatus = __pyx_v_value;

/* "gevent/corecext.pyx":1906
 *             return self._watcher.rstatus
 *
 *         def __set__(self, int value):             # <<<<<<<<<<<<<<
 *             self._watcher.rstatus = value
 *
 */

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

/* "gevent/corecext.pyx":1770
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4loop___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4loop_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5child_4loop_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1770; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.child.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4loop_4__del__(((struct PyGeventChildObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_5child_4loop_4__del__(struct PyGeventChildObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":1772
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_child _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4args___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4args_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_5child_4args_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.child.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_5child_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_5child_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_4args_4__del__(((struct PyGeventChildObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_5child_4args_4__del__(struct PyGeventChildObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":1773
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_child _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_5child_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_5child_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_5child_6_flags___get__(((struct PyGeventChildObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_5child_6_flags___get__(struct PyGeventChildObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1773; __pyx_clineno = __LINE__; goto __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.corecext.child._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
/* "gevent/corecext.pyx":1923
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_3ref___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_3ref___get__(struct PyGeventStatObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1924
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  } else {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1923
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

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

/* "gevent/corecext.pyx":1926
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_3ref_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4stat_3ref_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1928
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1929
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1928
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
  }

/* "gevent/corecext.pyx":1930
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1930; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1931
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    __pyx_t_1 = ((!((__pyx_v_self->_flags & 4) != 0)) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1932
 *             if value:
 *                 if not self._flags & 4:
 *                     return  # ref is already True             # <<<<<<<<<<<<<<
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1931
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 *                 if not self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 */
    }

/* "gevent/corecext.pyx":1933
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1934
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 */
      ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1933
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 *                 if self._flags & 2:  # ev_unref was called, undo             # <<<<<<<<<<<<<<
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 */
    }

/* "gevent/corecext.pyx":1935
 *                 if self._flags & 2:  # ev_unref was called, undo
 *                     libev.ev_ref(self.loop._ptr)
 *                 self._flags &= ~6  # do not want unref, no outstanding unref             # <<<<<<<<<<<<<<
 *             else:
 *                 if self._flags & 4:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~6));

/* "gevent/corecext.pyx":1930
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')
 *             if value:             # <<<<<<<<<<<<<<
 *                 if not self._flags & 4:
 *                     return  # ref is already True
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":1937
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
  /*else*/ {
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1938
 *             else:
 *                 if self._flags & 4:
 *                     return  # ref is already False             # <<<<<<<<<<<<<<
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 */
      __pyx_r = 0;
      goto __pyx_L0;

/* "gevent/corecext.pyx":1937
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    }

/* "gevent/corecext.pyx":1939
 *                 if self._flags & 4:
 *                     return  # ref is already False
 *                 self._flags |= 4             # <<<<<<<<<<<<<<
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 4);

/* "gevent/corecext.pyx":1940
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    __pyx_t_3 = ((!((__pyx_v_self->_flags & 2) != 0)) != 0);
    if (__pyx_t_3) {
    } else {
      __pyx_t_1 = __pyx_t_3;
      goto __pyx_L9_bool_binop_done;
    }
    __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    __pyx_t_1 = __pyx_t_3;
    __pyx_L9_bool_binop_done:;
    if (__pyx_t_1) {

/* "gevent/corecext.pyx":1941
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
      ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1942
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
      __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1940
 *                     return  # ref is already False
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2
 */
    }
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":1926
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.stat.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1946
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_8callback___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_8callback___get__(struct PyGeventStatObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1947
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1946
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

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

/* "gevent/corecext.pyx":1949
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4stat_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_8corecext_4stat_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_8callback_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));

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

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

/* "gevent/corecext.pyx":1950
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  __pyx_t_2 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = (__pyx_v_callback != Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1951
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))             # <<<<<<<<<<<<<<
 *             self._callback = callback
 *
 */
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_not_r, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_5, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1950
 *
 *         def __set__(self, object callback):
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:             # <<<<<<<<<<<<<<
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback
 */
  }

/* "gevent/corecext.pyx":1952
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 *             self._callback = callback             # <<<<<<<<<<<<<<
 *
 *     def stop(self):
 */
  __Pyx_INCREF(__pyx_v_callback);
  __Pyx_GIVEREF(__pyx_v_callback);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = __pyx_v_callback;

/* "gevent/corecext.pyx":1949
 *             return self._callback
 *
 *         def __set__(self, object callback):             # <<<<<<<<<<<<<<
 *             if not PyCallable_Check(<PyObjectPtr>callback) and callback is not None:
 *                 raise TypeError("Expected callable, not %r" % (callback, ))
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.corecext.stat.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1954
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("stop (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_stop(((struct PyGeventStatObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":1956
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1957
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1956
 *     def stop(self):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 */
  }

/* "gevent/corecext.pyx":1958
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 2) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1959
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags &= ~2
 *         libev.ev_stat_stop(self.loop._ptr, &self._watcher)
 */
    ev_ref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1960
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2             # <<<<<<<<<<<<<<
 *         libev.ev_stat_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~2));

/* "gevent/corecext.pyx":1958
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if self._flags & 2:             # <<<<<<<<<<<<<<
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 */
  }

/* "gevent/corecext.pyx":1961
 *             libev.ev_ref(self.loop._ptr)
 *             self._flags &= ~2
 *         libev.ev_stat_stop(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         self._callback = None
 *         self.args = None
 */
  ev_stat_stop(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":1962
 *             self._flags &= ~2
 *         libev.ev_stat_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None             # <<<<<<<<<<<<<<
 *         self.args = None
 *         if self._flags & 1:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->_callback);
  __Pyx_DECREF(__pyx_v_self->_callback);
  __pyx_v_self->_callback = Py_None;

/* "gevent/corecext.pyx":1963
 *         libev.ev_stat_stop(self.loop._ptr, &self._watcher)
 *         self._callback = None
 *         self.args = None             # <<<<<<<<<<<<<<
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/corecext.pyx":1964
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  __pyx_t_1 = ((__pyx_v_self->_flags & 1) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1965
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1966
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));

/* "gevent/corecext.pyx":1964
 *         self._callback = None
 *         self.args = None
 *         if self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1
 */
  }

/* "gevent/corecext.pyx":1954
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.stat.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1970
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_8priority___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_8priority___get__(struct PyGeventStatObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":1971
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1971; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":1970
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

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

/* "gevent/corecext.pyx":1973
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4stat_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_8corecext_4stat_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority) {
  int __pyx_v_priority;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  assert(__pyx_arg_priority); {
    __pyx_v_priority = __Pyx_PyInt_As_int(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1973; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.stat.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_8priority_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((int)__pyx_v_priority));

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

static int __pyx_pf_6gevent_8corecext_4stat_8priority_2__set__(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_priority) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/corecext.pyx":1974
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  __pyx_t_1 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1975
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_AttributeError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1974
 *
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):             # <<<<<<<<<<<<<<
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  }

/* "gevent/corecext.pyx":1976
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def feed(self, int revents, object callback, *args):
 */
  ev_set_priority((&__pyx_v_self->_watcher), __pyx_v_priority);

/* "gevent/corecext.pyx":1973
 *             return libev.ev_priority(&self._watcher)
 *
 *         def __set__(self, int priority):             # <<<<<<<<<<<<<<
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.stat.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1978
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_revents;
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("feed (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 2) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 2, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_revents,&__pyx_n_s_callback,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_revents)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 2) ? pos_args : 2;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "feed") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_revents = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_callback = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("feed", 0, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1978; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.stat.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_2feed(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_2feed(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_revents, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("feed", 0);

/* "gevent/corecext.pyx":1980
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1981
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1980
 *     def feed(self, int revents, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1982
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1983
 *             raise ValueError('operation on destroyed loop')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":1984
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_1 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1985
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":1986
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":1984
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":1987
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_feed_event(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher), __pyx_v_revents);

/* "gevent/corecext.pyx":1988
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_1 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1989
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":1990
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     def start(self, object callback, *args):
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":1988
 *             self._flags |= 2
 *         libev.ev_feed_event(self.loop._ptr, &self._watcher, revents)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1978
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.stat.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":1992
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_callback = 0;
  PyObject *__pyx_v_args = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("start (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_callback,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_callback)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "start") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_callback = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("start", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.corecext.stat.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4start(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_4start(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("start", 0);

/* "gevent/corecext.pyx":1994
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":1995
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1994
 *     def start(self, object callback, *args):
 *
 *         if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 */
  }

/* "gevent/corecext.pyx":1996
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":1997
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1996
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:             # <<<<<<<<<<<<<<
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 */
  }

/* "gevent/corecext.pyx":1998
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback             # <<<<<<<<<<<<<<
 *         self.args = args
 *         if self._flags & 6 == 4:
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_callback, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1998; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":1999
 *             raise TypeError('callback must be callable, not None')
 *         self.callback = callback
 *         self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/corecext.pyx":2000
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  __pyx_t_3 = (((__pyx_v_self->_flags & 6) == 4) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":2001
 *         self.args = args
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *             self._flags |= 2
 *         libev.ev_stat_start(self.loop._ptr, &self._watcher)
 */
    ev_unref(__pyx_v_self->loop->_ptr);

/* "gevent/corecext.pyx":2002
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2             # <<<<<<<<<<<<<<
 *         libev.ev_stat_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 2);

/* "gevent/corecext.pyx":2000
 *         self.callback = callback
 *         self.args = args
 *         if self._flags & 6 == 4:             # <<<<<<<<<<<<<<
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 */
  }

/* "gevent/corecext.pyx":2003
 *             libev.ev_unref(self.loop._ptr)
 *             self._flags |= 2
 *         libev.ev_stat_start(self.loop._ptr, &self._watcher)             # <<<<<<<<<<<<<<
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 */
  ev_stat_start(__pyx_v_self->loop->_ptr, (&__pyx_v_self->_watcher));

/* "gevent/corecext.pyx":2004
 *             self._flags |= 2
 *         libev.ev_stat_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  __pyx_t_3 = ((!((__pyx_v_self->_flags & 1) != 0)) != 0);
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":2005
 *         libev.ev_stat_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags |= 1
 *
 */
    Py_INCREF(((PyObject*)__pyx_v_self));

/* "gevent/corecext.pyx":2006
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);

/* "gevent/corecext.pyx":2004
 *             self._flags |= 2
 *         libev.ev_stat_start(self.loop._ptr, &self._watcher)
 *         if not self._flags & 1:             # <<<<<<<<<<<<<<
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1
 */
  }

/* "gevent/corecext.pyx":1992
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.corecext.stat.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":2010
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_6active___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_6active___get__(struct PyGeventStatObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":2011
 *
 *         def __get__(self):
 *             return True if libev.ev_is_active(&self._watcher) else False             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_active((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":2010
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

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

/* "gevent/corecext.pyx":2016
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *     cdef readonly str path
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_7pending___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_7pending___get__(struct PyGeventStatObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":2017
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *     cdef readonly str path
 *     cdef readonly bytes _paths
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __Pyx_INCREF(Py_True);
    __pyx_t_1 = Py_True;
  } else {
    __Pyx_INCREF(Py_False);
    __pyx_t_1 = Py_False;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":2016
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *     cdef readonly str path
 */

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

/* "gevent/corecext.pyx":2021
 *     cdef readonly bytes _paths
 *
 *     def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         cdef bytes paths
 */

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4stat_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_8corecext_4stat_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct PyGeventLoopObject *__pyx_v_loop = 0;
  PyObject *__pyx_v_path = 0;
  float __pyx_v_interval;
  PyObject *__pyx_v_ref = 0;
  PyObject *__pyx_v_priority = 0;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_loop,&__pyx_n_s_path,&__pyx_n_s_interval,&__pyx_n_s_ref,&__pyx_n_s_priority,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[3] = ((PyObject *)Py_True);
    values[4] = ((PyObject *)Py_None);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_loop)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        case  1:
        if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_path)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
        }
        case  2:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_interval);
          if (value) { values[2] = value; kw_args--; }
        }
        case  3:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ref);
          if (value) { values[3] = value; kw_args--; }
        }
        case  4:
        if (kw_args > 0) {
          PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_priority);
          if (value) { values[4] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_loop = ((struct PyGeventLoopObject *)values[0]);
    __pyx_v_path = ((PyObject*)values[1]);
    if (values[2]) {
      __pyx_v_interval = __pyx_PyFloat_AsFloat(values[2]); if (unlikely((__pyx_v_interval == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_interval = ((float)0.0);
    }
    __pyx_v_ref = values[3];
    __pyx_v_priority = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_loop), __pyx_ptype_6gevent_8corecext_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyString_Type), 1, "path", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_6__init__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);

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

static int __pyx_pf_6gevent_8corecext_4stat_6__init__(struct PyGeventStatObject *__pyx_v_self, struct PyGeventLoopObject *__pyx_v_loop, PyObject *__pyx_v_path, float __pyx_v_interval, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority) {
  PyObject *__pyx_v_paths = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  char *__pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/corecext.pyx":2022
 *
 *     def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None):
 *         self.path = path             # <<<<<<<<<<<<<<
 *         cdef bytes paths
 *         if isinstance(path, unicode):
 */
  __Pyx_INCREF(__pyx_v_path);
  __Pyx_GIVEREF(__pyx_v_path);
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(__pyx_v_self->path);
  __pyx_v_self->path = __pyx_v_path;

/* "gevent/corecext.pyx":2024
 *         self.path = path
 *         cdef bytes paths
 *         if isinstance(path, unicode):             # <<<<<<<<<<<<<<
 *             # the famous Python3 filesystem encoding debacle hits us here. Can we do better?
 *             # We must keep a reference to the encoded string so that its bytes don't get freed
 */
  __pyx_t_1 = PyUnicode_Check(__pyx_v_path);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":2028
 *             # We must keep a reference to the encoded string so that its bytes don't get freed
 *             # and overwritten, leading to strange errors from libev ("no such file or directory")
 *             paths = (<unicode>path).encode(sys.getfilesystemencoding())             # <<<<<<<<<<<<<<
 *             self._paths = paths
 *         else:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_path, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_getfilesystemencoding); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    if (__pyx_t_6) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else {
      __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_COMPILING_IN_CPYTHON && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_7) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(PyBytes_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_paths = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

/* "gevent/corecext.pyx":2029
 *             # and overwritten, leading to strange errors from libev ("no such file or directory")
 *             paths = (<unicode>path).encode(sys.getfilesystemencoding())
 *             self._paths = paths             # <<<<<<<<<<<<<<
 *         else:
 *             paths = <bytes>path
 */
    __Pyx_INCREF(__pyx_v_paths);
    __Pyx_GIVEREF(__pyx_v_paths);
    __Pyx_GOTREF(__pyx_v_self->_paths);
    __Pyx_DECREF(__pyx_v_self->_paths);
    __pyx_v_self->_paths = __pyx_v_paths;

/* "gevent/corecext.pyx":2024
 *         self.path = path
 *         cdef bytes paths
 *         if isinstance(path, unicode):             # <<<<<<<<<<<<<<
 *             # the famous Python3 filesystem encoding debacle hits us here. Can we do better?
 *             # We must keep a reference to the encoded string so that its bytes don't get freed
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":2031
 *             self._paths = paths
 *         else:
 *             paths = <bytes>path             # <<<<<<<<<<<<<<
 *             self._paths = paths
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
 */
  /*else*/ {
    __pyx_t_3 = __pyx_v_path;
    __Pyx_INCREF(__pyx_t_3);
    __pyx_v_paths = ((PyObject*)__pyx_t_3);
    __pyx_t_3 = 0;

/* "gevent/corecext.pyx":2032
 *         else:
 *             paths = <bytes>path
 *             self._paths = paths             # <<<<<<<<<<<<<<
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
 *         self.loop = loop
 */
    __Pyx_INCREF(__pyx_v_paths);
    __Pyx_GIVEREF(__pyx_v_paths);
    __Pyx_GOTREF(__pyx_v_self->_paths);
    __Pyx_DECREF(__pyx_v_self->_paths);
    __pyx_v_self->_paths = __pyx_v_paths;
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":2033
 *             paths = <bytes>path
 *             self._paths = paths
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  __pyx_t_8 = __Pyx_PyObject_AsString(__pyx_v_paths); if (unlikely((!__pyx_t_8) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ev_stat_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_stat), ((char *)__pyx_t_8), __pyx_v_interval);

/* "gevent/corecext.pyx":2034
 *             self._paths = paths
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
 *         self.loop = loop             # <<<<<<<<<<<<<<
 *         if ref:
 *             self._flags = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_loop));
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = __pyx_v_loop;

/* "gevent/corecext.pyx":2035
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2035; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":2036
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;

/* "gevent/corecext.pyx":2035
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>paths, interval)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
    goto __pyx_L4;
  }

/* "gevent/corecext.pyx":2038
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
  /*else*/ {
    __pyx_v_self->_flags = 4;
  }
  __pyx_L4:;

/* "gevent/corecext.pyx":2039
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_2 = (__pyx_v_priority != Py_None);
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":2040
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     property attr:
 */
    __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_priority); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_9);

/* "gevent/corecext.pyx":2039
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  }

/* "gevent/corecext.pyx":2021
 *     cdef readonly bytes _paths
 *
 *     def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         cdef bytes paths
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gevent.corecext.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_paths);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":2044
 *     property attr:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if not self._watcher.attr.st_nlink:
 *                 return
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4attr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4attr___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":2045
 *
 *         def __get__(self):
 *             if not self._watcher.attr.st_nlink:             # <<<<<<<<<<<<<<
 *                 return
 *             return _pystat_fromstructstat(&self._watcher.attr)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_watcher.attr.st_nlink != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":2046
 *         def __get__(self):
 *             if not self._watcher.attr.st_nlink:
 *                 return             # <<<<<<<<<<<<<<
 *             return _pystat_fromstructstat(&self._watcher.attr)
 *
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

/* "gevent/corecext.pyx":2045
 *
 *         def __get__(self):
 *             if not self._watcher.attr.st_nlink:             # <<<<<<<<<<<<<<
 *                 return
 *             return _pystat_fromstructstat(&self._watcher.attr)
 */
  }

/* "gevent/corecext.pyx":2047
 *             if not self._watcher.attr.st_nlink:
 *                 return
 *             return _pystat_fromstructstat(&self._watcher.attr)             # <<<<<<<<<<<<<<
 *
 *     property prev:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.attr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":2044
 *     property attr:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if not self._watcher.attr.st_nlink:
 *                 return
 */

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

/* "gevent/corecext.pyx":2051
 *     property prev:
 *
 *        def __get__(self):             # <<<<<<<<<<<<<<
 *             if not self._watcher.prev.st_nlink:
 *                 return
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4prev_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4prev___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

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

/* "gevent/corecext.pyx":2052
 *
 *        def __get__(self):
 *             if not self._watcher.prev.st_nlink:             # <<<<<<<<<<<<<<
 *                 return
 *             return _pystat_fromstructstat(&self._watcher.prev)
 */
  __pyx_t_1 = ((!(__pyx_v_self->_watcher.prev.st_nlink != 0)) != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":2053
 *        def __get__(self):
 *             if not self._watcher.prev.st_nlink:
 *                 return             # <<<<<<<<<<<<<<
 *             return _pystat_fromstructstat(&self._watcher.prev)
 *
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

/* "gevent/corecext.pyx":2052
 *
 *        def __get__(self):
 *             if not self._watcher.prev.st_nlink:             # <<<<<<<<<<<<<<
 *                 return
 *             return _pystat_fromstructstat(&self._watcher.prev)
 */
  }

/* "gevent/corecext.pyx":2054
 *             if not self._watcher.prev.st_nlink:
 *                 return
 *             return _pystat_fromstructstat(&self._watcher.prev)             # <<<<<<<<<<<<<<
 *
 *     property interval:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = _pystat_fromstructstat((&__pyx_v_self->_watcher.prev)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2054; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":2051
 *     property prev:
 *
 *        def __get__(self):             # <<<<<<<<<<<<<<
 *             if not self._watcher.prev.st_nlink:
 *                 return
 */

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

/* "gevent/corecext.pyx":2058
 *     property interval:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.interval
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_8interval_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_8interval___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/corecext.pyx":2059
 *
 *         def __get__(self):
 *             return self._watcher.interval             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_watcher.interval); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

/* "gevent/corecext.pyx":2058
 *     property interval:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.interval
 *
 */

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

/* "gevent/corecext.pyx":1915
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4loop___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4stat_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4stat_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4loop_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4stat_4loop_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_6gevent_8corecext_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1915; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.stat.loop.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4stat_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_4stat_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4loop_4__del__(((struct PyGeventStatObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_4stat_4loop_4__del__(struct PyGeventStatObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)Py_None);

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

/* "gevent/corecext.pyx":1917
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_stat _watcher
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4args___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

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

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

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4stat_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_8corecext_4stat_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4args_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_6gevent_8corecext_4stat_4args_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyTuple_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.corecext.stat.args.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_8corecext_4stat_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_8corecext_4stat_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4args_4__del__(((struct PyGeventStatObject *)__pyx_v_self));

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

static int __pyx_pf_6gevent_8corecext_4stat_4args_4__del__(struct PyGeventStatObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(__pyx_v_self->args);
  __pyx_v_self->args = ((PyObject*)Py_None);

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

/* "gevent/corecext.pyx":1918
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_stat _watcher
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_6_flags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_6_flags___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

static PyObject *__pyx_pf_6gevent_8corecext_4stat_6_flags___get__(struct PyGeventStatObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1918; __pyx_clineno = __LINE__; goto __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.corecext.stat._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/corecext.pyx":2018
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *     cdef readonly str path             # <<<<<<<<<<<<<<
 *     cdef readonly bytes _paths
 *
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_4path_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_4path___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

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

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

/* "gevent/corecext.pyx":2019
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *     cdef readonly str path
 *     cdef readonly bytes _paths             # <<<<<<<<<<<<<<
 *
 *     def __init__(self, loop loop, str path, float interval=0.0, ref=True, priority=None):
 */

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_4stat_6_paths_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_4stat_6_paths___get__(((struct PyGeventStatObject *)__pyx_v_self));

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

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

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

/* "gevent/corecext.pyx":2065
 *
 *
 * cdef void _syserr_cb(char* msg) with gil:             # <<<<<<<<<<<<<<
 *     try:
 *         __SYSERR_CALLBACK(msg, errno)
 */

static void __pyx_f_6gevent_8corecext__syserr_cb(char *__pyx_v_msg) {
  PyObject *__pyx_v_print_exc = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("_syserr_cb", 0);

/* "gevent/corecext.pyx":2066
 *
 * cdef void _syserr_cb(char* msg) with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         __SYSERR_CALLBACK(msg, errno)
 *     except:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

/* "gevent/corecext.pyx":2067
 * cdef void _syserr_cb(char* msg) with gil:
 *     try:
 *         __SYSERR_CALLBACK(msg, errno)             # <<<<<<<<<<<<<<
 *     except:
 *         set_syserr_cb(None)
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_SYSERR_CALLBACK); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_From_int(errno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_5, function);
          __pyx_t_9 = 1;
        }
      }
      __pyx_t_10 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_10);
      if (__pyx_t_8) {
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_8); __pyx_t_8 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_9, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_9, __pyx_t_7);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

/* "gevent/corecext.pyx":2066
 *
 * cdef void _syserr_cb(char* msg) with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         __SYSERR_CALLBACK(msg, errno)
 *     except:
 */
    }
    __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;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;

/* "gevent/corecext.pyx":2068
 *     try:
 *         __SYSERR_CALLBACK(msg, errno)
 *     except:             # <<<<<<<<<<<<<<
 *         set_syserr_cb(None)
 *         print_exc = getattr(traceback, 'print_exc', None)
 */
    /*except:*/ {
      __Pyx_AddTraceback("gevent.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_5, &__pyx_t_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_t_10);

/* "gevent/corecext.pyx":2069
 *         __SYSERR_CALLBACK(msg, errno)
 *     except:
 *         set_syserr_cb(None)             # <<<<<<<<<<<<<<
 *         print_exc = getattr(traceback, 'print_exc', None)
 *         if print_exc is not None:
 */
      __pyx_t_7 = __pyx_f_6gevent_8corecext_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

/* "gevent/corecext.pyx":2070
 *     except:
 *         set_syserr_cb(None)
 *         print_exc = getattr(traceback, 'print_exc', None)             # <<<<<<<<<<<<<<
 *         if print_exc is not None:
 *             print_exc()
 */
      __pyx_t_7 = __Pyx_GetModuleGlobalName(__pyx_n_s_traceback); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = __Pyx_GetAttr3(__pyx_t_7, __pyx_n_s_print_exc, Py_None); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_print_exc = __pyx_t_6;
      __pyx_t_6 = 0;

/* "gevent/corecext.pyx":2071
 *         set_syserr_cb(None)
 *         print_exc = getattr(traceback, 'print_exc', None)
 *         if print_exc is not None:             # <<<<<<<<<<<<<<
 *             print_exc()
 *
 */
      __pyx_t_11 = (__pyx_v_print_exc != Py_None);
      __pyx_t_12 = (__pyx_t_11 != 0);
      if (__pyx_t_12) {

/* "gevent/corecext.pyx":2072
 *         print_exc = getattr(traceback, 'print_exc', None)
 *         if print_exc is not None:
 *             print_exc()             # <<<<<<<<<<<<<<
 *
 *
 */
        __Pyx_INCREF(__pyx_v_print_exc);
        __pyx_t_7 = __pyx_v_print_exc; __pyx_t_8 = NULL;
        if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_8)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_8);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        if (__pyx_t_8) {
          __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        } else {
          __pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        }
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

/* "gevent/corecext.pyx":2071
 *         set_syserr_cb(None)
 *         print_exc = getattr(traceback, 'print_exc', None)
 *         if print_exc is not None:             # <<<<<<<<<<<<<<
 *             print_exc()
 *
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;

/* "gevent/corecext.pyx":2066
 *
 * cdef void _syserr_cb(char* msg) with gil:
 *     try:             # <<<<<<<<<<<<<<
 *         __SYSERR_CALLBACK(msg, errno)
 *     except:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L10_try_end:;
  }

/* "gevent/corecext.pyx":2065
 *
 *
 * cdef void _syserr_cb(char* msg) with gil:             # <<<<<<<<<<<<<<
 *     try:
 *         __SYSERR_CALLBACK(msg, errno)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_WriteUnraisable("gevent.corecext._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_print_exc);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "gevent/corecext.pyx":2075
 *
 *
 * cpdef set_syserr_cb(callback):             # <<<<<<<<<<<<<<
 *     global __SYSERR_CALLBACK
 *     if callback is None:
 */

static PyObject *__pyx_pw_6gevent_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/
static PyObject *__pyx_f_6gevent_8corecext_set_syserr_cb(PyObject *__pyx_v_callback, CYTHON_UNUSED int __pyx_skip_dispatch) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_syserr_cb", 0);

/* "gevent/corecext.pyx":2077
 * cpdef set_syserr_cb(callback):
 *     global __SYSERR_CALLBACK
 *     if callback is None:             # <<<<<<<<<<<<<<
 *         libev.ev_set_syserr_cb(NULL)
 *         __SYSERR_CALLBACK = None
 */
  __pyx_t_1 = (__pyx_v_callback == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

/* "gevent/corecext.pyx":2078
 *     global __SYSERR_CALLBACK
 *     if callback is None:
 *         libev.ev_set_syserr_cb(NULL)             # <<<<<<<<<<<<<<
 *         __SYSERR_CALLBACK = None
 *     elif callable(callback):
 */
    ev_set_syserr_cb(NULL);

/* "gevent/corecext.pyx":2079
 *     if callback is None:
 *         libev.ev_set_syserr_cb(NULL)
 *         __SYSERR_CALLBACK = None             # <<<<<<<<<<<<<<
 *     elif callable(callback):
 *         libev.ev_set_syserr_cb(<void *>_syserr_cb)
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2079; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":2077
 * cpdef set_syserr_cb(callback):
 *     global __SYSERR_CALLBACK
 *     if callback is None:             # <<<<<<<<<<<<<<
 *         libev.ev_set_syserr_cb(NULL)
 *         __SYSERR_CALLBACK = None
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":2080
 *         libev.ev_set_syserr_cb(NULL)
 *         __SYSERR_CALLBACK = None
 *     elif callable(callback):             # <<<<<<<<<<<<<<
 *         libev.ev_set_syserr_cb(<void *>_syserr_cb)
 *         __SYSERR_CALLBACK = callback
 */
  __pyx_t_2 = __Pyx_PyCallable_Check(__pyx_v_callback); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

/* "gevent/corecext.pyx":2081
 *         __SYSERR_CALLBACK = None
 *     elif callable(callback):
 *         libev.ev_set_syserr_cb(<void *>_syserr_cb)             # <<<<<<<<<<<<<<
 *         __SYSERR_CALLBACK = callback
 *     else:
 */
    ev_set_syserr_cb(((void *)__pyx_f_6gevent_8corecext__syserr_cb));

/* "gevent/corecext.pyx":2082
 *     elif callable(callback):
 *         libev.ev_set_syserr_cb(<void *>_syserr_cb)
 *         __SYSERR_CALLBACK = callback             # <<<<<<<<<<<<<<
 *     else:
 *         raise TypeError('Expected callable or None, got %r' % (callback, ))
 */
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, __pyx_v_callback) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2082; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":2080
 *         libev.ev_set_syserr_cb(NULL)
 *         __SYSERR_CALLBACK = None
 *     elif callable(callback):             # <<<<<<<<<<<<<<
 *         libev.ev_set_syserr_cb(<void *>_syserr_cb)
 *         __SYSERR_CALLBACK = callback
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":2084
 *         __SYSERR_CALLBACK = callback
 *     else:
 *         raise TypeError('Expected callable or None, got %r' % (callback, ))             # <<<<<<<<<<<<<<
 *
 *
 */
  /*else*/ {
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2084; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":2075
 *
 *
 * cpdef set_syserr_cb(callback):             # <<<<<<<<<<<<<<
 *     global __SYSERR_CALLBACK
 *     if callback is None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gevent.corecext.set_syserr_cb", __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_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/
static PyObject *__pyx_pw_6gevent_8corecext_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_syserr_cb (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_8corecext_20set_syserr_cb(__pyx_self, ((PyObject *)__pyx_v_callback));

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

static PyObject *__pyx_pf_6gevent_8corecext_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("set_syserr_cb", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_8corecext_set_syserr_cb(__pyx_v_callback, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; __pyx_clineno = __LINE__; goto __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.corecext.set_syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_6gevent_8corecext__EVENTSType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext__EVENTSType(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

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

static PyTypeObject __pyx_type_6gevent_8corecext__EVENTSType = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext._EVENTSType", /*tp_name*/
  sizeof(struct __pyx_obj_6gevent_8corecext__EVENTSType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext__EVENTSType, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6gevent_8corecext_11_EVENTSType_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext__EVENTSType, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext__EVENTSType, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_6gevent_8corecext_loop __pyx_vtable_6gevent_8corecext_loop;

static PyObject *__pyx_tp_new_6gevent_8corecext_loop(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct PyGeventLoopObject *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventLoopObject *)o);
  p->__pyx_vtab = __pyx_vtabptr_6gevent_8corecext_loop;
  p->error_handler = Py_None; Py_INCREF(Py_None);
  p->_callbacks = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_loop(PyObject *o) {
  struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_6gevent_8corecext_4loop_7__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->error_handler);
  Py_CLEAR(p->_callbacks);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_loop(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o;
  if (p->error_handler) {
    e = (*v)(p->error_handler, a); if (e) return e;
  }
  if (p->_callbacks) {
    e = (*v)(p->_callbacks, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_loop(PyObject *o) {
  PyObject* tmp;
  struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o;
  tmp = ((PyObject*)p->error_handler);
  p->error_handler = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callbacks);
  p->_callbacks = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_ptr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_3ptr_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_WatcherType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_11WatcherType_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_MAXPRI(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_6MAXPRI_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_MINPRI(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_6MINPRI_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_default(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_7default_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_iteration(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_9iteration_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_depth(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_5depth_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_backend_int(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_11backend_int_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_backend(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_7backend_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_pendingcnt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_10pendingcnt_1__get__(o);
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_getprop_6gevent_8corecext_4loop_activecnt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_9activecnt_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_sig_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_11sig_pending_1__get__(o);
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_getprop_6gevent_8corecext_4loop_sigfd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_5sigfd_1__get__(o);
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_getprop_6gevent_8corecext_4loop_origflags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_9origflags_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop_origflags_int(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_13origflags_int_1__get__(o);
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_getprop_6gevent_8corecext_4loop_error_handler(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_13error_handler_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4loop_error_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4loop_13error_handler_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_4loop_13error_handler_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4loop__callbacks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4loop_10_callbacks_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4loop__callbacks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4loop_10_callbacks_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_4loop_10_callbacks_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6gevent_8corecext_loop[] = {
  {"_stop_watchers", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_3_stop_watchers, METH_NOARGS, 0},
  {"destroy", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_5destroy, METH_NOARGS, 0},
  {"_handle_syserr", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_9_handle_syserr, METH_VARARGS|METH_KEYWORDS, 0},
  {"handle_error", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_11handle_error, METH_VARARGS|METH_KEYWORDS, 0},
  {"_default_handle_error", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_13_default_handle_error, METH_VARARGS|METH_KEYWORDS, 0},
  {"run", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_15run, METH_VARARGS|METH_KEYWORDS, 0},
  {"reinit", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_17reinit, METH_NOARGS, 0},
  {"ref", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_19ref, METH_NOARGS, 0},
  {"unref", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_21unref, METH_NOARGS, 0},
  {"break_", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_23break_, METH_VARARGS|METH_KEYWORDS, 0},
  {"verify", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_25verify, METH_NOARGS, 0},
  {"now", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_27now, METH_NOARGS, 0},
  {"update", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_29update, METH_NOARGS, 0},
  {"io", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_33io, METH_VARARGS|METH_KEYWORDS, 0},
  {"timer", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_35timer, METH_VARARGS|METH_KEYWORDS, 0},
  {"signal", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_37signal, METH_VARARGS|METH_KEYWORDS, 0},
  {"idle", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_39idle, METH_VARARGS|METH_KEYWORDS, 0},
  {"prepare", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_41prepare, METH_VARARGS|METH_KEYWORDS, 0},
  {"check", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_43check, METH_VARARGS|METH_KEYWORDS, 0},
  {"fork", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_45fork, METH_VARARGS|METH_KEYWORDS, 0},
  {"async", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_47async, METH_VARARGS|METH_KEYWORDS, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  {"child", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_49child, METH_VARARGS|METH_KEYWORDS, 0},
  {"install_sigchld", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_51install_sigchld, METH_NOARGS, 0},
  {"stat", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_53stat, METH_VARARGS|METH_KEYWORDS, 0},
  {"run_callback", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_55run_callback, METH_VARARGS|METH_KEYWORDS, 0},
  {"_format", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_57_format, METH_NOARGS, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  {"stat", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_49stat, METH_VARARGS|METH_KEYWORDS, 0},
  {"run_callback", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_51run_callback, METH_VARARGS|METH_KEYWORDS, 0},
  {"_format", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_53_format, METH_NOARGS, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  {"_format_details", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_59_format_details, METH_NOARGS, 0},
  {"fileno", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_61fileno, METH_NOARGS, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
  {"_format_details", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_55_format_details, METH_NOARGS, 0},
  {"fileno", (PyCFunction)__pyx_pw_6gevent_8corecext_4loop_57fileno, METH_NOARGS, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_loop[] = {
  {(char *)"ptr", __pyx_getprop_6gevent_8corecext_4loop_ptr, 0, 0, 0},
  {(char *)"WatcherType", __pyx_getprop_6gevent_8corecext_4loop_WatcherType, 0, 0, 0},
  {(char *)"MAXPRI", __pyx_getprop_6gevent_8corecext_4loop_MAXPRI, 0, 0, 0},
  {(char *)"MINPRI", __pyx_getprop_6gevent_8corecext_4loop_MINPRI, 0, 0, 0},
  {(char *)"default", __pyx_getprop_6gevent_8corecext_4loop_default, 0, 0, 0},
  {(char *)"iteration", __pyx_getprop_6gevent_8corecext_4loop_iteration, 0, 0, 0},
  {(char *)"depth", __pyx_getprop_6gevent_8corecext_4loop_depth, 0, 0, 0},
  {(char *)"backend_int", __pyx_getprop_6gevent_8corecext_4loop_backend_int, 0, 0, 0},
  {(char *)"backend", __pyx_getprop_6gevent_8corecext_4loop_backend, 0, 0, 0},
  {(char *)"pendingcnt", __pyx_getprop_6gevent_8corecext_4loop_pendingcnt, 0, 0, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {(char *)"activecnt", __pyx_getprop_6gevent_8corecext_4loop_activecnt, 0, 0, 0},
  {(char *)"sig_pending", __pyx_getprop_6gevent_8corecext_4loop_sig_pending, 0, 0, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {(char *)"sigfd", __pyx_getprop_6gevent_8corecext_4loop_sigfd, 0, 0, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {(char *)"origflags", __pyx_getprop_6gevent_8corecext_4loop_origflags, 0, 0, 0},
  {(char *)"origflags_int", __pyx_getprop_6gevent_8corecext_4loop_origflags_int, 0, 0, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {(char *)"error_handler", __pyx_getprop_6gevent_8corecext_4loop_error_handler, __pyx_setprop_6gevent_8corecext_4loop_error_handler, 0, 0},
  {(char *)"_callbacks", __pyx_getprop_6gevent_8corecext_4loop__callbacks, __pyx_setprop_6gevent_8corecext_4loop__callbacks, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventLoop_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.loop", /*tp_name*/
  sizeof(struct PyGeventLoopObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_loop, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6gevent_8corecext_4loop_31__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_loop, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_loop, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_loop, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_loop, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_4loop_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_loop, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_callback(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct PyGeventCallbackObject *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventCallbackObject *)o);
  p->callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_callback(PyObject *o) {
  struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->callback);
  Py_CLEAR(p->args);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_callback(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o;
  if (p->callback) {
    e = (*v)(p->callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_callback(PyObject *o) {
  PyObject* tmp;
  struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o;
  tmp = ((PyObject*)p->callback);
  p->callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_8callback_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_8callback_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_8callback_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_8callback_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_8callback_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_8callback_8callback_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_8callback_8callback_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_8callback_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_8callback_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_8callback_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_8callback_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_8callback_4args_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6gevent_8corecext_callback[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_8callback_3stop, METH_NOARGS, 0},
  {"_format", (PyCFunction)__pyx_pw_6gevent_8corecext_8callback_9_format, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_callback[] = {
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_8callback_pending, 0, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_8callback_callback, __pyx_setprop_6gevent_8corecext_8callback_callback, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_8callback_args, __pyx_setprop_6gevent_8corecext_8callback_args, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_callback = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  __pyx_pw_6gevent_8corecext_8callback_5__nonzero__, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || CYTHON_COMPILING_IN_PYPY
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

DL_EXPORT(PyTypeObject) PyGeventCallback_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.callback", /*tp_name*/
  sizeof(struct PyGeventCallbackObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_callback, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6gevent_8corecext_8callback_7__repr__, /*tp_repr*/
  &__pyx_tp_as_number_callback, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_callback, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_callback, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_callback, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_callback, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_8callback_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_callback, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_watcher(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_watcher(PyObject *o) {
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_watcher[] = {
  {"_format", (PyCFunction)__pyx_pw_6gevent_8corecext_7watcher_3_format, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventWatcher_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.watcher", /*tp_name*/
  sizeof(struct PyGeventWatcherObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_watcher, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Abstract base class for all the watchers", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_watcher, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_watcher, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_io(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventIOObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventIOObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  if (unlikely(__pyx_pw_6gevent_8corecext_2io_11__cinit__(o, __pyx_empty_tuple, NULL) < 0)) {
    Py_DECREF(o); o = 0;
  }
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_io(PyObject *o) {
  struct PyGeventIOObject *p = (struct PyGeventIOObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_6gevent_8corecext_2io_13__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_io(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventIOObject *p = (struct PyGeventIOObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_io)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_io(PyObject *o) {
  PyObject* tmp;
  struct PyGeventIOObject *p = (struct PyGeventIOObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_io);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_2io_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_2io_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_2io_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_2io_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_2io_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_2io_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_fd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_2fd_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_2io_fd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_2io_2fd_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_events(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_6events_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_2io_events(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_2io_6events_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_events_str(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_10events_str_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_2io_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_2io_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_2io_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_2io_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_2io_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_2io_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_2io__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_2io_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_io[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_2io_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_2io_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_2io_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {"_format", (PyCFunction)__pyx_pw_6gevent_8corecext_2io_9_format, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_io[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_2io_ref, __pyx_setprop_6gevent_8corecext_2io_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_2io_callback, __pyx_setprop_6gevent_8corecext_2io_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_2io_priority, __pyx_setprop_6gevent_8corecext_2io_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_2io_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_2io_pending, 0, 0, 0},
  {(char *)"fd", __pyx_getprop_6gevent_8corecext_2io_fd, __pyx_setprop_6gevent_8corecext_2io_fd, 0, 0},
  {(char *)"events", __pyx_getprop_6gevent_8corecext_2io_events, __pyx_setprop_6gevent_8corecext_2io_events, 0, 0},
  {(char *)"events_str", __pyx_getprop_6gevent_8corecext_2io_events_str, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_2io_loop, __pyx_setprop_6gevent_8corecext_2io_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_2io_args, __pyx_setprop_6gevent_8corecext_2io_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_2io__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventIO_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.io", /*tp_name*/
  sizeof(struct PyGeventIOObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_io, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_io, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_io, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_io, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_io, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_2io_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_io, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_timer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventTimerObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventTimerObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_timer(PyObject *o) {
  struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_timer(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_timer)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_timer(PyObject *o) {
  PyObject* tmp;
  struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_timer);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5timer_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5timer_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5timer_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5timer_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5timer_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5timer_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer_at(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_2at_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5timer_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5timer_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_5timer_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5timer_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5timer_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_5timer_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5timer__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5timer_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_timer[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_5timer_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_5timer_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_5timer_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {"again", (PyCFunction)__pyx_pw_6gevent_8corecext_5timer_9again, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_timer[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_5timer_ref, __pyx_setprop_6gevent_8corecext_5timer_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_5timer_callback, __pyx_setprop_6gevent_8corecext_5timer_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_5timer_priority, __pyx_setprop_6gevent_8corecext_5timer_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_5timer_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_5timer_pending, 0, 0, 0},
  {(char *)"at", __pyx_getprop_6gevent_8corecext_5timer_at, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_5timer_loop, __pyx_setprop_6gevent_8corecext_5timer_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_5timer_args, __pyx_setprop_6gevent_8corecext_5timer_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_5timer__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventTimer_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.timer", /*tp_name*/
  sizeof(struct PyGeventTimerObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_timer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_timer, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_timer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_timer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_timer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_5timer_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_timer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_signal(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventSignalObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventSignalObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_signal(PyObject *o) {
  struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_signal(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_signal)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_signal(PyObject *o) {
  PyObject* tmp;
  struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_signal);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_6signal_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_6signal_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_6signal_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_6signal_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_6signal_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_6signal_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_6signal_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_6signal_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_6signal_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_6signal_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_6signal_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_6signal_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_6signal_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_6signal_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_6signal_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_6signal_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_6signal_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_6signal_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_6signal_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_6signal_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_6signal_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_6signal_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_6signal_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_6signal_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_6signal_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_6signal_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_6signal__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_6signal_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_signal[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_6signal_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_6signal_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_6signal_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_signal[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_6signal_ref, __pyx_setprop_6gevent_8corecext_6signal_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_6signal_callback, __pyx_setprop_6gevent_8corecext_6signal_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_6signal_priority, __pyx_setprop_6gevent_8corecext_6signal_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_6signal_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_6signal_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_6signal_loop, __pyx_setprop_6gevent_8corecext_6signal_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_6signal_args, __pyx_setprop_6gevent_8corecext_6signal_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_6signal__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventSignal_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.signal", /*tp_name*/
  sizeof(struct PyGeventSignalObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_signal, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_signal, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_signal, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_signal, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_signal, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_6signal_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_signal, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_idle(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventIdleObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventIdleObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_idle(PyObject *o) {
  struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_idle(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_idle)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_idle(PyObject *o) {
  PyObject* tmp;
  struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_idle);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_4idle_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4idle_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4idle_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4idle_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4idle_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4idle_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4idle_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4idle_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4idle_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4idle_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4idle_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4idle_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4idle_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4idle_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4idle_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4idle_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4idle_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4idle_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4idle_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4idle_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_4idle_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4idle_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4idle_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4idle_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4idle_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_4idle_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4idle__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4idle_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_idle[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_4idle_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_4idle_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_4idle_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_idle[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_4idle_ref, __pyx_setprop_6gevent_8corecext_4idle_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_4idle_callback, __pyx_setprop_6gevent_8corecext_4idle_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_4idle_priority, __pyx_setprop_6gevent_8corecext_4idle_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_4idle_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_4idle_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_4idle_loop, __pyx_setprop_6gevent_8corecext_4idle_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_4idle_args, __pyx_setprop_6gevent_8corecext_4idle_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_4idle__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventIdle_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.idle", /*tp_name*/
  sizeof(struct PyGeventIdleObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_idle, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_idle, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_idle, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_idle, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_idle, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_4idle_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_idle, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_prepare(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventPrepareObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventPrepareObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_prepare(PyObject *o) {
  struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_prepare(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_prepare)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_prepare(PyObject *o) {
  PyObject* tmp;
  struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_prepare);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_7prepare_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_7prepare_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_7prepare_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_7prepare_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_7prepare_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_7prepare_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_7prepare_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_7prepare_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_7prepare_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_7prepare_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_7prepare_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_7prepare_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_7prepare_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_7prepare_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_7prepare_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_7prepare_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_7prepare_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_7prepare_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_7prepare_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_7prepare_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_7prepare_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_7prepare_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_7prepare_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_7prepare_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_7prepare_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_7prepare_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_7prepare__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_7prepare_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_prepare[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_7prepare_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_7prepare_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_7prepare_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_prepare[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_7prepare_ref, __pyx_setprop_6gevent_8corecext_7prepare_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_7prepare_callback, __pyx_setprop_6gevent_8corecext_7prepare_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_7prepare_priority, __pyx_setprop_6gevent_8corecext_7prepare_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_7prepare_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_7prepare_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_7prepare_loop, __pyx_setprop_6gevent_8corecext_7prepare_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_7prepare_args, __pyx_setprop_6gevent_8corecext_7prepare_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_7prepare__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventPrepare_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.prepare", /*tp_name*/
  sizeof(struct PyGeventPrepareObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_prepare, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_prepare, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_prepare, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_prepare, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_prepare, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_7prepare_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_prepare, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_check(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventCheckObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventCheckObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_check(PyObject *o) {
  struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_check(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_check)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_check(PyObject *o) {
  PyObject* tmp;
  struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_check);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_5check_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5check_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5check_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5check_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5check_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5check_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5check_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5check_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5check_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5check_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5check_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5check_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5check_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5check_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5check_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5check_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5check_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5check_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5check_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5check_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_5check_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5check_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5check_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5check_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5check_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_5check_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5check__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5check_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_check[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_5check_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_5check_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_5check_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_check[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_5check_ref, __pyx_setprop_6gevent_8corecext_5check_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_5check_callback, __pyx_setprop_6gevent_8corecext_5check_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_5check_priority, __pyx_setprop_6gevent_8corecext_5check_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_5check_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_5check_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_5check_loop, __pyx_setprop_6gevent_8corecext_5check_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_5check_args, __pyx_setprop_6gevent_8corecext_5check_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_5check__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventCheck_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.check", /*tp_name*/
  sizeof(struct PyGeventCheckObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_check, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_check, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_check, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_check, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_check, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_5check_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_check, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_fork(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventForkObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventForkObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_fork(PyObject *o) {
  struct PyGeventForkObject *p = (struct PyGeventForkObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_fork(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventForkObject *p = (struct PyGeventForkObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_fork)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_fork(PyObject *o) {
  PyObject* tmp;
  struct PyGeventForkObject *p = (struct PyGeventForkObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_fork);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_4fork_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4fork_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4fork_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4fork_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4fork_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4fork_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4fork_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4fork_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4fork_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4fork_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4fork_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4fork_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4fork_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4fork_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4fork_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4fork_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4fork_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4fork_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4fork_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4fork_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_4fork_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4fork_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4fork_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4fork_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4fork_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_4fork_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4fork__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4fork_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_fork[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_4fork_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_4fork_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_4fork_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_fork[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_4fork_ref, __pyx_setprop_6gevent_8corecext_4fork_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_4fork_callback, __pyx_setprop_6gevent_8corecext_4fork_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_4fork_priority, __pyx_setprop_6gevent_8corecext_4fork_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_4fork_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_4fork_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_4fork_loop, __pyx_setprop_6gevent_8corecext_4fork_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_4fork_args, __pyx_setprop_6gevent_8corecext_4fork_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_4fork__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventFork_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.fork", /*tp_name*/
  sizeof(struct PyGeventForkObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_fork, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_fork, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_fork, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_fork, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_fork, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_4fork_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_fork, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_8corecext_async(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventAsyncObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventAsyncObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_async(PyObject *o) {
  struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_async(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_async)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_async(PyObject *o) {
  PyObject* tmp;
  struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_async);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_5async_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5async_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5async_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5async_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5async_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5async_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5async_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5async_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5async_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5async_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5async_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5async_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5async_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5async_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5async_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5async_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5async_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5async_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5async_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5async_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_5async_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5async_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5async_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5async_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5async_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_5async_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5async__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5async_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_async[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_5async_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_5async_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_5async_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {"send", (PyCFunction)__pyx_pw_6gevent_8corecext_5async_9send, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_async[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_5async_ref, __pyx_setprop_6gevent_8corecext_5async_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_5async_callback, __pyx_setprop_6gevent_8corecext_5async_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_5async_priority, __pyx_setprop_6gevent_8corecext_5async_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_5async_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_5async_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_5async_loop, __pyx_setprop_6gevent_8corecext_5async_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_5async_args, __pyx_setprop_6gevent_8corecext_5async_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_5async__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventAsync_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.async", /*tp_name*/
  sizeof(struct PyGeventAsyncObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_async, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_async, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_async, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_async, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_async, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_5async_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_async, /*tp_new*/
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_tp_new_6gevent_8corecext_child(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventChildObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventChildObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_child(PyObject *o) {
  struct PyGeventChildObject *p = (struct PyGeventChildObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_child(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventChildObject *p = (struct PyGeventChildObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_child)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_child(PyObject *o) {
  PyObject* tmp;
  struct PyGeventChildObject *p = (struct PyGeventChildObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_child);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5child_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5child_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5child_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5child_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5child_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5child_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_pid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_3pid_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_rpid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_4rpid_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5child_rpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5child_4rpid_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_rstatus(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_7rstatus_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5child_rstatus(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5child_7rstatus_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5child_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5child_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_5child_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_5child_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_5child_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_5child_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_5child__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_5child_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_child[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_5child_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_5child_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_5child_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {"_format", (PyCFunction)__pyx_pw_6gevent_8corecext_5child_9_format, METH_NOARGS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_child[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_5child_ref, __pyx_setprop_6gevent_8corecext_5child_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_5child_callback, __pyx_setprop_6gevent_8corecext_5child_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_5child_priority, __pyx_setprop_6gevent_8corecext_5child_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_5child_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_5child_pending, 0, 0, 0},
  {(char *)"pid", __pyx_getprop_6gevent_8corecext_5child_pid, 0, 0, 0},
  {(char *)"rpid", __pyx_getprop_6gevent_8corecext_5child_rpid, __pyx_setprop_6gevent_8corecext_5child_rpid, 0, 0},
  {(char *)"rstatus", __pyx_getprop_6gevent_8corecext_5child_rstatus, __pyx_setprop_6gevent_8corecext_5child_rstatus, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_5child_loop, __pyx_setprop_6gevent_8corecext_5child_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_5child_args, __pyx_setprop_6gevent_8corecext_5child_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_5child__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventChild_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.child", /*tp_name*/
  sizeof(struct PyGeventChildObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_child, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_child, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_child, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_child, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_child, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_5child_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_child, /*tp_new*/
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_tp_new_6gevent_8corecext_stat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventStatObject *p;
  PyObject *o = __pyx_tp_new_6gevent_8corecext_watcher(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventStatObject *)o);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  p->_callback = Py_None; Py_INCREF(Py_None);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->path = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->_paths = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext_stat(PyObject *o) {
  struct PyGeventStatObject *p = (struct PyGeventStatObject *)o;
  #if PY_VERSION_HEX >= 0x030400a1
  if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  Py_CLEAR(p->path);
  Py_CLEAR(p->_paths);
  #if CYTHON_COMPILING_IN_CPYTHON
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_8corecext_watcher(o);
}

static int __pyx_tp_traverse_6gevent_8corecext_stat(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventStatObject *p = (struct PyGeventStatObject *)o;
  e = ((likely(__pyx_ptype_6gevent_8corecext_watcher)) ? ((__pyx_ptype_6gevent_8corecext_watcher->tp_traverse) ? __pyx_ptype_6gevent_8corecext_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_8corecext_stat)); if (e) return e;
  if (p->loop) {
    e = (*v)(((PyObject*)p->loop), a); if (e) return e;
  }
  if (p->_callback) {
    e = (*v)(p->_callback, a); if (e) return e;
  }
  if (p->args) {
    e = (*v)(p->args, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext_stat(PyObject *o) {
  PyObject* tmp;
  struct PyGeventStatObject *p = (struct PyGeventStatObject *)o;
  if (likely(__pyx_ptype_6gevent_8corecext_watcher)) { if (__pyx_ptype_6gevent_8corecext_watcher->tp_clear) __pyx_ptype_6gevent_8corecext_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_8corecext_stat);
  tmp = ((PyObject*)p->loop);
  p->loop = ((struct PyGeventLoopObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->_callback);
  p->_callback = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->args);
  p->args = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4stat_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4stat_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4stat_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4stat_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4stat_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4stat_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_attr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_4attr_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_prev(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_4prev_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_interval(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_8interval_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4stat_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4stat_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_4stat_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_8corecext_4stat_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_8corecext_4stat_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_8corecext_4stat_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_6_flags_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat_path(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_4path_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_8corecext_4stat__paths(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_8corecext_4stat_6_paths_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_8corecext_stat[] = {
  {"stop", (PyCFunction)__pyx_pw_6gevent_8corecext_4stat_1stop, METH_NOARGS, 0},
  {"feed", (PyCFunction)__pyx_pw_6gevent_8corecext_4stat_3feed, METH_VARARGS|METH_KEYWORDS, 0},
  {"start", (PyCFunction)__pyx_pw_6gevent_8corecext_4stat_5start, METH_VARARGS|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_8corecext_stat[] = {
  {(char *)"ref", __pyx_getprop_6gevent_8corecext_4stat_ref, __pyx_setprop_6gevent_8corecext_4stat_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_8corecext_4stat_callback, __pyx_setprop_6gevent_8corecext_4stat_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_8corecext_4stat_priority, __pyx_setprop_6gevent_8corecext_4stat_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_8corecext_4stat_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_8corecext_4stat_pending, 0, 0, 0},
  {(char *)"attr", __pyx_getprop_6gevent_8corecext_4stat_attr, 0, 0, 0},
  {(char *)"prev", __pyx_getprop_6gevent_8corecext_4stat_prev, 0, 0, 0},
  {(char *)"interval", __pyx_getprop_6gevent_8corecext_4stat_interval, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_8corecext_4stat_loop, __pyx_setprop_6gevent_8corecext_4stat_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_8corecext_4stat_args, __pyx_setprop_6gevent_8corecext_4stat_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_8corecext_4stat__flags, 0, 0, 0},
  {(char *)"path", __pyx_getprop_6gevent_8corecext_4stat_path, 0, 0, 0},
  {(char *)"_paths", __pyx_getprop_6gevent_8corecext_4stat__paths, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventStat_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.stat", /*tp_name*/
  sizeof(struct PyGeventStatObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext_stat, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_8corecext_7watcher_1__repr__, /*tp_repr*/
  #else
  0, /*tp_repr*/
  #endif
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext_stat, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext_stat, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_8corecext_stat, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_8corecext_stat, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_8corecext_4stat_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext_stat, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *__pyx_freelist_6gevent_8corecext___pyx_scope_struct__genexpr[8];
static int __pyx_freecount_6gevent_8corecext___pyx_scope_struct__genexpr = 0;

static PyObject *__pyx_tp_new_6gevent_8corecext___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_6gevent_8corecext___pyx_scope_struct__genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr)))) {
    o = (PyObject*)__pyx_freelist_6gevent_8corecext___pyx_scope_struct__genexpr[--__pyx_freecount_6gevent_8corecext___pyx_scope_struct__genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6gevent_8corecext___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_flag);
  Py_CLEAR(p->__pyx_v_string);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_6gevent_8corecext___pyx_scope_struct__genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr)))) {
    __pyx_freelist_6gevent_8corecext___pyx_scope_struct__genexpr[__pyx_freecount_6gevent_8corecext___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6gevent_8corecext___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *)o;
  if (p->__pyx_v_flag) {
    e = (*v)(p->__pyx_v_flag, a); if (e) return e;
  }
  if (p->__pyx_v_string) {
    e = (*v)(p->__pyx_v_string, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_8corecext___pyx_scope_struct__genexpr(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr *)o;
  tmp = ((PyObject*)p->__pyx_v_flag);
  p->__pyx_v_flag = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->__pyx_v_string);
  p->__pyx_v_string = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_6gevent_8corecext___pyx_scope_struct__genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "gevent.corecext.__pyx_scope_struct__genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_6gevent_8corecext___pyx_scope_struct__genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_8corecext___pyx_scope_struct__genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_6gevent_8corecext___pyx_scope_struct__genexpr, /*tp_traverse*/
  __pyx_tp_clear_6gevent_8corecext___pyx_scope_struct__genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_8corecext___pyx_scope_struct__genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {"_flags_to_list", (PyCFunction)__pyx_pw_6gevent_8corecext_5_flags_to_list, METH_O, 0},
  {"_flags_to_int", (PyCFunction)__pyx_pw_6gevent_8corecext_7_flags_to_int, METH_O, 0},
  {"_check_flags", (PyCFunction)__pyx_pw_6gevent_8corecext_9_check_flags, METH_O, 0},
  {"_events_to_str", (PyCFunction)__pyx_pw_6gevent_8corecext_11_events_to_str, METH_O, 0},
  {"set_syserr_cb", (PyCFunction)__pyx_pw_6gevent_8corecext_21set_syserr_cb, METH_O, 0},
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
  #if PY_VERSION_HEX < 0x03020000
    { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  #else
    PyModuleDef_HEAD_INIT,
  #endif
    "corecext",
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
  {&__pyx_n_s_ASYNC, __pyx_k_ASYNC, sizeof(__pyx_k_ASYNC), 0, 0, 1, 1},
  {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  {&__pyx_n_s_BACKEND_EPOLL, __pyx_k_BACKEND_EPOLL, sizeof(__pyx_k_BACKEND_EPOLL), 0, 0, 1, 1},
  {&__pyx_n_s_BACKEND_KQUEUE, __pyx_k_BACKEND_KQUEUE, sizeof(__pyx_k_BACKEND_KQUEUE), 0, 0, 1, 1},
  {&__pyx_n_s_BACKEND_POLL, __pyx_k_BACKEND_POLL, sizeof(__pyx_k_BACKEND_POLL), 0, 0, 1, 1},
  {&__pyx_n_s_BACKEND_PORT, __pyx_k_BACKEND_PORT, sizeof(__pyx_k_BACKEND_PORT), 0, 0, 1, 1},
  {&__pyx_n_s_BACKEND_SELECT, __pyx_k_BACKEND_SELECT, sizeof(__pyx_k_BACKEND_SELECT), 0, 0, 1, 1},
  {&__pyx_n_s_CHECK, __pyx_k_CHECK, sizeof(__pyx_k_CHECK), 0, 0, 1, 1},
  {&__pyx_n_s_CHILD, __pyx_k_CHILD, sizeof(__pyx_k_CHILD), 0, 0, 1, 1},
  {&__pyx_n_s_CLEANUP, __pyx_k_CLEANUP, sizeof(__pyx_k_CLEANUP), 0, 0, 1, 1},
  {&__pyx_n_s_CUSTOM, __pyx_k_CUSTOM, sizeof(__pyx_k_CUSTOM), 0, 0, 1, 1},
  {&__pyx_kp_s_Cannot_set_priority_of_an_active, __pyx_k_Cannot_set_priority_of_an_active, sizeof(__pyx_k_Cannot_set_priority_of_an_active), 0, 0, 1, 0},
  {&__pyx_n_s_EMBED, __pyx_k_EMBED, sizeof(__pyx_k_EMBED), 0, 0, 1, 1},
  {&__pyx_n_s_ERROR, __pyx_k_ERROR, sizeof(__pyx_k_ERROR), 0, 0, 1, 1},
  {&__pyx_n_s_EVENTS, __pyx_k_EVENTS, sizeof(__pyx_k_EVENTS), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_n_s_EV_USE_4HEAP, __pyx_k_EV_USE_4HEAP, sizeof(__pyx_k_EV_USE_4HEAP), 0, 0, 1, 1},
  {&__pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_k_EV_USE_CLOCK_SYSCALL, sizeof(__pyx_k_EV_USE_CLOCK_SYSCALL), 0, 0, 1, 1},
  {&__pyx_n_s_EV_USE_EVENTFD, __pyx_k_EV_USE_EVENTFD, sizeof(__pyx_k_EV_USE_EVENTFD), 0, 0, 1, 1},
  {&__pyx_n_s_EV_USE_FLOOR, __pyx_k_EV_USE_FLOOR, sizeof(__pyx_k_EV_USE_FLOOR), 0, 0, 1, 1},
  {&__pyx_n_s_EV_USE_INOTIFY, __pyx_k_EV_USE_INOTIFY, sizeof(__pyx_k_EV_USE_INOTIFY), 0, 0, 1, 1},
  {&__pyx_n_s_EV_USE_MONOTONIC, __pyx_k_EV_USE_MONOTONIC, sizeof(__pyx_k_EV_USE_MONOTONIC), 0, 0, 1, 1},
  {&__pyx_n_s_EV_USE_NANOSLEEP, __pyx_k_EV_USE_NANOSLEEP, sizeof(__pyx_k_EV_USE_NANOSLEEP), 0, 0, 1, 1},
  {&__pyx_n_s_EV_USE_REALTIME, __pyx_k_EV_USE_REALTIME, sizeof(__pyx_k_EV_USE_REALTIME), 0, 0, 1, 1},
  {&__pyx_n_s_EV_USE_SIGNALFD, __pyx_k_EV_USE_SIGNALFD, sizeof(__pyx_k_EV_USE_SIGNALFD), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_Expected_callable_not_r, __pyx_k_Expected_callable_not_r, sizeof(__pyx_k_Expected_callable_not_r), 0, 0, 1, 0},
  {&__pyx_kp_s_Expected_callable_or_None_got_r, __pyx_k_Expected_callable_or_None_got_r, sizeof(__pyx_k_Expected_callable_or_None_got_r), 0, 0, 1, 0},
  {&__pyx_n_s_FORK, __pyx_k_FORK, sizeof(__pyx_k_FORK), 0, 0, 1, 1},
  {&__pyx_n_s_FORKCHECK, __pyx_k_FORKCHECK, sizeof(__pyx_k_FORKCHECK), 0, 0, 1, 1},
  {&__pyx_n_s_IDLE, __pyx_k_IDLE, sizeof(__pyx_k_IDLE), 0, 0, 1, 1},
  {&__pyx_n_s_IOFDSET, __pyx_k_IOFDSET, sizeof(__pyx_k_IOFDSET), 0, 0, 1, 1},
  {&__pyx_kp_s_Invalid_backend_or_flag_s_Possib, __pyx_k_Invalid_backend_or_flag_s_Possib, sizeof(__pyx_k_Invalid_backend_or_flag_s_Possib), 0, 0, 1, 0},
  {&__pyx_kp_s_Invalid_value_for_backend_0x_x, __pyx_k_Invalid_value_for_backend_0x_x, sizeof(__pyx_k_Invalid_value_for_backend_0x_x), 0, 0, 1, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_LIBEV_EMBED, __pyx_k_LIBEV_EMBED, sizeof(__pyx_k_LIBEV_EMBED), 0, 0, 1, 1},
  {&__pyx_n_s_MAXPRI, __pyx_k_MAXPRI, sizeof(__pyx_k_MAXPRI), 0, 0, 1, 1},
  {&__pyx_n_s_MINPRI, __pyx_k_MINPRI, sizeof(__pyx_k_MINPRI), 0, 0, 1, 1},
  {&__pyx_n_s_NOINOTIFY, __pyx_k_NOINOTIFY, sizeof(__pyx_k_NOINOTIFY), 0, 0, 1, 1},
  {&__pyx_n_s_NONE, __pyx_k_NONE, sizeof(__pyx_k_NONE), 0, 0, 1, 1},
  {&__pyx_n_s_NOSIGMASK, __pyx_k_NOSIGMASK, sizeof(__pyx_k_NOSIGMASK), 0, 0, 1, 1},
  {&__pyx_n_s_NSIG, __pyx_k_NSIG, sizeof(__pyx_k_NSIG), 0, 0, 1, 1},
  {&__pyx_n_s_PERIODIC, __pyx_k_PERIODIC, sizeof(__pyx_k_PERIODIC), 0, 0, 1, 1},
  {&__pyx_n_s_PREPARE, __pyx_k_PREPARE, sizeof(__pyx_k_PREPARE), 0, 0, 1, 1},
  {&__pyx_n_s_READ, __pyx_k_READ, sizeof(__pyx_k_READ), 0, 0, 1, 1},
  {&__pyx_n_s_READWRITE, __pyx_k_READWRITE, sizeof(__pyx_k_READWRITE), 0, 0, 1, 1},
  {&__pyx_n_s_SIGNAL, __pyx_k_SIGNAL, sizeof(__pyx_k_SIGNAL), 0, 0, 1, 1},
  {&__pyx_n_s_SIGNALFD, __pyx_k_SIGNALFD, sizeof(__pyx_k_SIGNALFD), 0, 0, 1, 1},
  {&__pyx_n_s_STAT, __pyx_k_STAT, sizeof(__pyx_k_STAT), 0, 0, 1, 1},
  {&__pyx_n_s_SYSERR_CALLBACK, __pyx_k_SYSERR_CALLBACK, sizeof(__pyx_k_SYSERR_CALLBACK), 0, 0, 1, 1},
  {&__pyx_n_s_SystemError, __pyx_k_SystemError, sizeof(__pyx_k_SystemError), 0, 0, 1, 1},
  {&__pyx_n_s_TIMER, __pyx_k_TIMER, sizeof(__pyx_k_TIMER), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_UNDEF, __pyx_k_UNDEF, sizeof(__pyx_k_UNDEF), 0, 0, 1, 1},
  {&__pyx_kp_s_Unsupported_backend_s, __pyx_k_Unsupported_backend_s, sizeof(__pyx_k_Unsupported_backend_s), 0, 0, 1, 0},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_WRITE, __pyx_k_WRITE, sizeof(__pyx_k_WRITE), 0, 0, 1, 1},
  {&__pyx_kp_s__21, __pyx_k__21, sizeof(__pyx_k__21), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  {&__pyx_kp_s__22, __pyx_k__22, sizeof(__pyx_k__22), 0, 0, 1, 0},
  {&__pyx_kp_s__23, __pyx_k__23, sizeof(__pyx_k__23), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s__26, __pyx_k__26, sizeof(__pyx_k__26), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_kp_s__27, __pyx_k__27, sizeof(__pyx_k__27), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s__28, __pyx_k__28, sizeof(__pyx_k__28), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
  {&__pyx_kp_s__4, __pyx_k__4, sizeof(__pyx_k__4), 0, 0, 1, 0},
  {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0},
  {&__pyx_n_s_active, __pyx_k_active, sizeof(__pyx_k_active), 0, 0, 1, 1},
  {&__pyx_kp_s_active_2, __pyx_k_active_2, sizeof(__pyx_k_active_2), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_n_s_activecnt, __pyx_k_activecnt, sizeof(__pyx_k_activecnt), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1},
  {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_kp_s_args_r, __pyx_k_args_r, sizeof(__pyx_k_args_r), 0, 0, 1, 0},
  {&__pyx_n_s_backend, __pyx_k_backend, sizeof(__pyx_k_backend), 0, 0, 1, 1},
  {&__pyx_n_s_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 0, 0, 1, 1},
  {&__pyx_n_s_builtins, __pyx_k_builtins, sizeof(__pyx_k_builtins), 0, 0, 1, 1},
  {&__pyx_n_s_callback, __pyx_k_callback, sizeof(__pyx_k_callback), 0, 0, 1, 1},
  {&__pyx_kp_s_callback_must_be_callable_not_No, __pyx_k_callback_must_be_callable_not_No, sizeof(__pyx_k_callback_must_be_callable_not_No), 0, 0, 1, 0},
  {&__pyx_kp_s_callback_r, __pyx_k_callback_r, sizeof(__pyx_k_callback_r), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  {&__pyx_kp_s_child_watchers_are_only_availabl, __pyx_k_child_watchers_are_only_availabl, sizeof(__pyx_k_child_watchers_are_only_availabl), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
  {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  {&__pyx_n_s_default, __pyx_k_default, sizeof(__pyx_k_default), 0, 0, 1, 1},
  {&__pyx_kp_s_default_2, __pyx_k_default_2, sizeof(__pyx_k_default_2), 0, 0, 1, 0},
  {&__pyx_n_s_default_handle_error, __pyx_k_default_handle_error, sizeof(__pyx_k_default_handle_error), 0, 0, 1, 1},
  {&__pyx_n_s_destroyed, __pyx_k_destroyed, sizeof(__pyx_k_destroyed), 0, 0, 1, 1},
  {&__pyx_n_s_embeddable_backends, __pyx_k_embeddable_backends, sizeof(__pyx_k_embeddable_backends), 0, 0, 1, 1},
  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  {&__pyx_n_s_epoll, __pyx_k_epoll, sizeof(__pyx_k_epoll), 0, 0, 1, 1},
  {&__pyx_n_s_errno, __pyx_k_errno, sizeof(__pyx_k_errno), 0, 0, 1, 1},
  {&__pyx_kp_s_ev_default_loop_s_failed, __pyx_k_ev_default_loop_s_failed, sizeof(__pyx_k_ev_default_loop_s_failed), 0, 0, 1, 0},
  {&__pyx_kp_s_ev_loop_new_s_failed, __pyx_k_ev_loop_new_s_failed, sizeof(__pyx_k_ev_loop_new_s_failed), 0, 0, 1, 0},
  {&__pyx_n_s_events, __pyx_k_events, sizeof(__pyx_k_events), 0, 0, 1, 1},
  {&__pyx_n_s_events_2, __pyx_k_events_2, sizeof(__pyx_k_events_2), 0, 0, 1, 1},
  {&__pyx_n_s_events_str, __pyx_k_events_str, sizeof(__pyx_k_events_str), 0, 0, 1, 1},
  {&__pyx_n_s_fd, __pyx_k_fd, sizeof(__pyx_k_fd), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  {&__pyx_kp_s_fd_must_be_non_negative_r, __pyx_k_fd_must_be_non_negative_r, sizeof(__pyx_k_fd_must_be_non_negative_r), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_fd_s_events_s, __pyx_k_fd_s_events_s, sizeof(__pyx_k_fd_s_events_s), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_n_s_fileno, __pyx_k_fileno, sizeof(__pyx_k_fileno), 0, 0, 1, 1},
  {&__pyx_kp_s_fileno_2, __pyx_k_fileno_2, sizeof(__pyx_k_fileno_2), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
  {&__pyx_n_s_flags_2, __pyx_k_flags_2, sizeof(__pyx_k_flags_2), 0, 0, 1, 1},
  {&__pyx_n_s_flags_str2int, __pyx_k_flags_str2int, sizeof(__pyx_k_flags_str2int), 0, 0, 1, 1},
  {&__pyx_n_s_forkcheck, __pyx_k_forkcheck, sizeof(__pyx_k_forkcheck), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_n_s_format_details, __pyx_k_format_details, sizeof(__pyx_k_format_details), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get_header_version, __pyx_k_get_header_version, sizeof(__pyx_k_get_header_version), 0, 0, 1, 1},
  {&__pyx_n_s_get_version, __pyx_k_get_version, sizeof(__pyx_k_get_version), 0, 0, 1, 1},
  {&__pyx_n_s_getfilesystemencoding, __pyx_k_getfilesystemencoding, sizeof(__pyx_k_getfilesystemencoding), 0, 0, 1, 1},
  {&__pyx_kp_s_gevent_core_EVENTS, __pyx_k_gevent_core_EVENTS, sizeof(__pyx_k_gevent_core_EVENTS), 0, 0, 1, 0},
  {&__pyx_n_s_gevent_corecext, __pyx_k_gevent_corecext, sizeof(__pyx_k_gevent_corecext), 0, 0, 1, 1},
  {&__pyx_n_s_handle_error, __pyx_k_handle_error, sizeof(__pyx_k_handle_error), 0, 0, 1, 1},
  {&__pyx_n_s_handle_syserr, __pyx_k_handle_syserr, sizeof(__pyx_k_handle_syserr), 0, 0, 1, 1},
  {&__pyx_n_s_hex, __pyx_k_hex, sizeof(__pyx_k_hex), 0, 0, 1, 1},
  {&__pyx_n_s_how, __pyx_k_how, sizeof(__pyx_k_how), 0, 0, 1, 1},
  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
  {&__pyx_kp_s_illegal_event_mask_r, __pyx_k_illegal_event_mask_r, sizeof(__pyx_k_illegal_event_mask_r), 0, 0, 1, 0},
  {&__pyx_kp_s_illegal_signal_number_r, __pyx_k_illegal_signal_number_r, sizeof(__pyx_k_illegal_signal_number_r), 0, 0, 1, 0},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_interval, __pyx_k_interval, sizeof(__pyx_k_interval), 0, 0, 1, 1},
  {&__pyx_kp_s_io_watcher_attribute_events_is, __pyx_k_io_watcher_attribute_events_is, sizeof(__pyx_k_io_watcher_attribute_events_is), 0, 0, 1, 0},
  {&__pyx_kp_s_io_watcher_attribute_fd_is_read, __pyx_k_io_watcher_attribute_fd_is_read, sizeof(__pyx_k_io_watcher_attribute_fd_is_read), 0, 0, 1, 0},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kqueue, __pyx_k_kqueue, sizeof(__pyx_k_kqueue), 0, 0, 1, 1},
  {&__pyx_n_s_level, __pyx_k_level, sizeof(__pyx_k_level), 0, 0, 1, 1},
  {&__pyx_kp_s_libev_d_02d, __pyx_k_libev_d_02d, sizeof(__pyx_k_libev_d_02d), 0, 0, 1, 0},
  {&__pyx_n_s_loop, __pyx_k_loop, sizeof(__pyx_k_loop), 0, 0, 1, 1},
  {&__pyx_n_s_lower, __pyx_k_lower, sizeof(__pyx_k_lower), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_noenv, __pyx_k_noenv, sizeof(__pyx_k_noenv), 0, 0, 1, 1},
  {&__pyx_n_s_noinotify, __pyx_k_noinotify, sizeof(__pyx_k_noinotify), 0, 0, 1, 1},
  {&__pyx_n_s_nosigmask, __pyx_k_nosigmask, sizeof(__pyx_k_nosigmask), 0, 0, 1, 1},
  {&__pyx_n_s_nowait, __pyx_k_nowait, sizeof(__pyx_k_nowait), 0, 0, 1, 1},
  {&__pyx_n_s_once, __pyx_k_once, sizeof(__pyx_k_once), 0, 0, 1, 1},
  {&__pyx_kp_s_operation_on_destroyed_loop, __pyx_k_operation_on_destroyed_loop, sizeof(__pyx_k_operation_on_destroyed_loop), 0, 0, 1, 0},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_pass_events, __pyx_k_pass_events, sizeof(__pyx_k_pass_events), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_pending, __pyx_k_pending, sizeof(__pyx_k_pending), 0, 0, 1, 1},
  {&__pyx_kp_s_pending_2, __pyx_k_pending_2, sizeof(__pyx_k_pending_2), 0, 0, 1, 0},
  {&__pyx_kp_s_pending_s, __pyx_k_pending_s, sizeof(__pyx_k_pending_s), 0, 0, 1, 0},
  {&__pyx_n_s_pendingcnt, __pyx_k_pendingcnt, sizeof(__pyx_k_pendingcnt), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  {&__pyx_n_s_pid, __pyx_k_pid, sizeof(__pyx_k_pid), 0, 0, 1, 1},
  {&__pyx_kp_s_pid_r_rstatus_r, __pyx_k_pid_r_rstatus_r, sizeof(__pyx_k_pid_r_rstatus_r), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_n_s_poll, __pyx_k_poll, sizeof(__pyx_k_poll), 0, 0, 1, 1},
  {&__pyx_n_s_port, __pyx_k_port, sizeof(__pyx_k_port), 0, 0, 1, 1},
  {&__pyx_n_s_print_exc, __pyx_k_print_exc, sizeof(__pyx_k_print_exc), 0, 0, 1, 1},
  {&__pyx_n_s_print_exception, __pyx_k_print_exception, sizeof(__pyx_k_print_exception), 0, 0, 1, 1},
  {&__pyx_n_s_priority, __pyx_k_priority, sizeof(__pyx_k_priority), 0, 0, 1, 1},
  {&__pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_k_private_tmp_gevent_python2_7_ge, sizeof(__pyx_k_private_tmp_gevent_python2_7_ge), 0, 0, 1, 0},
  {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_recommended_backends, __pyx_k_recommended_backends, sizeof(__pyx_k_recommended_backends), 0, 0, 1, 1},
  {&__pyx_n_s_ref, __pyx_k_ref, sizeof(__pyx_k_ref), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_kp_s_ref_2, __pyx_k_ref_2, sizeof(__pyx_k_ref_2), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_n_s_repeat, __pyx_k_repeat, sizeof(__pyx_k_repeat), 0, 0, 1, 1},
  {&__pyx_kp_s_repeat_must_be_positive_or_zero, __pyx_k_repeat_must_be_positive_or_zero, sizeof(__pyx_k_repeat_must_be_positive_or_zero), 0, 0, 1, 0},
  {&__pyx_n_s_revents, __pyx_k_revents, sizeof(__pyx_k_revents), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  {&__pyx_n_s_rstatus, __pyx_k_rstatus, sizeof(__pyx_k_rstatus), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_s_at_0x_x_s, __pyx_k_s_at_0x_x_s, sizeof(__pyx_k_s_at_0x_x_s), 0, 0, 1, 0},
  {&__pyx_kp_s_s_at_0x_x_s_2, __pyx_k_s_at_0x_x_s_2, sizeof(__pyx_k_s_at_0x_x_s_2), 0, 0, 1, 0},
  {&__pyx_n_s_select, __pyx_k_select, sizeof(__pyx_k_select), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_n_s_sigfd, __pyx_k_sigfd, sizeof(__pyx_k_sigfd), 0, 0, 1, 1},
  {&__pyx_kp_s_sigfd_2, __pyx_k_sigfd_2, sizeof(__pyx_k_sigfd_2), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_n_s_signal, __pyx_k_signal, sizeof(__pyx_k_signal), 0, 0, 1, 1},
  {&__pyx_n_s_signalfd, __pyx_k_signalfd, sizeof(__pyx_k_signalfd), 0, 0, 1, 1},
  {&__pyx_n_s_signalmodule, __pyx_k_signalmodule, sizeof(__pyx_k_signalmodule), 0, 0, 1, 1},
  {&__pyx_n_s_signalnum, __pyx_k_signalnum, sizeof(__pyx_k_signalnum), 0, 0, 1, 1},
  {&__pyx_n_s_signum, __pyx_k_signum, sizeof(__pyx_k_signum), 0, 0, 1, 1},
  {&__pyx_n_s_split, __pyx_k_split, sizeof(__pyx_k_split), 0, 0, 1, 1},
  {&__pyx_n_s_stop_watchers, __pyx_k_stop_watchers, sizeof(__pyx_k_stop_watchers), 0, 0, 1, 1},
  {&__pyx_kp_s_stopped, __pyx_k_stopped, sizeof(__pyx_k_stopped), 0, 0, 1, 0},
  {&__pyx_n_s_strerror, __pyx_k_strerror, sizeof(__pyx_k_strerror), 0, 0, 1, 1},
  {&__pyx_n_s_strip, __pyx_k_strip, sizeof(__pyx_k_strip), 0, 0, 1, 1},
  {&__pyx_n_s_supported_backends, __pyx_k_supported_backends, sizeof(__pyx_k_supported_backends), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_tb, __pyx_k_tb, sizeof(__pyx_k_tb), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  {&__pyx_n_s_trace, __pyx_k_trace, sizeof(__pyx_k_trace), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_n_s_traceback, __pyx_k_traceback, sizeof(__pyx_k_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin___import__ = __Pyx_GetBuiltinName(__pyx_n_s_import); if (!__pyx_builtin___import__) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_hex = __Pyx_GetBuiltinName(__pyx_n_s_hex); if (!__pyx_builtin_hex) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_SystemError = __Pyx_GetBuiltinName(__pyx_n_s_SystemError); if (!__pyx_builtin_SystemError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  return 0;
  __pyx_L1_error:;
  return -1;
}

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

/* "gevent/corecext.pyx":170
 *     try:
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')             # <<<<<<<<<<<<<<
 *         for value in flags:
 *             value = value.strip().lower()
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

/* "gevent/corecext.pyx":374
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         cdef unsigned int flags = 0
 *         if nowait:
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

/* "gevent/corecext.pyx":390
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_ref(self._ptr)
 *
 */
  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

/* "gevent/corecext.pyx":396
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_unref(self._ptr)
 *
 */
  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__8);
  __Pyx_GIVEREF(__pyx_tuple__8);

/* "gevent/corecext.pyx":402
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_break(self._ptr, how)
 *
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

/* "gevent/corecext.pyx":408
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_verify(self._ptr)
 *
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

/* "gevent/corecext.pyx":414
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         return libev.ev_now(self._ptr)
 *
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

/* "gevent/corecext.pyx":420
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_now_update(self._ptr)
 *
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

/* "gevent/corecext.pyx":431
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_default_loop(self._ptr) else False
 *
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

/* "gevent/corecext.pyx":439
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_iteration(self._ptr)
 *
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

/* "gevent/corecext.pyx":447
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_depth(self._ptr)
 *
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

/* "gevent/corecext.pyx":455
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_backend(self._ptr)
 *
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

/* "gevent/corecext.pyx":463
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 *             for key, value in _flags:
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

/* "gevent/corecext.pyx":475
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_pending_count(self._ptr)
 *
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

/* "gevent/corecext.pyx":524
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         cdef callback cb = callback(func, args)
 *         self._callbacks.append(cb)
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":727
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":577
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.activecnt
 *
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 577; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

/* "gevent/corecext.pyx":585
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sig_pending
 *
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":603
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return _flags_to_list(self._ptr.origflags)
 *
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":594
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sigfd
 *
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":755
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":611
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.origflags
 *
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":603
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return _flags_to_list(self._ptr.origflags)
 *
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":773
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":611
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.origflags
 *
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":779
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

/* "gevent/corecext.pyx":793
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":727
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

#endif /* (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":795
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         if pass_events:
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":755
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":861
 *         def __set__(self, long fd):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")             # <<<<<<<<<<<<<<
 *             cdef int vfd = libev.vfd_open(fd)
 *             libev.vfd_free(self._watcher.fd)
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":773
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":755
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":873
 *         def __set__(self, int events):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")             # <<<<<<<<<<<<<<
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)
 *
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":779
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":773
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":912
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":793
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":779
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":940
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":795
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         if pass_events:
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":793
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":958
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":861
 *         def __set__(self, long fd):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")             # <<<<<<<<<<<<<<
 *             cdef int vfd = libev.vfd_open(fd)
 *             libev.vfd_free(self._watcher.fd)
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":795
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         if pass_events:
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":964
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":873
 *         def __set__(self, int events):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")             # <<<<<<<<<<<<<<
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)
 *
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":861
 *         def __set__(self, long fd):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'fd' is read-only while watcher is active")             # <<<<<<<<<<<<<<
 *             cdef int vfd = libev.vfd_open(fd)
 *             libev.vfd_free(self._watcher.fd)
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_fd_is_read); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":978
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":912
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":873
 *         def __set__(self, int events):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("'io' watcher attribute 'events' is read-only while watcher is active")             # <<<<<<<<<<<<<<
 *             libev.ev_io_init(&self._watcher, <void *>gevent_callback_io, self._watcher.fd, events)
 *
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_io_watcher_attribute_events_is); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":980
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":940
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":912
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1026
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":958
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":940
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 940; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1057
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":964
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":958
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1085
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":978
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":964
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1103
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":980
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":978
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1109
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1026
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":980
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 980; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1123
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1057
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1026
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1026; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1125
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1085
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1057
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1182
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1103
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1085
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1085; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1210
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1109
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1103
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1228
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1123
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1109
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1234
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1125
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1123
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1248
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1182
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1125
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1250
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1210
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1182
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1301
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1228
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1210
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1329
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1234
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1228
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1347
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1248
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1234
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1353
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1250
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1248
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1367
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1301
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1250
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1250; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1369
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1329
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1301
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1420
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1347
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1329
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1448
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1353
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1347
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1466
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1367
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1353
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1472
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1369
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1367
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1486
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1420
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1369
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1488
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1448
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1420
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1539
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1466
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1448
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1567
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1472
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1466
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1585
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1486
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1472
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1591
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1488
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1486
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1605
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1539
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1488
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1488; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1607
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1567
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1539
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1539; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1658
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1585
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1567
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1567; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1686
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1591
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1585
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1704
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1605
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1591
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1710
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1607
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1605
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1724
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1658
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1607
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1726
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1686
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1658
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1658; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1761
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)
 *
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1704
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1686
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1784
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1929
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1710
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1704
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1812
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1957
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1724
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1710
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1830
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1975
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1726
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1724
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1836
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1981
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1761
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)
 *
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1726
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1850
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1995
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1784
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1929
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":1761
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)
 *
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1852
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1997
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1812
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1957
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1784
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1929
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1876
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
 *         if not loop.default:
 *             raise TypeError('child watchers are only available on the default loop')             # <<<<<<<<<<<<<<
 *         libev.gevent_install_sigchld_handler()
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":9
 * # Note for PY3: not doing so will leave reference to locals() on import
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)             # <<<<<<<<<<<<<<
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1830
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1975
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1812
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1812; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1957
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1929
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":10
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1836
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1981
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1830
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1975
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1957
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":11
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)             # <<<<<<<<<<<<<<
 * signalmodule = __import__('signal', level=0)
 *
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1850
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1995
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1836
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1981
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1975
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":12
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1852
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1997
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1850
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1995
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1981
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1876
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
 *         if not loop.default:
 *             raise TypeError('child watchers are only available on the default loop')             # <<<<<<<<<<<<<<
 *         libev.gevent_install_sigchld_handler()
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":9
 * # Note for PY3: not doing so will leave reference to locals() on import
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)             # <<<<<<<<<<<<<<
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1852
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":1997
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1995
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1929
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":10
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1876
 *     def __init__(self, loop loop, int pid, bint trace=0, ref=True):
 *         if not loop.default:
 *             raise TypeError('child watchers are only available on the default loop')             # <<<<<<<<<<<<<<
 *         libev.gevent_install_sigchld_handler()
 *         libev.ev_child_init(&self._watcher, <void *>gevent_callback_child, pid, trace)
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_child_watchers_are_only_availabl); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1876; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":9
 * # Note for PY3: not doing so will leave reference to locals() on import
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)             # <<<<<<<<<<<<<<
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1997
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1957
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":11
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)             # <<<<<<<<<<<<<<
 * signalmodule = __import__('signal', level=0)
 *
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1929
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":10
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":9
 * # Note for PY3: not doing so will leave reference to locals() on import
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)             # <<<<<<<<<<<<<<
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1975
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":12
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1957
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1957; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":11
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)             # <<<<<<<<<<<<<<
 * signalmodule = __import__('signal', level=0)
 *
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":10
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1981
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1975
 *         def __set__(self, int priority):
 *             if libev.ev_is_active(&self._watcher):
 *                 raise AttributeError("Cannot set priority of an active watcher")             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_Cannot_set_priority_of_an_active); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1975; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/corecext.pyx":12
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":11
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)             # <<<<<<<<<<<<<<
 * signalmodule = __import__('signal', level=0)
 *
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1995
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1981
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1981; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":12
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1997
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1995
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_operation_on_destroyed_loop); if (unlikely(!__pyx_tuple__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1995; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":9
 * # Note for PY3: not doing so will leave reference to locals() on import
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)             # <<<<<<<<<<<<<<
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":1997
 *             raise ValueError('operation on destroyed loop')
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_callback_must_be_callable_not_No); if (unlikely(!__pyx_tuple__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":10
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":9
 * # Note for PY3: not doing so will leave reference to locals() on import
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)             # <<<<<<<<<<<<<<
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_n_s_sys); if (unlikely(!__pyx_tuple__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":11
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)             # <<<<<<<<<<<<<<
 * signalmodule = __import__('signal', level=0)
 *
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":10
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_n_s_os); if (unlikely(!__pyx_tuple__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":12
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":11
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)             # <<<<<<<<<<<<<<
 * signalmodule = __import__('signal', level=0)
 *
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_n_s_traceback); if (unlikely(!__pyx_tuple__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/corecext.pyx":12
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_n_s_signal); if (unlikely(!__pyx_tuple__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
/* "gevent/corecext.pyx":100
 *
 *
 * def get_version():             # <<<<<<<<<<<<<<
 *     return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor())
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_version, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__86 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_version, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_version, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_version, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_version, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_version, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/corecext.pyx":104
 *
 *
 * def get_header_version():             # <<<<<<<<<<<<<<
 *     return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR)
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_header_version, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_header_version, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_header_version, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_header_version, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_header_version, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_get_header_version, 104, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/corecext.pyx":213
 *
 *
 * def supported_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_supported_backends())
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_supported_backends, 213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__88 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_supported_backends, 213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__99 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_supported_backends, 213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__92 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_supported_backends, 213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_supported_backends, 213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_supported_backends, 213, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/corecext.pyx":217
 *
 *
 * def recommended_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_recommended_backends())
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_recommended_backends, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_recommended_backends, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_recommended_backends, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_recommended_backends, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_recommended_backends, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_recommended_backends, 217, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/corecext.pyx":221
 *
 *
 * def embeddable_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_embeddable_backends())
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__97 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_embeddable_backends, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__90 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_embeddable_backends, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__101 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_embeddable_backends, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__94 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_embeddable_backends, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_embeddable_backends, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_embeddable_backends, 221, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/corecext.pyx":225
 *
 *
 * def time():             # <<<<<<<<<<<<<<
 *     return libev.ev_time()
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_time, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_time, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_time, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__95 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_time, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_codeobj__103 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_time, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_private_tmp_gevent_python2_7_ge, __pyx_n_s_time, 225, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC initcorecext(void); /*proto*/
PyMODINIT_FUNC initcorecext(void)
#else
PyMODINIT_FUNC PyInit_corecext(void); /*proto*/
PyMODINIT_FUNC PyInit_corecext(void)
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  PyObject *__pyx_t_14 = NULL;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *__pyx_t_17 = NULL;
  PyObject *__pyx_t_18 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_REFNANNY
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  if (!__Pyx_RefNanny) {
      PyErr_Clear();
      __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
      if (!__Pyx_RefNanny)
          Py_FatalError("failed to import 'refnanny' module");
  }
  #endif
  __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_corecext(void)", 0);
  if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("corecext", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  if (__pyx_module_is_main_gevent__corecext) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!PyDict_GetItemString(modules, "gevent.corecext")) {
      if (unlikely(PyDict_SetItemString(modules, "gevent.corecext", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  __pyx_v_6gevent_8corecext_integer_types = ((PyObject*)Py_None); Py_INCREF(Py_None);
  GEVENT_CORE_EVENTS = Py_None; Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6gevent_8corecext__EVENTSType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6gevent_8corecext__EVENTSType.tp_print = 0;
  __pyx_ptype_6gevent_8corecext__EVENTSType = &__pyx_type_6gevent_8corecext__EVENTSType;
  __pyx_vtabptr_6gevent_8corecext_loop = &__pyx_vtable_6gevent_8corecext_loop;
  __pyx_vtable_6gevent_8corecext_loop._run_callbacks = (PyObject *(*)(struct PyGeventLoopObject *))__pyx_f_6gevent_8corecext_4loop__run_callbacks;
  __pyx_vtable_6gevent_8corecext_loop.handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8corecext_4loop_handle_error;
  __pyx_vtable_6gevent_8corecext_loop._default_handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_8corecext_4loop__default_handle_error;
  if (PyType_Ready(&PyGeventLoop_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventLoop_Type.tp_print = 0;
  if (__Pyx_SetVtable(PyGeventLoop_Type.tp_dict, __pyx_vtabptr_6gevent_8corecext_loop) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (PyObject_SetAttrString(__pyx_m, "loop", (PyObject *)&PyGeventLoop_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_loop = &PyGeventLoop_Type;
  if (PyType_Ready(&PyGeventCallback_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventCallback_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "callback", (PyObject *)&PyGeventCallback_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 617; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_callback = &PyGeventCallback_Type;
  if (PyType_Ready(&PyGeventWatcher_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventWatcher_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "watcher", (PyObject *)&PyGeventWatcher_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_watcher = &PyGeventWatcher_Type;
  PyGeventIO_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventIO_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventIO_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "io", (PyObject *)&PyGeventIO_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_io = &PyGeventIO_Type;
  PyGeventTimer_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventTimer_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventTimer_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "timer", (PyObject *)&PyGeventTimer_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_timer = &PyGeventTimer_Type;
  PyGeventSignal_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventSignal_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventSignal_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "signal", (PyObject *)&PyGeventSignal_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_signal = &PyGeventSignal_Type;
  PyGeventIdle_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventIdle_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventIdle_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "idle", (PyObject *)&PyGeventIdle_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_idle = &PyGeventIdle_Type;
  PyGeventPrepare_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventPrepare_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventPrepare_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "prepare", (PyObject *)&PyGeventPrepare_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_prepare = &PyGeventPrepare_Type;
  PyGeventCheck_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventCheck_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventCheck_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "check", (PyObject *)&PyGeventCheck_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_check = &PyGeventCheck_Type;
  PyGeventFork_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventFork_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventFork_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "fork", (PyObject *)&PyGeventFork_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_fork = &PyGeventFork_Type;
  PyGeventAsync_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventAsync_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventAsync_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "async", (PyObject *)&PyGeventAsync_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_async = &PyGeventAsync_Type;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  PyGeventChild_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventChild_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventChild_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "child", (PyObject *)&PyGeventChild_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_child = &PyGeventChild_Type;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  PyGeventStat_Type.tp_base = __pyx_ptype_6gevent_8corecext_watcher;
  if (PyType_Ready(&PyGeventStat_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  PyGeventStat_Type.tp_print = 0;
  if (PyObject_SetAttrString(__pyx_m, "stat", (PyObject *)&PyGeventStat_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_8corecext_stat = &PyGeventStat_Type;
  if (PyType_Ready(&__pyx_type_6gevent_8corecext___pyx_scope_struct__genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_type_6gevent_8corecext___pyx_scope_struct__genexpr.tp_print = 0;
  __pyx_ptype_6gevent_8corecext___pyx_scope_struct__genexpr = &__pyx_type_6gevent_8corecext___pyx_scope_struct__genexpr;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif

/* "gevent/corecext.pyx":9
 * # Note for PY3: not doing so will leave reference to locals() on import
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)             # <<<<<<<<<<<<<<
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__89, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__82, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__93, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__86, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__94, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__87, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":10
 * # (reproducible under Python 3.3, not under Python 3.4; see test__refcount_core.py)
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__90, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__83, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__94, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__87, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__95, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__88, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

/* "gevent/corecext.pyx":11
 * sys = __import__('sys', level=0)
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)             # <<<<<<<<<<<<<<
 * signalmodule = __import__('signal', level=0)
 *
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_level, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__91, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__84, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__95, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__88, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__96, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__89, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_traceback, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":12
 * os = __import__('os', level=0)
 * traceback = __import__('traceback', level=0)
 * signalmodule = __import__('signal', level=0)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_level, __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__92, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__85, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__96, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__89, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__97, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin___import__, __pyx_tuple__90, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_signalmodule, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

/* "gevent/corecext.pyx":15
 *
 *
 * __all__ = ['get_version',             # <<<<<<<<<<<<<<
 *            'get_header_version',
 *            'supported_backends',
 */
  __pyx_t_1 = PyList_New(7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_get_version);
  __Pyx_GIVEREF(__pyx_n_s_get_version);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_get_version);
  __Pyx_INCREF(__pyx_n_s_get_header_version);
  __Pyx_GIVEREF(__pyx_n_s_get_header_version);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_get_header_version);
  __Pyx_INCREF(__pyx_n_s_supported_backends);
  __Pyx_GIVEREF(__pyx_n_s_supported_backends);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_supported_backends);
  __Pyx_INCREF(__pyx_n_s_recommended_backends);
  __Pyx_GIVEREF(__pyx_n_s_recommended_backends);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_recommended_backends);
  __Pyx_INCREF(__pyx_n_s_embeddable_backends);
  __Pyx_GIVEREF(__pyx_n_s_embeddable_backends);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_n_s_embeddable_backends);
  __Pyx_INCREF(__pyx_n_s_time);
  __Pyx_GIVEREF(__pyx_n_s_time);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_n_s_time);
  __Pyx_INCREF(__pyx_n_s_loop);
  __Pyx_GIVEREF(__pyx_n_s_loop);
  PyList_SET_ITEM(__pyx_t_1, 6, __pyx_n_s_loop);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

/* "gevent/corecext.pyx":25
 * cdef tuple integer_types
 *
 * if sys.version_info[0] >= 3:             # <<<<<<<<<<<<<<
 *     integer_types = int,
 * else:
 */
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_version_info); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":26
 *
 * if sys.version_info[0] >= 3:
 *     integer_types = int,             # <<<<<<<<<<<<<<
 * else:
 *     integer_types = (int, long)
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type)));
    __Pyx_XGOTREF(__pyx_v_6gevent_8corecext_integer_types);
    __Pyx_DECREF_SET(__pyx_v_6gevent_8corecext_integer_types, ((PyObject*)__pyx_t_2));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;

/* "gevent/corecext.pyx":25
 * cdef tuple integer_types
 *
 * if sys.version_info[0] >= 3:             # <<<<<<<<<<<<<<
 *     integer_types = int,
 * else:
 */
    goto __pyx_L2;
  }

/* "gevent/corecext.pyx":28
 *     integer_types = int,
 * else:
 *     integer_types = (int, long)             # <<<<<<<<<<<<<<
 *
 *
 */
  /*else*/ {
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)(&PyInt_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyInt_Type)));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)(&PyInt_Type)));
    __Pyx_INCREF(((PyObject *)(&PyLong_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyLong_Type)));
    PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)(&PyLong_Type)));
    __Pyx_XGOTREF(__pyx_v_6gevent_8corecext_integer_types);
    __Pyx_DECREF_SET(__pyx_v_6gevent_8corecext_integer_types, ((PyObject*)__pyx_t_2));
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
  }
  __pyx_L2:;

/* "gevent/corecext.pyx":54
 *
 *
 * UNDEF = libev.EV_UNDEF             # <<<<<<<<<<<<<<
 * NONE = libev.EV_NONE
 * READ = libev.EV_READ
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_UNDEF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_UNDEF, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":55
 *
 * UNDEF = libev.EV_UNDEF
 * NONE = libev.EV_NONE             # <<<<<<<<<<<<<<
 * READ = libev.EV_READ
 * WRITE = libev.EV_WRITE
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_NONE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NONE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":56
 * UNDEF = libev.EV_UNDEF
 * NONE = libev.EV_NONE
 * READ = libev.EV_READ             # <<<<<<<<<<<<<<
 * WRITE = libev.EV_WRITE
 * TIMER = libev.EV_TIMER
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_READ, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":57
 * NONE = libev.EV_NONE
 * READ = libev.EV_READ
 * WRITE = libev.EV_WRITE             # <<<<<<<<<<<<<<
 * TIMER = libev.EV_TIMER
 * PERIODIC = libev.EV_PERIODIC
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_WRITE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":58
 * READ = libev.EV_READ
 * WRITE = libev.EV_WRITE
 * TIMER = libev.EV_TIMER             # <<<<<<<<<<<<<<
 * PERIODIC = libev.EV_PERIODIC
 * SIGNAL = libev.EV_SIGNAL
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_TIMER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TIMER, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":59
 * WRITE = libev.EV_WRITE
 * TIMER = libev.EV_TIMER
 * PERIODIC = libev.EV_PERIODIC             # <<<<<<<<<<<<<<
 * SIGNAL = libev.EV_SIGNAL
 * CHILD = libev.EV_CHILD
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PERIODIC, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":60
 * TIMER = libev.EV_TIMER
 * PERIODIC = libev.EV_PERIODIC
 * SIGNAL = libev.EV_SIGNAL             # <<<<<<<<<<<<<<
 * CHILD = libev.EV_CHILD
 * STAT = libev.EV_STAT
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNAL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":61
 * PERIODIC = libev.EV_PERIODIC
 * SIGNAL = libev.EV_SIGNAL
 * CHILD = libev.EV_CHILD             # <<<<<<<<<<<<<<
 * STAT = libev.EV_STAT
 * IDLE = libev.EV_IDLE
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHILD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":62
 * SIGNAL = libev.EV_SIGNAL
 * CHILD = libev.EV_CHILD
 * STAT = libev.EV_STAT             # <<<<<<<<<<<<<<
 * IDLE = libev.EV_IDLE
 * PREPARE = libev.EV_PREPARE
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_STAT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":63
 * CHILD = libev.EV_CHILD
 * STAT = libev.EV_STAT
 * IDLE = libev.EV_IDLE             # <<<<<<<<<<<<<<
 * PREPARE = libev.EV_PREPARE
 * CHECK = libev.EV_CHECK
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_IDLE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":64
 * STAT = libev.EV_STAT
 * IDLE = libev.EV_IDLE
 * PREPARE = libev.EV_PREPARE             # <<<<<<<<<<<<<<
 * CHECK = libev.EV_CHECK
 * EMBED = libev.EV_EMBED
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_PREPARE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":65
 * IDLE = libev.EV_IDLE
 * PREPARE = libev.EV_PREPARE
 * CHECK = libev.EV_CHECK             # <<<<<<<<<<<<<<
 * EMBED = libev.EV_EMBED
 * FORK = libev.EV_FORK
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CHECK, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":66
 * PREPARE = libev.EV_PREPARE
 * CHECK = libev.EV_CHECK
 * EMBED = libev.EV_EMBED             # <<<<<<<<<<<<<<
 * FORK = libev.EV_FORK
 * CLEANUP = libev.EV_CLEANUP
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EMBED, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":67
 * CHECK = libev.EV_CHECK
 * EMBED = libev.EV_EMBED
 * FORK = libev.EV_FORK             # <<<<<<<<<<<<<<
 * CLEANUP = libev.EV_CLEANUP
 * ASYNC = libev.EV_ASYNC
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORK, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":68
 * EMBED = libev.EV_EMBED
 * FORK = libev.EV_FORK
 * CLEANUP = libev.EV_CLEANUP             # <<<<<<<<<<<<<<
 * ASYNC = libev.EV_ASYNC
 * CUSTOM = libev.EV_CUSTOM
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CLEANUP, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":69
 * FORK = libev.EV_FORK
 * CLEANUP = libev.EV_CLEANUP
 * ASYNC = libev.EV_ASYNC             # <<<<<<<<<<<<<<
 * CUSTOM = libev.EV_CUSTOM
 * ERROR = libev.EV_ERROR
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ASYNC, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":70
 * CLEANUP = libev.EV_CLEANUP
 * ASYNC = libev.EV_ASYNC
 * CUSTOM = libev.EV_CUSTOM             # <<<<<<<<<<<<<<
 * ERROR = libev.EV_ERROR
 *
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_CUSTOM, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":71
 * ASYNC = libev.EV_ASYNC
 * CUSTOM = libev.EV_CUSTOM
 * ERROR = libev.EV_ERROR             # <<<<<<<<<<<<<<
 *
 * READWRITE = libev.EV_READ | libev.EV_WRITE
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ERROR, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":73
 * ERROR = libev.EV_ERROR
 *
 * READWRITE = libev.EV_READ | libev.EV_WRITE             # <<<<<<<<<<<<<<
 *
 * MINPRI = libev.EV_MINPRI
 */
  __pyx_t_2 = __Pyx_PyInt_From_int((EV_READ | EV_WRITE)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_READWRITE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":75
 * READWRITE = libev.EV_READ | libev.EV_WRITE
 *
 * MINPRI = libev.EV_MINPRI             # <<<<<<<<<<<<<<
 * MAXPRI = libev.EV_MAXPRI
 *
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_MINPRI); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MINPRI, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":76
 *
 * MINPRI = libev.EV_MINPRI
 * MAXPRI = libev.EV_MAXPRI             # <<<<<<<<<<<<<<
 *
 * BACKEND_PORT = libev.EVBACKEND_PORT
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EV_MAXPRI); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_MAXPRI, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":78
 * MAXPRI = libev.EV_MAXPRI
 *
 * BACKEND_PORT = libev.EVBACKEND_PORT             # <<<<<<<<<<<<<<
 * BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE
 * BACKEND_EPOLL = libev.EVBACKEND_EPOLL
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_PORT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":79
 *
 * BACKEND_PORT = libev.EVBACKEND_PORT
 * BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE             # <<<<<<<<<<<<<<
 * BACKEND_EPOLL = libev.EVBACKEND_EPOLL
 * BACKEND_POLL = libev.EVBACKEND_POLL
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_KQUEUE, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":80
 * BACKEND_PORT = libev.EVBACKEND_PORT
 * BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE
 * BACKEND_EPOLL = libev.EVBACKEND_EPOLL             # <<<<<<<<<<<<<<
 * BACKEND_POLL = libev.EVBACKEND_POLL
 * BACKEND_SELECT = libev.EVBACKEND_SELECT
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_EPOLL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":81
 * BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE
 * BACKEND_EPOLL = libev.EVBACKEND_EPOLL
 * BACKEND_POLL = libev.EVBACKEND_POLL             # <<<<<<<<<<<<<<
 * BACKEND_SELECT = libev.EVBACKEND_SELECT
 * FORKCHECK = libev.EVFLAG_FORKCHECK
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_POLL, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":82
 * BACKEND_EPOLL = libev.EVBACKEND_EPOLL
 * BACKEND_POLL = libev.EVBACKEND_POLL
 * BACKEND_SELECT = libev.EVBACKEND_SELECT             # <<<<<<<<<<<<<<
 * FORKCHECK = libev.EVFLAG_FORKCHECK
 * NOINOTIFY = libev.EVFLAG_NOINOTIFY
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_BACKEND_SELECT, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":83
 * BACKEND_POLL = libev.EVBACKEND_POLL
 * BACKEND_SELECT = libev.EVBACKEND_SELECT
 * FORKCHECK = libev.EVFLAG_FORKCHECK             # <<<<<<<<<<<<<<
 * NOINOTIFY = libev.EVFLAG_NOINOTIFY
 * SIGNALFD = libev.EVFLAG_SIGNALFD
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_FORKCHECK, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":84
 * BACKEND_SELECT = libev.EVBACKEND_SELECT
 * FORKCHECK = libev.EVFLAG_FORKCHECK
 * NOINOTIFY = libev.EVFLAG_NOINOTIFY             # <<<<<<<<<<<<<<
 * SIGNALFD = libev.EVFLAG_SIGNALFD
 * NOSIGMASK = libev.EVFLAG_NOSIGMASK
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOINOTIFY, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":85
 * FORKCHECK = libev.EVFLAG_FORKCHECK
 * NOINOTIFY = libev.EVFLAG_NOINOTIFY
 * SIGNALFD = libev.EVFLAG_SIGNALFD             # <<<<<<<<<<<<<<
 * NOSIGMASK = libev.EVFLAG_NOSIGMASK
 *
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SIGNALFD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":86
 * NOINOTIFY = libev.EVFLAG_NOINOTIFY
 * SIGNALFD = libev.EVFLAG_SIGNALFD
 * NOSIGMASK = libev.EVFLAG_NOSIGMASK             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_NOSIGMASK, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":96
 *
 *
 * cdef public object GEVENT_CORE_EVENTS = _EVENTSType()             # <<<<<<<<<<<<<<
 * EVENTS = GEVENT_CORE_EVENTS
 *
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_6gevent_8corecext__EVENTSType), __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_XGOTREF(GEVENT_CORE_EVENTS);
  __Pyx_DECREF_SET(GEVENT_CORE_EVENTS, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":97
 *
 * cdef public object GEVENT_CORE_EVENTS = _EVENTSType()
 * EVENTS = GEVENT_CORE_EVENTS             # <<<<<<<<<<<<<<
 *
 *
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EVENTS, GEVENT_CORE_EVENTS) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":100
 *
 *
 * def get_version():             # <<<<<<<<<<<<<<
 *     return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor())
 *
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_8corecext_1get_version, NULL, __pyx_n_s_gevent_corecext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":104
 *
 *
 * def get_header_version():             # <<<<<<<<<<<<<<
 *     return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR)
 *
 */
  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_8corecext_3get_header_version, NULL, __pyx_n_s_gevent_corecext); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_header_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":109
 *
 * # This list backends in the order they are actually tried by libev
 * _flags = [(libev.EVBACKEND_PORT, 'port'),             # <<<<<<<<<<<<<<
 *           (libev.EVBACKEND_KQUEUE, 'kqueue'),
 *           (libev.EVBACKEND_EPOLL, 'epoll'),
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_PORT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_port);
  __Pyx_GIVEREF(__pyx_n_s_port);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_port);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":110
 * # This list backends in the order they are actually tried by libev
 * _flags = [(libev.EVBACKEND_PORT, 'port'),
 *           (libev.EVBACKEND_KQUEUE, 'kqueue'),             # <<<<<<<<<<<<<<
 *           (libev.EVBACKEND_EPOLL, 'epoll'),
 *           (libev.EVBACKEND_POLL, 'poll'),
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_KQUEUE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_kqueue);
  __Pyx_GIVEREF(__pyx_n_s_kqueue);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_kqueue);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":111
 * _flags = [(libev.EVBACKEND_PORT, 'port'),
 *           (libev.EVBACKEND_KQUEUE, 'kqueue'),
 *           (libev.EVBACKEND_EPOLL, 'epoll'),             # <<<<<<<<<<<<<<
 *           (libev.EVBACKEND_POLL, 'poll'),
 *           (libev.EVBACKEND_SELECT, 'select'),
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_epoll);
  __Pyx_GIVEREF(__pyx_n_s_epoll);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_epoll);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":112
 *           (libev.EVBACKEND_KQUEUE, 'kqueue'),
 *           (libev.EVBACKEND_EPOLL, 'epoll'),
 *           (libev.EVBACKEND_POLL, 'poll'),             # <<<<<<<<<<<<<<
 *           (libev.EVBACKEND_SELECT, 'select'),
 *           (libev.EVFLAG_NOENV, 'noenv'),
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_poll);
  __Pyx_GIVEREF(__pyx_n_s_poll);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_poll);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":113
 *           (libev.EVBACKEND_EPOLL, 'epoll'),
 *           (libev.EVBACKEND_POLL, 'poll'),
 *           (libev.EVBACKEND_SELECT, 'select'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_NOENV, 'noenv'),
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVBACKEND_SELECT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_select);
  __Pyx_GIVEREF(__pyx_n_s_select);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_select);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":114
 *           (libev.EVBACKEND_POLL, 'poll'),
 *           (libev.EVBACKEND_SELECT, 'select'),
 *           (libev.EVFLAG_NOENV, 'noenv'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOENV); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_noenv);
  __Pyx_GIVEREF(__pyx_n_s_noenv);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_noenv);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":115
 *           (libev.EVBACKEND_SELECT, 'select'),
 *           (libev.EVFLAG_NOENV, 'noenv'),
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
 *           (libev.EVFLAG_SIGNALFD, 'signalfd'),
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_forkcheck);
  __Pyx_GIVEREF(__pyx_n_s_forkcheck);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_forkcheck);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":116
 *           (libev.EVFLAG_NOENV, 'noenv'),
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_SIGNALFD, 'signalfd'),
 *           (libev.EVFLAG_NOSIGMASK, 'nosigmask')]
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_noinotify);
  __Pyx_GIVEREF(__pyx_n_s_noinotify);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_noinotify);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":117
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
 *           (libev.EVFLAG_SIGNALFD, 'signalfd'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_NOSIGMASK, 'nosigmask')]
 *
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_signalfd);
  __Pyx_GIVEREF(__pyx_n_s_signalfd);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_signalfd);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":118
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
 *           (libev.EVFLAG_SIGNALFD, 'signalfd'),
 *           (libev.EVFLAG_NOSIGMASK, 'nosigmask')]             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_nosigmask);
  __Pyx_GIVEREF(__pyx_n_s_nosigmask);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_n_s_nosigmask);
  __pyx_t_2 = 0;

/* "gevent/corecext.pyx":109
 *
 * # This list backends in the order they are actually tried by libev
 * _flags = [(libev.EVBACKEND_PORT, 'port'),             # <<<<<<<<<<<<<<
 *           (libev.EVBACKEND_KQUEUE, 'kqueue'),
 *           (libev.EVBACKEND_EPOLL, 'epoll'),
 */
  __pyx_t_2 = PyList_New(10); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_7);
  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_8);
  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_9);
  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_10);
  PyList_SET_ITEM(__pyx_t_2, 7, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_11);
  PyList_SET_ITEM(__pyx_t_2, 8, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_12);
  PyList_SET_ITEM(__pyx_t_2, 9, __pyx_t_12);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_t_12 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/corecext.pyx":121
 *
 *
 * _flags_str2int = dict((string, flag) for (flag, string) in _flags)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = __pyx_pf_6gevent_8corecext_22genexpr(NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_12 = __Pyx_Generator_Next(__pyx_t_2); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_flags_str2int, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":124
 *
 *
 * _events = [(libev.EV_READ,     'READ'),             # <<<<<<<<<<<<<<
 *            (libev.EV_WRITE,    'WRITE'),
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_READ); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_READ);
  __Pyx_GIVEREF(__pyx_n_s_READ);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_READ);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":125
 *
 * _events = [(libev.EV_READ,     'READ'),
 *            (libev.EV_WRITE,    'WRITE'),             # <<<<<<<<<<<<<<
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 *            (libev.EV_PERIODIC, 'PERIODIC'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_WRITE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_WRITE);
  __Pyx_GIVEREF(__pyx_n_s_WRITE);
  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_n_s_WRITE);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":126
 * _events = [(libev.EV_READ,     'READ'),
 *            (libev.EV_WRITE,    'WRITE'),
 *            (libev.EV__IOFDSET, '_IOFDSET'),             # <<<<<<<<<<<<<<
 *            (libev.EV_PERIODIC, 'PERIODIC'),
 *            (libev.EV_SIGNAL,   'SIGNAL'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV__IOFDSET); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_IOFDSET);
  __Pyx_GIVEREF(__pyx_n_s_IOFDSET);
  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_n_s_IOFDSET);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":127
 *            (libev.EV_WRITE,    'WRITE'),
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 *            (libev.EV_PERIODIC, 'PERIODIC'),             # <<<<<<<<<<<<<<
 *            (libev.EV_SIGNAL,   'SIGNAL'),
 *            (libev.EV_CHILD,    'CHILD'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_PERIODIC); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_PERIODIC);
  __Pyx_GIVEREF(__pyx_n_s_PERIODIC);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_n_s_PERIODIC);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":128
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 *            (libev.EV_PERIODIC, 'PERIODIC'),
 *            (libev.EV_SIGNAL,   'SIGNAL'),             # <<<<<<<<<<<<<<
 *            (libev.EV_CHILD,    'CHILD'),
 *            (libev.EV_STAT,     'STAT'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_SIGNAL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_SIGNAL);
  __Pyx_GIVEREF(__pyx_n_s_SIGNAL);
  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_n_s_SIGNAL);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":129
 *            (libev.EV_PERIODIC, 'PERIODIC'),
 *            (libev.EV_SIGNAL,   'SIGNAL'),
 *            (libev.EV_CHILD,    'CHILD'),             # <<<<<<<<<<<<<<
 *            (libev.EV_STAT,     'STAT'),
 *            (libev.EV_IDLE,     'IDLE'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHILD); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_CHILD);
  __Pyx_GIVEREF(__pyx_n_s_CHILD);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_CHILD);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":130
 *            (libev.EV_SIGNAL,   'SIGNAL'),
 *            (libev.EV_CHILD,    'CHILD'),
 *            (libev.EV_STAT,     'STAT'),             # <<<<<<<<<<<<<<
 *            (libev.EV_IDLE,     'IDLE'),
 *            (libev.EV_PREPARE,  'PREPARE'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_STAT); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_STAT);
  __Pyx_GIVEREF(__pyx_n_s_STAT);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_n_s_STAT);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":131
 *            (libev.EV_CHILD,    'CHILD'),
 *            (libev.EV_STAT,     'STAT'),
 *            (libev.EV_IDLE,     'IDLE'),             # <<<<<<<<<<<<<<
 *            (libev.EV_PREPARE,  'PREPARE'),
 *            (libev.EV_CHECK,    'CHECK'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_IDLE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_IDLE);
  __Pyx_GIVEREF(__pyx_n_s_IDLE);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_IDLE);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":132
 *            (libev.EV_STAT,     'STAT'),
 *            (libev.EV_IDLE,     'IDLE'),
 *            (libev.EV_PREPARE,  'PREPARE'),             # <<<<<<<<<<<<<<
 *            (libev.EV_CHECK,    'CHECK'),
 *            (libev.EV_EMBED,    'EMBED'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_PREPARE); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_PREPARE);
  __Pyx_GIVEREF(__pyx_n_s_PREPARE);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_n_s_PREPARE);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":133
 *            (libev.EV_IDLE,     'IDLE'),
 *            (libev.EV_PREPARE,  'PREPARE'),
 *            (libev.EV_CHECK,    'CHECK'),             # <<<<<<<<<<<<<<
 *            (libev.EV_EMBED,    'EMBED'),
 *            (libev.EV_FORK,     'FORK'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CHECK); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_CHECK);
  __Pyx_GIVEREF(__pyx_n_s_CHECK);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_CHECK);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":134
 *            (libev.EV_PREPARE,  'PREPARE'),
 *            (libev.EV_CHECK,    'CHECK'),
 *            (libev.EV_EMBED,    'EMBED'),             # <<<<<<<<<<<<<<
 *            (libev.EV_FORK,     'FORK'),
 *            (libev.EV_CLEANUP,  'CLEANUP'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_EMBED); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_EMBED);
  __Pyx_GIVEREF(__pyx_n_s_EMBED);
  PyTuple_SET_ITEM(__pyx_t_13, 1, __pyx_n_s_EMBED);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":135
 *            (libev.EV_CHECK,    'CHECK'),
 *            (libev.EV_EMBED,    'EMBED'),
 *            (libev.EV_FORK,     'FORK'),             # <<<<<<<<<<<<<<
 *            (libev.EV_CLEANUP,  'CLEANUP'),
 *            (libev.EV_ASYNC,    'ASYNC'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_FORK); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_FORK);
  __Pyx_GIVEREF(__pyx_n_s_FORK);
  PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_n_s_FORK);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":136
 *            (libev.EV_EMBED,    'EMBED'),
 *            (libev.EV_FORK,     'FORK'),
 *            (libev.EV_CLEANUP,  'CLEANUP'),             # <<<<<<<<<<<<<<
 *            (libev.EV_ASYNC,    'ASYNC'),
 *            (libev.EV_CUSTOM,   'CUSTOM'),
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CLEANUP); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_CLEANUP);
  __Pyx_GIVEREF(__pyx_n_s_CLEANUP);
  PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_n_s_CLEANUP);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":137
 *            (libev.EV_FORK,     'FORK'),
 *            (libev.EV_CLEANUP,  'CLEANUP'),
 *            (libev.EV_ASYNC,    'ASYNC'),             # <<<<<<<<<<<<<<
 *            (libev.EV_CUSTOM,   'CUSTOM'),
 *            (libev.EV_ERROR,    'ERROR')]
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_ASYNC); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_ASYNC);
  __Pyx_GIVEREF(__pyx_n_s_ASYNC);
  PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_n_s_ASYNC);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":138
 *            (libev.EV_CLEANUP,  'CLEANUP'),
 *            (libev.EV_ASYNC,    'ASYNC'),
 *            (libev.EV_CUSTOM,   'CUSTOM'),             # <<<<<<<<<<<<<<
 *            (libev.EV_ERROR,    'ERROR')]
 *
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_CUSTOM); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_CUSTOM);
  __Pyx_GIVEREF(__pyx_n_s_CUSTOM);
  PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_n_s_CUSTOM);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":139
 *            (libev.EV_ASYNC,    'ASYNC'),
 *            (libev.EV_CUSTOM,   'CUSTOM'),
 *            (libev.EV_ERROR,    'ERROR')]             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_ERROR); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_GIVEREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_12);
  __Pyx_INCREF(__pyx_n_s_ERROR);
  __Pyx_GIVEREF(__pyx_n_s_ERROR);
  PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_n_s_ERROR);
  __pyx_t_12 = 0;

/* "gevent/corecext.pyx":124
 *
 *
 * _events = [(libev.EV_READ,     'READ'),             # <<<<<<<<<<<<<<
 *            (libev.EV_WRITE,    'WRITE'),
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 */
  __pyx_t_12 = PyList_New(16); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_11);
  PyList_SET_ITEM(__pyx_t_12, 1, __pyx_t_11);
  __Pyx_GIVEREF(__pyx_t_10);
  PyList_SET_ITEM(__pyx_t_12, 2, __pyx_t_10);
  __Pyx_GIVEREF(__pyx_t_9);
  PyList_SET_ITEM(__pyx_t_12, 3, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_8);
  PyList_SET_ITEM(__pyx_t_12, 4, __pyx_t_8);
  __Pyx_GIVEREF(__pyx_t_7);
  PyList_SET_ITEM(__pyx_t_12, 5, __pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_12, 6, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_12, 7, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_12, 8, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_12, 9, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_13);
  PyList_SET_ITEM(__pyx_t_12, 10, __pyx_t_13);
  __Pyx_GIVEREF(__pyx_t_14);
  PyList_SET_ITEM(__pyx_t_12, 11, __pyx_t_14);
  __Pyx_GIVEREF(__pyx_t_15);
  PyList_SET_ITEM(__pyx_t_12, 12, __pyx_t_15);
  __Pyx_GIVEREF(__pyx_t_16);
  PyList_SET_ITEM(__pyx_t_12, 13, __pyx_t_16);
  __Pyx_GIVEREF(__pyx_t_17);
  PyList_SET_ITEM(__pyx_t_12, 14, __pyx_t_17);
  __Pyx_GIVEREF(__pyx_t_18);
  PyList_SET_ITEM(__pyx_t_12, 15, __pyx_t_18);
  __pyx_t_2 = 0;
  __pyx_t_11 = 0;
  __pyx_t_10 = 0;
  __pyx_t_9 = 0;
  __pyx_t_8 = 0;
  __pyx_t_7 = 0;
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  __pyx_t_18 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_events, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":155
 *
 *
 * if sys.version_info[0] >= 3:             # <<<<<<<<<<<<<<
 *     basestring = (bytes, str)
 * else:
 */
  __pyx_t_12 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_t_18 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_version_info); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_18);
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_18, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  __pyx_t_18 = PyObject_RichCompare(__pyx_t_12, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_18); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_18); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
  if (__pyx_t_3) {

/* "gevent/corecext.pyx":156
 *
 * if sys.version_info[0] >= 3:
 *     basestring = (bytes, str)             # <<<<<<<<<<<<<<
 * else:
 *     basestring = __builtins__.basestring
 */
    __pyx_t_18 = PyTuple_New(2); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_18);
    __Pyx_INCREF(((PyObject *)(&PyBytes_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyBytes_Type)));
    PyTuple_SET_ITEM(__pyx_t_18, 0, ((PyObject *)(&PyBytes_Type)));
    __Pyx_INCREF(((PyObject *)(&PyString_Type)));
    __Pyx_GIVEREF(((PyObject *)(&PyString_Type)));
    PyTuple_SET_ITEM(__pyx_t_18, 1, ((PyObject *)(&PyString_Type)));
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_18) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;

/* "gevent/corecext.pyx":155
 *
 *
 * if sys.version_info[0] >= 3:             # <<<<<<<<<<<<<<
 *     basestring = (bytes, str)
 * else:
 */
    goto __pyx_L3;
  }

/* "gevent/corecext.pyx":158
 *     basestring = (bytes, str)
 * else:
 *     basestring = __builtins__.basestring             # <<<<<<<<<<<<<<
 *
 *
 */
  /*else*/ {
    __pyx_t_18 = __Pyx_GetModuleGlobalName(__pyx_n_s_builtins); if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_18);
    __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_t_18, __pyx_n_s_basestring); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_basestring, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  }
  __pyx_L3:;

/* "gevent/corecext.pyx":213
 *
 *
 * def supported_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_supported_backends())
 *
 */
  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_8corecext_13supported_backends, NULL, __pyx_n_s_gevent_corecext); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_supported_backends, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":217
 *
 *
 * def recommended_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_recommended_backends())
 *
 */
  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_8corecext_15recommended_backends, NULL, __pyx_n_s_gevent_corecext); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_recommended_backends, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":221
 *
 *
 * def embeddable_backends():             # <<<<<<<<<<<<<<
 *     return _flags_to_list(libev.ev_embeddable_backends())
 *
 */
  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_8corecext_17embeddable_backends, NULL, __pyx_n_s_gevent_corecext); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_embeddable_backends, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":225
 *
 *
 * def time():             # <<<<<<<<<<<<<<
 *     return libev.ev_time()
 *
 */
  __pyx_t_12 = PyCFunction_NewEx(&__pyx_mdef_6gevent_8corecext_19time, NULL, __pyx_n_s_gevent_corecext); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":231
 *
 *
 * cdef bint _default_loop_destroyed = False             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_v_6gevent_8corecext__default_loop_destroyed = 0;

/* "gevent/corecext.pyx":399
 *         libev.ev_unref(self._ptr)
 *
 *     def break_(self, int how=libev.EVBREAK_ONE):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */
  __pyx_k__9 = EVBREAK_ONE;

/* "gevent/corecext.pyx":2062
 *
 *
 * __SYSERR_CALLBACK = None             # <<<<<<<<<<<<<<
 *
 *
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SYSERR_CALLBACK, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":2099
 *
 *
 * LIBEV_EMBED = False             # <<<<<<<<<<<<<<
 *
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2099; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
/* "gevent/corecext.pyx":2088
 *
 *
 * LIBEV_EMBED = True             # <<<<<<<<<<<<<<
 * EV_USE_FLOOR = libev.EV_USE_FLOOR
 * EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_LIBEV_EMBED, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2088; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/corecext.pyx":2089
 *
 * LIBEV_EMBED = True
 * EV_USE_FLOOR = libev.EV_USE_FLOOR             # <<<<<<<<<<<<<<
 * EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL
 * EV_USE_REALTIME = libev.EV_USE_REALTIME
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_FLOOR); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_FLOOR, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":2090
 * LIBEV_EMBED = True
 * EV_USE_FLOOR = libev.EV_USE_FLOOR
 * EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL             # <<<<<<<<<<<<<<
 * EV_USE_REALTIME = libev.EV_USE_REALTIME
 * EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_CLOCK_SYSCALL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_CLOCK_SYSCALL, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2090; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":2091
 * EV_USE_FLOOR = libev.EV_USE_FLOOR
 * EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL
 * EV_USE_REALTIME = libev.EV_USE_REALTIME             # <<<<<<<<<<<<<<
 * EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC
 * EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_REALTIME); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_REALTIME, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":2092
 * EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL
 * EV_USE_REALTIME = libev.EV_USE_REALTIME
 * EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC             # <<<<<<<<<<<<<<
 * EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP
 * EV_USE_INOTIFY = libev.EV_USE_INOTIFY
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_MONOTONIC); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_MONOTONIC, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2092; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":2093
 * EV_USE_REALTIME = libev.EV_USE_REALTIME
 * EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC
 * EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP             # <<<<<<<<<<<<<<
 * EV_USE_INOTIFY = libev.EV_USE_INOTIFY
 * EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_NANOSLEEP); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_NANOSLEEP, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":2094
 * EV_USE_MONOTONIC = libev.EV_USE_MONOTONIC
 * EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP
 * EV_USE_INOTIFY = libev.EV_USE_INOTIFY             # <<<<<<<<<<<<<<
 * EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD
 * EV_USE_EVENTFD = libev.EV_USE_EVENTFD
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_INOTIFY); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_INOTIFY, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":2095
 * EV_USE_NANOSLEEP = libev.EV_USE_NANOSLEEP
 * EV_USE_INOTIFY = libev.EV_USE_INOTIFY
 * EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD             # <<<<<<<<<<<<<<
 * EV_USE_EVENTFD = libev.EV_USE_EVENTFD
 * EV_USE_4HEAP = libev.EV_USE_4HEAP
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_SIGNALFD); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_SIGNALFD, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":2096
 * EV_USE_INOTIFY = libev.EV_USE_INOTIFY
 * EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD
 * EV_USE_EVENTFD = libev.EV_USE_EVENTFD             # <<<<<<<<<<<<<<
 * EV_USE_4HEAP = libev.EV_USE_4HEAP
 *
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_EVENTFD); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_EVENTFD, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2096; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

/* "gevent/corecext.pyx":2097
 * EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD
 * EV_USE_EVENTFD = libev.EV_USE_EVENTFD
 * EV_USE_4HEAP = libev.EV_USE_4HEAP             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_12 = __Pyx_PyInt_From_int(EV_USE_4HEAP); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_EV_USE_4HEAP, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/corecext.pyx":1
 * # Generated by cythonpp.py on 2016-03-05 07:11:05             # <<<<<<<<<<<<<<
 * # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
 * cimport cython
 */
  __pyx_t_12 = PyDict_New(); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_12) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

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

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_17);
  __Pyx_XDECREF(__pyx_t_18);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init gevent.corecext", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init gevent.corecext");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

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

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

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

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

#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
#else
    PyErr_GetExcInfo(type, value, tb);
#endif
}
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(type, value, tb);
#endif
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

#if !CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyBytes_Join(PyObject* sep, PyObject* values) {
    return PyObject_CallMethodObjArgs(sep, __pyx_n_s_join, values, NULL);
}
#endif

static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_Restore(type, value, tb);
#endif
}
static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(type, value, tb);
#endif
}

#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
#if PY_VERSION_HEX >= 0x03030000
    if (cause) {
#else
    if (cause && cause != Py_None) {
#endif
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = PyThreadState_GET();
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

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

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

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

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

static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#endif
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
    if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_COMPILING_IN_CPYTHON
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (PyErr_ExceptionMatches(PyExc_OverflowError))
                        PyErr_Clear();
                    else
                        return NULL;
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_COMPILING_IN_CPYTHON
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
}
static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (likely(Py_TYPE(obj) == type)) return 1;
        #if PY_MAJOR_VERSION == 2
        else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(PyObject_TypeCheck(obj, type))) return 1;
    }
    __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
    return 0;
}

static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
#if CYTHON_COMPILING_IN_CPYTHON
    PyThreadState *tstate = PyThreadState_GET();
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
#else
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
#endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
}

static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
}

static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

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

static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    py_code = __pyx_find_code_object(c_line ? c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        __pyx_d,      /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = py_line;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
#endif

static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
            } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned int) -1;
        }
    } else {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyInt_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static CYTHON_INLINE vfd_socket_t __Pyx_PyInt_As_vfd_socket_t(PyObject *x) {
    const vfd_socket_t neg_one = (vfd_socket_t) -1, const_zero = (vfd_socket_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(vfd_socket_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(vfd_socket_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (vfd_socket_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (vfd_socket_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(vfd_socket_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(vfd_socket_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) >= 2 * PyLong_SHIFT) {
                            return (vfd_socket_t) (((((vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(vfd_socket_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) >= 3 * PyLong_SHIFT) {
                            return (vfd_socket_t) (((((((vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(vfd_socket_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) >= 4 * PyLong_SHIFT) {
                            return (vfd_socket_t) (((((((((vfd_socket_t)digits[3]) << PyLong_SHIFT) | (vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (vfd_socket_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(vfd_socket_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(vfd_socket_t, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(vfd_socket_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(vfd_socket_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (vfd_socket_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(vfd_socket_t, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(vfd_socket_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(vfd_socket_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) - 1 > 2 * PyLong_SHIFT) {
                            return (vfd_socket_t) (((vfd_socket_t)-1)*(((((vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(vfd_socket_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) - 1 > 2 * PyLong_SHIFT) {
                            return (vfd_socket_t) ((((((vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(vfd_socket_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) - 1 > 3 * PyLong_SHIFT) {
                            return (vfd_socket_t) (((vfd_socket_t)-1)*(((((((vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(vfd_socket_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) - 1 > 3 * PyLong_SHIFT) {
                            return (vfd_socket_t) ((((((((vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(vfd_socket_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) - 1 > 4 * PyLong_SHIFT) {
                            return (vfd_socket_t) (((vfd_socket_t)-1)*(((((((((vfd_socket_t)digits[3]) << PyLong_SHIFT) | (vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(vfd_socket_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(vfd_socket_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(vfd_socket_t) - 1 > 4 * PyLong_SHIFT) {
                            return (vfd_socket_t) ((((((((((vfd_socket_t)digits[3]) << PyLong_SHIFT) | (vfd_socket_t)digits[2]) << PyLong_SHIFT) | (vfd_socket_t)digits[1]) << PyLong_SHIFT) | (vfd_socket_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(vfd_socket_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(vfd_socket_t, long, PyLong_AsLong(x))
            } else if (sizeof(vfd_socket_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(vfd_socket_t, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            vfd_socket_t val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (vfd_socket_t) -1;
        }
    } else {
        vfd_socket_t val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (vfd_socket_t) -1;
        val = __Pyx_PyInt_As_vfd_socket_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to vfd_socket_t");
    return (vfd_socket_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to vfd_socket_t");
    return (vfd_socket_t) -1;
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, -(sdigit) digits[0])
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_Int(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_vfd_socket_t(vfd_socket_t value) {
    const vfd_socket_t neg_one = (vfd_socket_t) -1, const_zero = (vfd_socket_t) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(vfd_socket_t) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(vfd_socket_t) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
        } else if (sizeof(vfd_socket_t) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
        }
    } else {
        if (sizeof(vfd_socket_t) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(vfd_socket_t) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(vfd_socket_t),
                                     little, !is_unsigned);
    }
}

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_COMPILING_IN_CPYTHON
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            args = PyTuple_New(2);
            if (unlikely(!args)) goto bad;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            Py_DECREF(method); method = NULL;
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
bad:
    Py_XDECREF(method);
    return result;
}

#include <structmember.h>
#include <frameobject.h>
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
#if 1 || PY_VERSION_HEX < 0x030300B0
static int __Pyx_PyGen_FetchStopIterationValue(PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
#if PY_VERSION_HEX >= 0x030300A0
        if (ev && Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
#endif
        if (!ev || !PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            } else if (PyTuple_Check(ev)) {
                if (PyTuple_GET_SIZE(ev) >= 1) {
                    PyObject *value;
#if CYTHON_COMPILING_IN_CPYTHON
                    value = PySequence_ITEM(ev, 0);
#else
                    value = PyTuple_GET_ITEM(ev, 0);
                    Py_INCREF(value);
#endif
                    Py_DECREF(ev);
                    ev = value;
                } else {
                    Py_INCREF(Py_None);
                    Py_DECREF(ev);
                    ev = Py_None;
                }
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    } else if (!PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
#endif
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
static CYTHON_INLINE
int __Pyx_Coroutine_CheckRunning(__pyx_CoroutineObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value) {
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            PyErr_SetString(PyExc_TypeError,
                            "can't send non-None value to a "
                            "just-started generator");
            return NULL;
        }
    }
    if (unlikely(self->resume_label == -1)) {
        PyErr_SetNone(PyExc_StopIteration);
        return NULL;
    }
    if (value) {
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyThreadState *tstate = PyThreadState_GET();
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, value);
    self->is_running = 0;
    if (retval) {
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
#if CYTHON_COMPILING_IN_PYPY
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(PyObject *retval) {
    if (unlikely(!retval && !PyErr_Occurred())) {
        PyErr_SetNone(PyExc_StopIteration);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Coroutine_SendEx(gen, val);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = PyIter_Next(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value);
    }
    return __Pyx_Coroutine_MethodReturn(retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL);
    if (retval) {
        Py_DECREF(retval);
        PyErr_SetString(PyExc_RuntimeError,
                        "generator ignored GeneratorExit");
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (!raised_exception
        || raised_exception == PyExc_StopIteration
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *typ;
    PyObject *tb = NULL;
    PyObject *val = NULL;
    PyObject *yf = gen->yieldfrom;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    if (unlikely(__Pyx_Coroutine_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
            goto throw_here;
        }
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Throw(yf, args);
        } else
        #endif
        {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            ret = PyObject_CallObject(meth, args);
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(__Pyx_Coroutine_SendEx(gen, NULL));
}
static int __Pyx_Coroutine_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label > 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    if (gen->resume_label <= 0)
        return ;
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Coroutine_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if PY_VERSION_HEX < 0x030400a1
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
{
    Py_INCREF(self->gi_name);
    return self->gi_name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
    Py_INCREF(self->gi_qualname);
    return self->gi_qualname;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(PyTypeObject* type, __pyx_coroutine_body_t body,
                                                   PyObject *closure, PyObject *name, PyObject *qualname) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (gen == NULL)
        return NULL;
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    PyObject_GC_Track(gen);
    return gen;
}

static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (!abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_VERSION_HEX >= 0x03030000) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_VERSION_HEX >= 0x03030000) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if (0) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if PY_VERSION_HEX >= 0x030400a1
    __Pyx_Coroutine_del,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
#if PY_VERSION_HEX < 0x03030000
        char* defenc_c;
        PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
        if (!defenc) return NULL;
        defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        {
            char* end = defenc_c + PyBytes_GET_SIZE(defenc);
            char* c;
            for (c = defenc_c; c < end; c++) {
                if ((unsigned char) (*c) >= 128) {
                    PyUnicode_AsASCIIString(o);
                    return NULL;
                }
            }
        }
#endif
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else
        if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_LENGTH(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else
        return PyUnicode_AsUTF8AndSize(o, length);
#endif
#endif
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return __Pyx_NewRef(x);
  m = Py_TYPE(x)->tp_as_number;
#if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_MAJOR_VERSION < 3
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%.4s__ returned non-%.4s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#include "callbacks.c"
