#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
/* Generated by cythonpp.py on 2014-04-30 16:45:07 */
/* Generated by Cython 0.19.2 */
#define PY_SSIZE_T_CLEAN
#ifndef CYTHON_USE_PYLONG_INTERNALS
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 0
#else
#include "pyconfig.h"
#ifdef PYLONG_BITS_IN_DIGIT
#define CYTHON_USE_PYLONG_INTERNALS 1
#else
#define CYTHON_USE_PYLONG_INTERNALS 0
#endif
#endif
#endif
#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 < 0x02040000
    #error Cython requires Python 2.4+.
#else
#include <stddef.h> /* For offsetof */
#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 PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PY_FORMAT_SIZE_T ""
  #define CYTHON_FORMAT_SSIZE_T ""
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   __Pyx_PyInt_AsInt(o)
  #define PyNumber_Index(o)    ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
                                (PyErr_Format(PyExc_TypeError, \
                                              "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
                                 (PyObject*)0))
  #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
                                  !PyComplex_Check(o))
  #define PyIndex_Check __Pyx_PyIndex_Check
  #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  #define __PYX_BUILD_PY_SSIZE_T "i"
#else
  #define __PYX_BUILD_PY_SSIZE_T "n"
  #define CYTHON_FORMAT_SSIZE_T "z"
  #define __Pyx_PyIndex_Check PyIndex_Check
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  #define Py_TYPE(ob)   (((PyObject*)(ob))->ob_type)
  #define Py_SIZE(ob)   (((PyVarObject*)(ob))->ob_size)
  #define PyVarObject_HEAD_INIT(type, size) \
          PyObject_HEAD_INIT(type) size,
  #define PyType_Modified(t)
  typedef struct {
     void *buf;
     PyObject *obj;
     Py_ssize_t len;
     Py_ssize_t itemsize;
     int readonly;
     int ndim;
     char *format;
     Py_ssize_t *shape;
     Py_ssize_t *strides;
     Py_ssize_t *suboffsets;
     void *internal;
  } Py_buffer;
  #define PyBUF_SIMPLE 0
  #define PyBUF_WRITABLE 0x0001
  #define PyBUF_FORMAT 0x0004
  #define PyBUF_ND 0x0008
  #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
#endif
#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, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#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)
#endif
#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
  #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
#endif
#if PY_MAJOR_VERSION >= 3
  #define Py_TPFLAGS_CHECKTYPES 0
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#if PY_VERSION_HEX < 0x02060000
  #define Py_TPFLAGS_HAVE_VERSION_TAG 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_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_READ(k, d, i)   ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
#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_VERSION_HEX < 0x02060000
  #define PyBytesObject                PyStringObject
  #define PyBytes_Type                 PyString_Type
  #define PyBytes_Check                PyString_Check
  #define PyBytes_CheckExact           PyString_CheckExact
  #define PyBytes_FromString           PyString_FromString
  #define PyBytes_FromStringAndSize    PyString_FromStringAndSize
  #define PyBytes_FromFormat           PyString_FromFormat
  #define PyBytes_DecodeEscape         PyString_DecodeEscape
  #define PyBytes_AsString             PyString_AsString
  #define PyBytes_AsStringAndSize      PyString_AsStringAndSize
  #define PyBytes_Size                 PyString_Size
  #define PyBytes_AS_STRING            PyString_AS_STRING
  #define PyBytes_GET_SIZE             PyString_GET_SIZE
  #define PyBytes_Repr                 PyString_Repr
  #define PyBytes_Concat               PyString_Concat
  #define PyBytes_ConcatAndDel         PyString_ConcatAndDel
#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_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
                                         PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type)
#endif
#if PY_VERSION_HEX < 0x02060000
  #define PySet_Check(obj)             PyObject_TypeCheck(obj, &PySet_Type)
  #define PyFrozenSet_Check(obj)       PyObject_TypeCheck(obj, &PyFrozenSet_Type)
#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
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_VERSION_HEX < 0x03020000
  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) || (PY_VERSION_HEX >= 0x03010300)
  #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
#else
  #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
        (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
        (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
            (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),((char *)(n)))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),((char *)(n)))
#else
  #define __Pyx_GetAttrString(o,n)   PyObject_GetAttrString((o),(n))
  #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  #define __Pyx_DelAttrString(o,n)   PyObject_DelAttrString((o),(n))
#endif
#if PY_VERSION_HEX < 0x02050000
  #define __Pyx_NAMESTR(n) ((char *)(n))
  #define __Pyx_DOCSTR(n)  ((char *)(n))
#else
  #define __Pyx_NAMESTR(n) (n)
  #define __Pyx_DOCSTR(n)  (n)
#endif
#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
#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
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
/* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
   a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
   a quiet 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

#if defined(WIN32) || defined(MS_WINDOWS)
#define _USE_MATH_DEFINES
#endif
#include <math.h>
#define __PYX_HAVE__gevent__core
#define __PYX_HAVE_API__gevent__core
#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
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; /*proto*/

#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
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(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_AsUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromUString(s)  __Pyx_PyObject_FromString((char*)s)
#define __Pyx_PyBytes_FromUString(s)   __Pyx_PyBytes_FromString((char*)s)
#define __Pyx_PyStr_FromUString(s)     __Pyx_PyStr_FromString((char*)s)
#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((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 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_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), 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);
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
#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() {
    PyObject* sys = NULL;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    sys = PyImport_ImportModule("sys");
    if (sys == NULL) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    if (default_encoding == NULL) goto bad;
    if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
        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 == NULL) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (ascii_chars_b == NULL || strncmp(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 '%s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
    }
    Py_XDECREF(sys);
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return 0;
bad:
    Py_XDECREF(sys);
    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() {
    PyObject* sys = NULL;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (sys == NULL) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    if (default_encoding == NULL) goto bad;
    default_encoding_c = PyBytes_AS_STRING(default_encoding);
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(sys);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(sys);
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


#ifdef __GNUC__
  /* Test for GCC > 2.95 */
  #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
    #define likely(x)   __builtin_expect(!!(x), 1)
    #define unlikely(x) __builtin_expect(!!(x), 0)
  #else /* __GNUC__ > 2 ... */
    #define likely(x)   (x)
    #define unlikely(x) (x)
  #endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
  #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[] = {
  "core.pyx",
};

/*--- Type declarations ---*/
struct PyGeventWatcherObject;
struct PyGeventCheckObject;
struct PyGeventTimerObject;
struct PyGeventSignalObject;
struct PyGeventForkObject;
struct PyGeventStatObject;
struct PyGeventLoopObject;
struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr;
struct PyGeventIdleObject;
#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 PyGeventPrepareObject;
struct PyGeventCallbackObject;
struct PyGeventIOObject;
struct PyGeventAsyncObject;
struct __pyx_obj_6gevent_4core__EVENTSType;

/* "gevent/core.pyx":673
 *
 *
 * 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/core.pyx":1391
 *
 *
 * 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/core.pyx":883
 *
 *
 * 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/core.pyx":1028
 *
 *
 * 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/core.pyx":1510
 *
 *
 * 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/core.pyx":1900
 *
 *
 * 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;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventStat_Type;

/* "gevent/core.pyx":230
 *
 *
 * 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_4core_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/core.pyx":112
 *
 *
 * _flags_str2int = dict((string, flag) for (flag, string) in _flags)             # <<<<<<<<<<<<<<
 *
 *
 */
struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr {
  PyObject_HEAD
  PyObject *__pyx_v_flag;
  PyObject *__pyx_v_string;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};


/* "gevent/core.pyx":1153
 *
 *
 * 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;
#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/core.pyx":1755
 *
 *
 * 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/core.pyx":1272
 *
 *
 * 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/core.pyx":605
 *
 *
 * 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/core.pyx":698
 *
 *
 * 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/core.pyx":1629
 *
 *
 * 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;

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


__PYX_EXTERN_C DL_EXPORT(PyTypeObject) PyGeventLoop_Type;

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

struct __pyx_vtabstruct_6gevent_4core_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_4core_loop *__pyx_vtabptr_6gevent_4core_loop;
#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); /*proto*/
  #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 /* CYTHON_REFNANNY */
#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); /*proto*/

static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/

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); /*proto*/

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

#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

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

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

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

#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); /*proto*/

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

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

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

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

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

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

#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); /*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)
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename); /*proto*/

#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); /*proto*/

#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
    (((size) <= sizeof(Py_ssize_t)) ? \
    __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \
    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
    (((size) <= sizeof(Py_ssize_t)) ? \
    __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \
    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
    (((size) <= sizeof(Py_ssize_t)) ? \
    __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \
    __Pyx_GetItemInt_Generic(o, to_py_func(i)))
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 void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*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 CYTHON_INLINE vfd_socket_t __Pyx_PyInt_from_py_vfd_socket_t(PyObject *);

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_vfd_socket_t(vfd_socket_t);
#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 unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);

static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);

static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static PyObject* __Pyx_PyObject_CallMethodTuple(PyObject* obj, PyObject* method_name, PyObject* args) {
    PyObject *method, *result = NULL;
    if (unlikely(!args)) return NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
    result = PyObject_Call(method, args, NULL);
    Py_DECREF(method);
bad:
    Py_DECREF(args);
    return result;
}
#define __Pyx_PyObject_CallMethod3(obj, name, arg1, arg2, arg3) \
    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(3, arg1, arg2, arg3))
#define __Pyx_PyObject_CallMethod2(obj, name, arg1, arg2) \
    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(2, arg1, arg2))
#define __Pyx_PyObject_CallMethod1(obj, name, arg1) \
    __Pyx_PyObject_CallMethodTuple(obj, name, PyTuple_Pack(1, arg1))
#define __Pyx_PyObject_CallMethod0(obj, name) \
    __Pyx_PyObject_CallMethodTuple(obj, name, (Py_INCREF(__pyx_empty_tuple), __pyx_empty_tuple))

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

#define __Pyx_Generator_USED
#include <structmember.h>
#include <frameobject.h>
typedef PyObject *(*__pyx_generator_body_t)(PyObject *, PyObject *);
typedef struct {
    PyObject_HEAD
    __pyx_generator_body_t body;
    PyObject *closure;
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    int resume_label;
    char is_running;  // using T_BOOL for property below requires char value
} __pyx_GeneratorObject;
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure);
static int __pyx_Generator_init(void);
static int __Pyx_Generator_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 int __Pyx_check_binary_version(void);

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); /*proto*/

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


/* Module declarations from 'cython' */

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

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

/* Module declarations from 'gevent.core' */
static PyTypeObject *__pyx_ptype_6gevent_4core_watcher = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_check = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_timer = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_signal = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_fork = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_stat = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_loop = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core___pyx_scope_struct__genexpr = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_idle = 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_4core_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_4core_prepare = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_callback = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_io = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core_async = 0;
static PyTypeObject *__pyx_ptype_6gevent_4core__EVENTSType = 0;
__PYX_EXTERN_C DL_EXPORT(PyObject) *GEVENT_CORE_EVENTS;
static int __pyx_v_6gevent_4core__default_loop_destroyed;
static PyObject *__pyx_f_6gevent_4core__flags_to_list(unsigned int, int __pyx_skip_dispatch); /*proto*/
static unsigned int __pyx_f_6gevent_4core__flags_to_int(PyObject *, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6gevent_4core__str_hex(PyObject *); /*proto*/
static PyObject *__pyx_f_6gevent_4core__check_flags(unsigned int, int __pyx_skip_dispatch); /*proto*/
static PyObject *__pyx_f_6gevent_4core__events_to_str(int, int __pyx_skip_dispatch); /*proto*/
static void __pyx_f_6gevent_4core__syserr_cb(char *); /*proto*/
static PyObject *__pyx_f_6gevent_4core_set_syserr_cb(PyObject *, int __pyx_skip_dispatch); /*proto*/
#define __Pyx_MODULE_NAME "gevent.core"
int __pyx_module_is_main_gevent__core = 0;

/* Implementation of 'gevent.core' */
static PyObject *__pyx_builtin___import__;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_sorted;
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 PyObject *__pyx_pf_6gevent_4core_22genexpr(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_11_EVENTSType___repr__(CYTHON_UNUSED struct __pyx_obj_6gevent_4core__EVENTSType *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_get_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2get_header_version(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4_flags_to_list(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6_flags_to_int(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_flags); /* proto */
static PyObject *__pyx_pf_6gevent_4core_8_check_flags(CYTHON_UNUSED PyObject *__pyx_self, unsigned int __pyx_v_flags); /* proto */
static PyObject *__pyx_pf_6gevent_4core_10_events_to_str(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_events); /* proto */
static PyObject *__pyx_pf_6gevent_4core_12supported_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_14recommended_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_16embeddable_backends(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_18time(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_4loop_2_stop_watchers(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_4destroy(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static void __pyx_pf_6gevent_4core_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_3ptr___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_11WatcherType___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_6MAXPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_6MINPRI___get__(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_8_handle_syserr(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_message, PyObject *__pyx_v_errno); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_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_4core_4loop_14run(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_nowait, PyObject *__pyx_v_once); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_16reinit(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_18ref(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_20unref(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_22break_(struct PyGeventLoopObject *__pyx_v_self, int __pyx_v_how); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_24verify(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_26now(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_28update(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_30__repr__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_7default___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_9iteration___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_5depth___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_11backend_int___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_7backend___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_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_4core_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_4core_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_4core_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_4core_4loop_38idle(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_40prepare(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_42check(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_44fork(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_ref, PyObject *__pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_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_4core_4loop_50install_sigchld(CYTHON_UNUSED struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4loop_54run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_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_4core_4loop_50run_callback(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_func, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4loop_58_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4loop_54_format_details(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4loop_9activecnt___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_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_4core_4loop_9origflags___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4loop_13error_handler___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4loop_13error_handler_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_4loop_13error_handler_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4loop_10_callbacks___get__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_4loop_10_callbacks_4__del__(struct PyGeventLoopObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_8callback___init__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_8callback_2stop(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_8callback_7pending___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_8callback_6__repr__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_8callback_8callback___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_8callback_8callback_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_8callback_8callback_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_8callback_4args___get__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_8callback_4args_4__del__(struct PyGeventCallbackObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7watcher___repr__(struct PyGeventWatcherObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7watcher_2_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2io_3ref___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_2io_3ref_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2io_8callback___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_2io_8callback_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2io_stop(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2io_8priority___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_2io_8priority_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_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_4core_2io_6active___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_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_4core_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_4core_2io_2fd___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_2io_2fd_2__set__(struct PyGeventIOObject *__pyx_v_self, long __pyx_v_fd); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2io_6events___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_2io_6events_2__set__(struct PyGeventIOObject *__pyx_v_self, int __pyx_v_events); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2io_10events_str___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_2io_10__cinit__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static void __pyx_pf_6gevent_4core_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_4core_2io_4loop___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_2io_4loop_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_2io_4loop_4__del__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2io_4args___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_2io_4args_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_2io_4args_4__del__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_2io_6_flags___get__(struct PyGeventIOObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5timer_3ref___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5timer_3ref_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5timer_8callback___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5timer_8callback_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5timer_stop(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5timer_8priority___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5timer_8priority_2__set__(struct PyGeventTimerObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_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_4core_5timer_6active___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5timer_7pending___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_5timer_2at___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_5timer_4loop___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5timer_4loop_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_5timer_4loop_4__del__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5timer_4args___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5timer_4args_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_5timer_4args_4__del__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5timer_6_flags___get__(struct PyGeventTimerObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6signal_3ref___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_6signal_3ref_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6signal_8callback___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_6signal_8callback_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6signal_stop(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6signal_8priority___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_6signal_8priority_2__set__(struct PyGeventSignalObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_6signal_4start(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6signal_6active___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6signal_7pending___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_6signal_4loop___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_6signal_4loop_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_6signal_4loop_4__del__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6signal_4args___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_6signal_4args_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_6signal_4args_4__del__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_6signal_6_flags___get__(struct PyGeventSignalObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4idle_3ref___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4idle_3ref_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4idle_8callback___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4idle_8callback_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4idle_stop(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4idle_8priority___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4idle_8priority_2__set__(struct PyGeventIdleObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4idle_4start(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4idle_6active___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4idle_7pending___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_4idle_4loop___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4idle_4loop_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_4idle_4loop_4__del__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4idle_4args___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4idle_4args_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_4idle_4args_4__del__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4idle_6_flags___get__(struct PyGeventIdleObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7prepare_3ref___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_7prepare_3ref_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7prepare_8callback___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_7prepare_8callback_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7prepare_stop(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7prepare_8priority___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_7prepare_8priority_2__set__(struct PyGeventPrepareObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_7prepare_4start(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7prepare_6active___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7prepare_7pending___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_7prepare_4loop___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_7prepare_4loop_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_7prepare_4loop_4__del__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7prepare_4args___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_7prepare_4args_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_7prepare_4args_4__del__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_7prepare_6_flags___get__(struct PyGeventPrepareObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5check_3ref___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5check_3ref_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5check_8callback___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5check_8callback_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5check_stop(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5check_8priority___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5check_8priority_2__set__(struct PyGeventCheckObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_5check_4start(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5check_6active___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5check_7pending___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_5check_4loop___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5check_4loop_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_5check_4loop_4__del__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5check_4args___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5check_4args_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_5check_4args_4__del__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5check_6_flags___get__(struct PyGeventCheckObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4fork_3ref___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4fork_3ref_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4fork_8callback___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4fork_8callback_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4fork_stop(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4fork_8priority___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4fork_8priority_2__set__(struct PyGeventForkObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4fork_4start(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4fork_6active___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4fork_7pending___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_4fork_4loop___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4fork_4loop_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_4fork_4loop_4__del__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4fork_4args___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4fork_4args_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_4fork_4args_4__del__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4fork_6_flags___get__(struct PyGeventForkObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5async_3ref___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5async_3ref_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5async_8callback___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5async_8callback_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5async_stop(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5async_8priority___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5async_8priority_2__set__(struct PyGeventAsyncObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_5async_4start(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5async_6active___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5async_7pending___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_5async_8send(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5async_4loop___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5async_4loop_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_5async_4loop_4__del__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5async_4args___get__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5async_4args_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_5async_4args_4__del__(struct PyGeventAsyncObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_5child_3ref___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5child_3ref_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_8callback___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5child_8callback_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_stop(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_8priority___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5child_8priority_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_5child_4start(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_6active___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_7pending___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_5child_8_format(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_3pid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_4rpid___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_7rstatus___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_4loop___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5child_4loop_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_5child_4loop_4__del__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_5child_4args___get__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_5child_4args_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_5child_4args_4__del__(struct PyGeventChildObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4stat_3ref___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4stat_3ref_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_8callback___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4stat_8callback_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_stop(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_8priority___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4stat_8priority_2__set__(struct PyGeventStatObject *__pyx_v_self, int __pyx_v_priority); /* proto */
static PyObject *__pyx_pf_6gevent_4core_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_4core_4stat_4start(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback, PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_6active___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_7pending___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_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_4core_4stat_4attr___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_4prev___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_8interval___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_4loop___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4stat_4loop_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_4stat_4loop_4__del__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_4args___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static int __pyx_pf_6gevent_4core_4stat_4args_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_6gevent_4core_4stat_4args_4__del__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_6_flags___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_4stat_4path___get__(struct PyGeventStatObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_6gevent_4core_20set_syserr_cb(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_callback); /* proto */
static PyObject *__pyx_tp_new_6gevent_4core_watcher(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_check(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_signal(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_fork(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_stat(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_loop(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core___pyx_scope_struct__genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_idle(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_4core_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_4core_prepare(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_callback(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_io(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core_async(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_6gevent_4core__EVENTSType(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static char __pyx_k_1[] = "gevent.core.EVENTS";
static char __pyx_k_2[] = "libev-%d.%02d";
static char __pyx_k_3[] = ",";
static char __pyx_k_5[] = "Invalid backend or flag: %s\nPossible values: %s";
static char __pyx_k_6[] = ", ";
static char __pyx_k_7[] = "Invalid value for backend: 0x%x";
static char __pyx_k_8[] = "Unsupported backend: %s";
static char __pyx_k_9[] = "|";
static char __pyx_k_10[] = "ev_default_loop(%s) failed";
static char __pyx_k_11[] = "ev_loop_new(%s) failed";
static char __pyx_k_12[] = ": ";
static char __pyx_k_13[] = "_default_handle_error";
static char __pyx_k_16[] = "operation on destroyed loop";
static char __pyx_k_25[] = "<%s at 0x%x %s>";
#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_43[] = " default";
static char __pyx_k_44[] = " pending=%s";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
static char __pyx_k_45[] = "<...>";
static char __pyx_k_46[] = "<%s at 0x%x%s";
static char __pyx_k_47[] = " pending";
static char __pyx_k_48[] = " callback=%r";
static char __pyx_k_49[] = " args=%r";
static char __pyx_k_50[] = " stopped";
static char __pyx_k_51[] = ">";
static char __pyx_k_52[] = "";
static char __pyx_k_53[] = " active";
static char __pyx_k_55[] = "Expected callable, not %r";
static char __pyx_k_57[] = "Cannot set priority of an active watcher";
static char __pyx_k_62[] = "callback must be callable, not None";
static char __pyx_k_65[] = "fd must be non-negative: %r";
static char __pyx_k_66[] = "illegal event mask: %r";
static char __pyx_k_67[] = "'io' watcher attribute 'fd' is read-only while watcher is active";
static char __pyx_k_69[] = "'io' watcher attribute 'events' is read-only while watcher is active";
static char __pyx_k_71[] = " fd=%s events=%s";
static char __pyx_k_80[] = "repeat must be positive or zero: %r";
static char __pyx_k_90[] = "illegal signal number: %r";
static char __pyx_k_134[] = "child watchers are only available on the default loop";
static char __pyx_k_136[] = " pid=%r rstatus=%r";
static char __pyx_k_144[] = "Expected callable or None, got %r";
static char __pyx_k_146[] = "recommended_backends";
static char __pyx_k_148[] = "/tmp/gevent-make-dist/gevent/gevent/core.pyx";
static char __pyx_k_149[] = "gevent.core";
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static char __pyx_k_42[] = " default";
static char __pyx_k_43[] = " pending=%s";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
static char __pyx_k_44[] = "<...>";
static char __pyx_k_45[] = "<%s at 0x%x%s";
static char __pyx_k_46[] = " pending";
static char __pyx_k_47[] = " callback=%r";
static char __pyx_k_48[] = " args=%r";
static char __pyx_k_49[] = " stopped";
static char __pyx_k_50[] = ">";
static char __pyx_k_51[] = "";
static char __pyx_k_52[] = " active";
static char __pyx_k_54[] = "Expected callable, not %r";
static char __pyx_k_56[] = "Cannot set priority of an active watcher";
static char __pyx_k_61[] = "callback must be callable, not None";
static char __pyx_k_64[] = "illegal event mask: %r";
static char __pyx_k_65[] = "'io' watcher attribute 'fd' is read-only while watcher is active";
static char __pyx_k_67[] = "'io' watcher attribute 'events' is read-only while watcher is active";
static char __pyx_k_69[] = " fd=%s events=%s";
static char __pyx_k_78[] = "repeat must be positive or zero: %r";
static char __pyx_k_88[] = "illegal signal number: %r";
static char __pyx_k_132[] = "Expected callable or None, got %r";
static char __pyx_k_134[] = "recommended_backends";
static char __pyx_k_136[] = "/tmp/gevent-make-dist/gevent/gevent/core.pyx";
static char __pyx_k_137[] = "gevent.core";
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
static char __pyx_k_45[] = "";
static char __pyx_k_46[] = " ref=";
static char __pyx_k_47[] = " fileno=";
static char __pyx_k_48[] = " sigfd=";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static char __pyx_k_44[] = "";
static char __pyx_k_45[] = " ref=";
static char __pyx_k_46[] = " fileno=";
static char __pyx_k_47[] = " sigfd=";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static char __pyx_k_53[] = "<...>";
static char __pyx_k_54[] = "<%s at 0x%x%s";
static char __pyx_k_55[] = " pending";
static char __pyx_k_56[] = " callback=%r";
static char __pyx_k_57[] = " args=%r";
static char __pyx_k_58[] = " stopped";
static char __pyx_k_59[] = ">";
static char __pyx_k_60[] = " active";
static char __pyx_k_62[] = "Expected callable, not %r";
static char __pyx_k_64[] = "Cannot set priority of an active watcher";
static char __pyx_k_69[] = "callback must be callable, not None";
#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))
static char __pyx_k_72[] = "fd must be non-negative: %r";
static char __pyx_k_73[] = "illegal event mask: %r";
static char __pyx_k_74[] = "'io' watcher attribute 'fd' is read-only while watcher is active";
static char __pyx_k_76[] = "'io' watcher attribute 'events' is read-only while watcher is active";
static char __pyx_k_78[] = " fd=%s events=%s";
static char __pyx_k_87[] = "repeat must be positive or zero: %r";
static char __pyx_k_97[] = "illegal signal number: %r";
static char __pyx_k_141[] = "child watchers are only available on the default loop";
static char __pyx_k_143[] = " pid=%r rstatus=%r";
static char __pyx_k_151[] = "Expected callable or None, got %r";
static char __pyx_k_153[] = "recommended_backends";
static char __pyx_k_155[] = "/tmp/gevent-make-dist/gevent/gevent/core.pyx";
static char __pyx_k_156[] = "gevent.core";
static char __pyx_k_162[] = "EV_USE_CLOCK_SYSCALL";
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static char __pyx_k_44[] = "";
static char __pyx_k_45[] = " ref=";
static char __pyx_k_46[] = " fileno=";
static char __pyx_k_47[] = " sigfd=";
static char __pyx_k_52[] = "<...>";
static char __pyx_k_53[] = "<%s at 0x%x%s";
static char __pyx_k_54[] = " pending";
static char __pyx_k_55[] = " callback=%r";
static char __pyx_k_56[] = " args=%r";
static char __pyx_k_57[] = " stopped";
static char __pyx_k_58[] = ">";
static char __pyx_k_59[] = " active";
static char __pyx_k_61[] = "Expected callable, not %r";
static char __pyx_k_63[] = "Cannot set priority of an active watcher";
static char __pyx_k_68[] = "callback must be callable, not None";
static char __pyx_k_71[] = "illegal event mask: %r";
static char __pyx_k_72[] = "'io' watcher attribute 'fd' is read-only while watcher is active";
static char __pyx_k_74[] = "'io' watcher attribute 'events' is read-only while watcher is active";
static char __pyx_k_76[] = " fd=%s events=%s";
static char __pyx_k_85[] = "repeat must be positive or zero: %r";
static char __pyx_k_95[] = "illegal signal number: %r";
static char __pyx_k_139[] = "Expected callable or None, got %r";
static char __pyx_k_141[] = "recommended_backends";
static char __pyx_k_143[] = "/tmp/gevent-make-dist/gevent/gevent/core.pyx";
static char __pyx_k_144[] = "gevent.core";
static char __pyx_k_150[] = "EV_USE_CLOCK_SYSCALL";
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static char __pyx_k_54[] = "<...>";
static char __pyx_k_55[] = "<%s at 0x%x%s";
static char __pyx_k_56[] = " pending";
static char __pyx_k_57[] = " callback=%r";
static char __pyx_k_58[] = " args=%r";
static char __pyx_k_59[] = " stopped";
static char __pyx_k_60[] = ">";
static char __pyx_k_61[] = " active";
static char __pyx_k_63[] = "Expected callable, not %r";
static char __pyx_k_65[] = "Cannot set priority of an active watcher";
static char __pyx_k_70[] = "callback must be callable, not None";
static char __pyx_k_73[] = "fd must be non-negative: %r";
static char __pyx_k_74[] = "illegal event mask: %r";
static char __pyx_k_75[] = "'io' watcher attribute 'fd' is read-only while watcher is active";
static char __pyx_k_77[] = "'io' watcher attribute 'events' is read-only while watcher is active";
static char __pyx_k_79[] = " fd=%s events=%s";
static char __pyx_k_88[] = "repeat must be positive or zero: %r";
static char __pyx_k_98[] = "illegal signal number: %r";
static char __pyx_k_142[] = "child watchers are only available on the default loop";
static char __pyx_k_144[] = " pid=%r rstatus=%r";
static char __pyx_k_152[] = "Expected callable or None, got %r";
static char __pyx_k_154[] = "recommended_backends";
static char __pyx_k_156[] = "/tmp/gevent-make-dist/gevent/gevent/core.pyx";
static char __pyx_k_157[] = "gevent.core";
static char __pyx_k_163[] = "EV_USE_CLOCK_SYSCALL";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static char __pyx_k_72[] = "illegal event mask: %r";
static char __pyx_k_73[] = "'io' watcher attribute 'fd' is read-only while watcher is active";
static char __pyx_k_75[] = "'io' watcher attribute 'events' is read-only while watcher is active";
static char __pyx_k_77[] = " fd=%s events=%s";
static char __pyx_k_86[] = "repeat must be positive or zero: %r";
static char __pyx_k_96[] = "illegal signal number: %r";
static char __pyx_k_140[] = "Expected callable or None, got %r";
static char __pyx_k_142[] = "recommended_backends";
static char __pyx_k_144[] = "/tmp/gevent-make-dist/gevent/gevent/core.pyx";
static char __pyx_k_145[] = "gevent.core";
static char __pyx_k_151[] = "EV_USE_CLOCK_SYSCALL";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k__fd[] = "fd";
static char __pyx_k__id[] = "id";
static char __pyx_k__os[] = "os";
static char __pyx_k__tb[] = "tb";
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__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__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__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__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___flags[] = "_flags";
static char __pyx_k__active[] = "active";
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__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__sorted[] = "sorted";
static char __pyx_k__update[] = "update";
static char __pyx_k__CLEANUP[] = "CLEANUP";
static char __pyx_k__PREPARE[] = "PREPARE";
static char __pyx_k____all__[] = "__all__";
static char __pyx_k___events[] = "_events";
static char __pyx_k___format[] = "_format";
static char __pyx_k__backend[] = "backend";
static char __pyx_k__context[] = "context";
static char __pyx_k__default[] = "default";
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)) || (!EV_USE_SIGNALFD)
static char __pyx_k__KeyError[] = "KeyError";
static char __pyx_k__PERIODIC[] = "PERIODIC";
static char __pyx_k__SIGNALFD[] = "SIGNALFD";
static char __pyx_k___IOFDSET[] = "_IOFDSET";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____name__[] = "__name__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__callback[] = "callback";
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";
static char __pyx_k____class__[] = "__class__";
#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__destroyed[] = "destroyed";
static char __pyx_k__forkcheck[] = "forkcheck";
static char __pyx_k__noinotify[] = "noinotify";
static char __pyx_k__nosigmask[] = "nosigmask";
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____import__[] = "__import__";
static char __pyx_k__basestring[] = "basestring";
static char __pyx_k__events_str[] = "events_str";
static char __pyx_k__pendingcnt[] = "pendingcnt";
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__pass_events[] = "pass_events";
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____builtins__[] = "__builtins__";
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__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";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__";
static char __pyx_k___flags_str2int[] = "_flags_str2int";
static char __pyx_k___handle_syserr[] = "_handle_syserr";
static char __pyx_k___stop_watchers[] = "_stop_watchers";
#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_REALTIME[] = "EV_USE_REALTIME";
static char __pyx_k__EV_USE_SIGNALFD[] = "EV_USE_SIGNALFD";
static char __pyx_k___format_details[] = "_format_details";
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#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____SYSERR_CALLBACK[] = "__SYSERR_CALLBACK";
static char __pyx_k__get_header_version[] = "get_header_version";
static char __pyx_k__supported_backends[] = "supported_backends";
static char __pyx_k__embeddable_backends[] = "embeddable_backends";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_11;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_n_s_13;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_134;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_132;
static PyObject *__pyx_n_s_134;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_136;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_142;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_140;
static PyObject *__pyx_n_s_142;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_144;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_n_s_146;
static PyObject *__pyx_kp_s_148;
static PyObject *__pyx_n_s_149;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_n_s_137;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_141;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_139;
static PyObject *__pyx_n_s_141;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_143;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_151;
static PyObject *__pyx_n_s_153;
static PyObject *__pyx_kp_s_155;
static PyObject *__pyx_n_s_156;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_n_s_144;
static PyObject *__pyx_n_s_150;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_152;
static PyObject *__pyx_n_s_154;
static PyObject *__pyx_kp_s_156;
static PyObject *__pyx_n_s_157;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_n_s_145;
static PyObject *__pyx_n_s_151;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_16;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_n_s_162;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_n_s_163;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_s_3;
#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_42;
#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_43;
static PyObject *__pyx_kp_s_44;
static PyObject *__pyx_kp_s_45;
static PyObject *__pyx_kp_s_46;
static PyObject *__pyx_kp_s_47;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_48;
#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))
static PyObject *__pyx_kp_s_49;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_5;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_50;
static PyObject *__pyx_kp_s_51;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_52;
#endif /* (!EV_USE_SIGNALFD && 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)) || (defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_53;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_54;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_55;
#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(LIBEV_EMBED))
static PyObject *__pyx_kp_s_56;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_57;
#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))
static PyObject *__pyx_kp_s_54;
static PyObject *__pyx_kp_s_56;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_58;
static PyObject *__pyx_kp_s_59;
#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_6;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_60;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && 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_kp_s_62;
#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_kp_s_61;
#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(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_64;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!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))
static PyObject *__pyx_kp_s_63;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_65;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_66;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_67;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_69;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_63;
static PyObject *__pyx_kp_s_68;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_7;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_71;
#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)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_72;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_70;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_73;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && 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(LIBEV_EMBED))
static PyObject *__pyx_kp_s_74;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_76;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_78;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_kp_s_75;
static PyObject *__pyx_kp_s_77;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_79;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_8;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_80;
#endif /* (!EV_USE_SIGNALFD && !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_kp_s_88;
#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))
static PyObject *__pyx_kp_s_87;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_85;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_86;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_kp_s_9;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_90;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_97;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_95;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_kp_s_98;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_kp_s_96;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
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_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_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_n_s__FORK;
static PyObject *__pyx_n_s__FORKCHECK;
static PyObject *__pyx_n_s__IDLE;
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__SystemError;
static PyObject *__pyx_n_s__TIMER;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__UNDEF;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s__WRITE;
static PyObject *__pyx_n_s___IOFDSET;
static PyObject *__pyx_n_s____SYSERR_CALLBACK;
static PyObject *__pyx_n_s____all__;
static PyObject *__pyx_n_s____builtins__;
static PyObject *__pyx_n_s____class__;
static PyObject *__pyx_n_s____import__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____name__;
static PyObject *__pyx_n_s____pyx_vtable__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___events;
static PyObject *__pyx_n_s___flags;
static PyObject *__pyx_n_s___flags_str2int;
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___handle_syserr;
static PyObject *__pyx_n_s___stop_watchers;
static PyObject *__pyx_n_s__active;
#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__args;
static PyObject *__pyx_n_s__backend;
static PyObject *__pyx_n_s__basestring;
static PyObject *__pyx_n_s__callback;
static PyObject *__pyx_n_s__close;
static PyObject *__pyx_n_s__context;
static PyObject *__pyx_n_s__default;
static PyObject *__pyx_n_s__destroyed;
static PyObject *__pyx_n_s__embeddable_backends;
static PyObject *__pyx_n_s__epoll;
static PyObject *__pyx_n_s__errno;
static PyObject *__pyx_n_s__events;
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(LIBEV_EMBED))
static PyObject *__pyx_n_s__fileno;
#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__forkcheck;
static PyObject *__pyx_n_s__func;
static PyObject *__pyx_n_s__get_header_version;
static PyObject *__pyx_n_s__get_version;
static PyObject *__pyx_n_s__handle_error;
static PyObject *__pyx_n_s__hex;
static PyObject *__pyx_n_s__how;
static PyObject *__pyx_n_s__id;
static PyObject *__pyx_n_s__interval;
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_n_s__loop;
static PyObject *__pyx_n_s__lower;
static PyObject *__pyx_n_s__message;
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_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_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;
#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_n_s__ptr;
static PyObject *__pyx_n_s__ref;
static PyObject *__pyx_n_s__repeat;
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_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;
#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__sorted;
static PyObject *__pyx_n_s__split;
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__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_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 PyObject *__pyx_k_14;
static PyObject *__pyx_k_15;
static int __pyx_k_20;
static PyObject *__pyx_k_32;
static PyObject *__pyx_k_33;
static PyObject *__pyx_k_34;
static PyObject *__pyx_k_35;
static PyObject *__pyx_k_36;
static PyObject *__pyx_k_37;
static PyObject *__pyx_k_38;
static PyObject *__pyx_k_39;
static PyObject *__pyx_k_40;
#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_k_41;
#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_k_60;
static PyObject *__pyx_k_64;
static PyObject *__pyx_k_76;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_59;
static PyObject *__pyx_k_63;
static PyObject *__pyx_k_74;
static PyObject *__pyx_k_77;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_k_79;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_66;
static PyObject *__pyx_k_70;
#endif /* (!EV_USE_SIGNALFD && 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_k_81;
#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))
static PyObject *__pyx_k_68;
static PyObject *__pyx_k_72;
static PyObject *__pyx_k_84;
static PyObject *__pyx_k_87;
#endif /* (EV_USE_SIGNALFD && 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_k_89;
static PyObject *__pyx_k_97;
#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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_67;
static PyObject *__pyx_k_71;
#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))
static PyObject *__pyx_k_83;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_84;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_86;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_88;
static PyObject *__pyx_k_96;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_k_104;
static PyObject *__pyx_k_111;
static PyObject *__pyx_k_118;
static PyObject *__pyx_k_125;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_105;
static PyObject *__pyx_k_112;
static PyObject *__pyx_k_119;
static PyObject *__pyx_k_126;
#endif /* (EV_USE_SIGNALFD && 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_k_133;
#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))
static PyObject *__pyx_k_143;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_82;
static PyObject *__pyx_k_85;
#endif /* (EV_USE_SIGNALFD && 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_k_87;
static PyObject *__pyx_k_95;
#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))
static PyObject *__pyx_k_94;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_k_102;
static PyObject *__pyx_k_109;
static PyObject *__pyx_k_116;
static PyObject *__pyx_k_123;
#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_103;
static PyObject *__pyx_k_110;
static PyObject *__pyx_k_117;
static PyObject *__pyx_k_124;
#endif /* (EV_USE_SIGNALFD && 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_k_131;
#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))
static PyObject *__pyx_k_132;
static PyObject *__pyx_k_140;
static PyObject *__pyx_k_150;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_130;
static PyObject *__pyx_k_138;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_141;
static PyObject *__pyx_k_151;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_139;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_4;
static PyObject *__pyx_k_tuple_17;
static PyObject *__pyx_k_tuple_18;
static PyObject *__pyx_k_tuple_19;
static PyObject *__pyx_k_tuple_21;
static PyObject *__pyx_k_tuple_22;
static PyObject *__pyx_k_tuple_23;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_26;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_29;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_31;
#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_k_tuple_42;
#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_k_tuple_54;
static PyObject *__pyx_k_tuple_56;
#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_k_tuple_41;
#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_k_tuple_53;
static PyObject *__pyx_k_tuple_55;
static PyObject *__pyx_k_tuple_57;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_58;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_tuple_59;
#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_k_tuple_48;
#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_k_tuple_49;
static PyObject *__pyx_k_tuple_50;
static PyObject *__pyx_k_tuple_51;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_52;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && 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_k_tuple_61;
static PyObject *__pyx_k_tuple_63;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_k_tuple_60;
#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_tuple_53;
#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_k_tuple_62;
#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(_WIN32))
static PyObject *__pyx_k_tuple_64;
#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)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_65;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_66;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && 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(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_68;
static PyObject *__pyx_k_tuple_70;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_tuple_71;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_72;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_tuple_67;
static PyObject *__pyx_k_tuple_69;
#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)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_73;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_tuple_74;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_75;
#endif /* (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_k_tuple_77;
#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_k_tuple_71;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_76;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_78;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_tuple_76;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_79;
#endif /* (EV_USE_SIGNALFD && 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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_80;
#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(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_81;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && 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)
static PyObject *__pyx_k_tuple_82;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_83;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_84;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_tuple_85;
#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) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_86;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_tuple_87;
#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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_tuple_88;
#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)) || (!EV_USE_SIGNALFD && defined(_WIN32))
static PyObject *__pyx_k_tuple_89;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_90;
#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)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_91;
static PyObject *__pyx_k_tuple_92;
static PyObject *__pyx_k_tuple_93;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_94;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (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_k_tuple_95;
#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(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_96;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && 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_k_tuple_97;
#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)
static PyObject *__pyx_k_tuple_98;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_99;
static PyObject *__pyx_k_tuple_100;
static PyObject *__pyx_k_tuple_101;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_102;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_103;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_104;
#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_105;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_106;
static PyObject *__pyx_k_tuple_107;
static PyObject *__pyx_k_tuple_108;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_109;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_110;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_111;
#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_112;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_113;
static PyObject *__pyx_k_tuple_114;
static PyObject *__pyx_k_tuple_115;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_116;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_117;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_118;
#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_119;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_120;
static PyObject *__pyx_k_tuple_121;
static PyObject *__pyx_k_tuple_122;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_123;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_124;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_125;
#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_126;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_k_tuple_127;
static PyObject *__pyx_k_tuple_128;
static PyObject *__pyx_k_tuple_129;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_130;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_k_tuple_131;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_132;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !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(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_133;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_134;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_135;
#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(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_136;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_k_tuple_137;
#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_k_tuple_138;
#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_k_tuple_139;
#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(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_tuple_140;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_tuple_141;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_k_tuple_142;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_tuple_144;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_tuple_143;
#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_k_tuple_145;
#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_k_codeobj_142;
static PyObject *__pyx_k_codeobj_145;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_codeobj_143;
#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_k_codeobj_146;
#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_k_codeobj_147;
#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))
static PyObject *__pyx_k_codeobj_150;
static PyObject *__pyx_k_codeobj_151;
static PyObject *__pyx_k_codeobj_152;
static PyObject *__pyx_k_codeobj_153;
#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_k_tuple_146;
static PyObject *__pyx_k_tuple_147;
static PyObject *__pyx_k_tuple_148;
static PyObject *__pyx_k_tuple_149;
#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_k_tuple_152;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32))
static PyObject *__pyx_k_codeobj_154;
#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_tuple_133;
static PyObject *__pyx_k_codeobj_135;
static PyObject *__pyx_k_codeobj_138;
static PyObject *__pyx_k_codeobj_139;
static PyObject *__pyx_k_codeobj_140;
static PyObject *__pyx_k_codeobj_141;
static PyObject *__pyx_k_codeobj_142;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_codeobj_157;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
static PyObject *__pyx_k_tuple_150;
static PyObject *__pyx_k_tuple_153;
static PyObject *__pyx_k_codeobj_155;
#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_k_codeobj_158;
static PyObject *__pyx_k_codeobj_159;
static PyObject *__pyx_k_codeobj_160;
static PyObject *__pyx_k_codeobj_161;
#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_k_codeobj_148;
static PyObject *__pyx_k_codeobj_149;
#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_k_codeobj_162;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
static PyObject *__pyx_k_codeobj_150;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
static PyObject *__pyx_gb_6gevent_4core_24generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value); /* proto */

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

static PyObject *__pyx_pf_6gevent_4core_22genexpr(CYTHON_UNUSED PyObject *__pyx_self) {
  struct __pyx_obj_6gevent_4core___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_4core___pyx_scope_struct__genexpr *)__pyx_tp_new_6gevent_4core___pyx_scope_struct__genexpr(__pyx_ptype_6gevent_4core___pyx_scope_struct__genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __Pyx_GOTREF(__pyx_cur_scope);
  {
    __pyx_GeneratorObject *gen = __Pyx_Generator_New((__pyx_generator_body_t) __pyx_gb_6gevent_4core_24generator, (PyObject *) __pyx_cur_scope); if (unlikely(!gen)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_6gevent_4core_24generator(__pyx_GeneratorObject *__pyx_generator, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *__pyx_cur_scope = ((struct __pyx_obj_6gevent_4core___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;
    case 1: goto __pyx_L8_resume_from_yield;
    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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 112; __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 112; __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 = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __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 = 112; __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 = 112; __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 = 112; __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 = 112; __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 = 112; __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 = 112; __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;
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_string);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_cur_scope->__pyx_v_string);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_string);
    __Pyx_INCREF(__pyx_cur_scope->__pyx_v_flag);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_cur_scope->__pyx_v_flag);
    __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_flag);
    __pyx_r = ((PyObject *)__pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_3;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_4;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L8_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_3 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_4 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r);
  __pyx_generator->resume_label = -1;
  __Pyx_Generator_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return NULL;
}
PyObject *GEVENT_CORE_EVENTS = 0;

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_11_EVENTSType_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_11_EVENTSType_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_11_EVENTSType___repr__(((struct __pyx_obj_6gevent_4core__EVENTSType *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_1get_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_4core_1get_version = {__Pyx_NAMESTR("get_version"), (PyCFunction)__pyx_pw_6gevent_4core_1get_version, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6gevent_4core_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_4core_get_version(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":92
 *
 * def get_version():
 *     return 'libev-%d.%02d' % (libev.ev_version_major(), libev.ev_version_minor())             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_version_major()); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(ev_version_minor()); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __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 = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("gevent.core.get_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_3get_header_version(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_4core_3get_header_version = {__Pyx_NAMESTR("get_header_version"), (PyCFunction)__pyx_pw_6gevent_4core_3get_header_version, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6gevent_4core_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_4core_2get_header_version(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":96
 *
 * def get_header_version():
 *     return 'libev-%d.%02d' % (libev.EV_VERSION_MAJOR, libev.EV_VERSION_MINOR)             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(EV_VERSION_MAJOR); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(EV_VERSION_MINOR); 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_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("gevent.core.get_header_version", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_6gevent_4core_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
static PyObject *__pyx_f_6gevent_4core__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/core.pyx":134
 *
 * 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 = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

/* "gevent/core.pyx":135
 * 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 = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (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 = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 135; __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 = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 135; __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 = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __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 = 135; __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 = 135; __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 = 135; __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 = 135; __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 = 135; __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 = 135; __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/core.pyx":136
 *     cdef list result = []
 *     for code, value in _flags:
 *         if flags & code:             # <<<<<<<<<<<<<<
 *             result.append(value)
 *         flags &= ~code
 */
    __pyx_t_1 = PyLong_FromUnsignedLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __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 = 136; __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 = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_9) {

/* "gevent/core.pyx":137
 *     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 = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":138
 *         if flags & code:
 *             result.append(value)
 *         flags &= ~code             # <<<<<<<<<<<<<<
 *         if not flags:
 *             break
 */
    __pyx_t_6 = PyLong_FromUnsignedLong(__pyx_v_flags); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __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 = 138; __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 = 138; __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_AsUnsignedInt(__pyx_t_5); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_flags = __pyx_t_11;

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

/* "gevent/core.pyx":140
 *         flags &= ~code
 *         if not flags:
 *             break             # <<<<<<<<<<<<<<
 *     if flags:
 *         result.append(flags)
 */
      goto __pyx_L4_break;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

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

/* "gevent/core.pyx":142
 *             break
 *     if flags:
 *         result.append(flags)             # <<<<<<<<<<<<<<
 *     return result
 *
 */
    __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __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 = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gevent.core._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_4core_5_flags_to_list(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_AsUnsignedInt(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4_flags_to_list(__pyx_self, ((unsigned int)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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_4core__flags_to_list(__pyx_v_flags, 0); 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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core._flags_to_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":152
 *
 *
 * 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_4core_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/
static unsigned int __pyx_f_6gevent_4core__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;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_flags_to_int", 0);
  __Pyx_INCREF(__pyx_v_flags);

/* "gevent/core.pyx":154
 * 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, (int, long)):
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_flags); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = ((!__pyx_t_1) != 0);
  if (__pyx_t_2) {

/* "gevent/core.pyx":155
 *     # Note, that order does not matter, libev has its own predefined order
 *     if not flags:
 *         return 0             # <<<<<<<<<<<<<<
 *     if isinstance(flags, (int, long)):
 *         return flags
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":156
 *     if not flags:
 *         return 0
 *     if isinstance(flags, (int, long)):             # <<<<<<<<<<<<<<
 *         return flags
 *     cdef unsigned int result = 0
 */
  __Pyx_INCREF(__pyx_v_flags);
  __pyx_t_3 = __pyx_v_flags;
  __pyx_t_2 = PyInt_Check(__pyx_t_3);
  if (!__pyx_t_2) {
    __pyx_t_1 = PyLong_Check(__pyx_t_3);
    __pyx_t_4 = __pyx_t_1;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

/* "gevent/core.pyx":157
 *         return 0
 *     if isinstance(flags, (int, long)):
 *         return flags             # <<<<<<<<<<<<<<
 *     cdef unsigned int result = 0
 *     try:
 */
    __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_v_flags); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_t_5;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

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

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

/* "gevent/core.pyx":160
 *     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 = 160; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_GOTREF(__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 = 160; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_4 = (__pyx_t_2 != 0);
      if (__pyx_t_4) {

/* "gevent/core.pyx":161
 *     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 = 161; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_9 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_flags, __pyx_t_9);
        __pyx_t_9 = 0;
        goto __pyx_L13;
      }
      __pyx_L13:;

/* "gevent/core.pyx":162
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')
 *         for value in flags:             # <<<<<<<<<<<<<<
 *             value = value.strip().lower()
 *             if value:
 */
      if (PyList_CheckExact(__pyx_v_flags) || PyTuple_CheckExact(__pyx_v_flags)) {
        __pyx_t_9 = __pyx_v_flags; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
        __pyx_t_11 = NULL;
      } else {
        __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_v_flags); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext;
      }
      for (;;) {
        if (!__pyx_t_11 && PyList_CheckExact(__pyx_t_9)) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #endif
        } else if (!__pyx_t_11 && PyTuple_CheckExact(__pyx_t_9)) {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
          #if CYTHON_COMPILING_IN_CPYTHON
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_3); __pyx_t_10++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          #endif
        } else {
          __pyx_t_3 = __pyx_t_11(__pyx_t_9);
          if (unlikely(!__pyx_t_3)) {
            if (PyErr_Occurred()) {
              if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
              else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __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/core.pyx":163
 *             flags = flags.split(',')
 *         for value in flags:
 *             value = value.strip().lower()             # <<<<<<<<<<<<<<
 *             if value:
 *                 result |= _flags_str2int[value]
 */
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s__strip); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_12 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s__lower); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 163; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_12);
        __pyx_t_12 = 0;

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

/* "gevent/core.pyx":165
 *             value = value.strip().lower()
 *             if value:
 *                 result |= _flags_str2int[value]             # <<<<<<<<<<<<<<
 *     except KeyError, ex:
 *         raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys()))))
 */
          __pyx_t_12 = PyLong_FromUnsignedLong(__pyx_v_result); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s___flags_str2int); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __pyx_t_13 = PyObject_GetItem(__pyx_t_3, __pyx_v_value); if (!__pyx_t_13) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_t_3 = PyNumber_InPlaceOr(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_5 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_3); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L5_error;}
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
          __pyx_v_result = __pyx_t_5;
          goto __pyx_L16;
        }
        __pyx_L16:;
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    }
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    goto __pyx_L12_try_end;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

/* "gevent/core.pyx":166
 *             if value:
 *                 result |= _flags_str2int[value]
 *     except KeyError, 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.core._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_3, &__pyx_t_13) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_INCREF(__pyx_t_3);
      __pyx_v_ex = __pyx_t_3;

/* "gevent/core.pyx":167
 *                 result |= _flags_str2int[value]
 *     except KeyError, ex:
 *         raise ValueError('Invalid backend or flag: %s\nPossible values: %s' % (ex, ', '.join(sorted(_flags_str2int.keys()))))             # <<<<<<<<<<<<<<
 *     return result
 *
 */
      __pyx_t_12 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_6), __pyx_n_s__join); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_15 = __Pyx_GetModuleGlobalName(__pyx_n_s___flags_str2int); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __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 = 167; __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 = PyObject_Call(__pyx_t_16, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
      __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_Call(__pyx_builtin_sorted, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
      __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_Call(__pyx_t_12, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
      __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      __Pyx_INCREF(__pyx_v_ex);
      PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_v_ex);
      __Pyx_GIVEREF(__pyx_v_ex);
      PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15);
      __Pyx_GIVEREF(__pyx_t_15);
      __pyx_t_15 = 0;
      __pyx_t_15 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_5), ((PyObject *)__pyx_t_16)); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_15));
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
      __pyx_t_16 = PyTuple_New(1); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_16);
      PyTuple_SET_ITEM(__pyx_t_16, 0, ((PyObject *)__pyx_t_15));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_15));
      __pyx_t_15 = 0;
      __pyx_t_15 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_16), NULL); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_GOTREF(__pyx_t_15);
      __Pyx_DECREF(((PyObject *)__pyx_t_16)); __pyx_t_16 = 0;
      __Pyx_Raise(__pyx_t_15, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L7_except_error;}
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      goto __pyx_L6_exception_handled;
    }
    __pyx_L7_except_error:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    goto __pyx_L1_error;
    __pyx_L6_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_XGIVEREF(__pyx_t_8);
    __Pyx_ExceptionReset(__pyx_t_6, __pyx_t_7, __pyx_t_8);
    __pyx_L12_try_end:;
  }

/* "gevent/core.pyx":168
 *     except KeyError, 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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_AddTraceback("gevent.core._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_4core_7_flags_to_int(PyObject *__pyx_self, PyObject *__pyx_v_flags); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_6_flags_to_int(__pyx_self, ((PyObject *)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":152
 *
 *
 * 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_pf_6gevent_4core_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_4core__flags_to_int(__pyx_v_flags, 0); if (unlikely(__pyx_t_1 == -1 && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core._flags_to_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":171
 *
 *
 * cdef str _str_hex(object flag):             # <<<<<<<<<<<<<<
 *     if isinstance(flag, (int, long)):
 *         return hex(flag)
 */

static PyObject *__pyx_f_6gevent_4core__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;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_str_hex", 0);

/* "gevent/core.pyx":172
 *
 * cdef str _str_hex(object flag):
 *     if isinstance(flag, (int, long)):             # <<<<<<<<<<<<<<
 *         return hex(flag)
 *     return str(flag)
 */
  __Pyx_INCREF(__pyx_v_flag);
  __pyx_t_1 = __pyx_v_flag;
  __pyx_t_2 = PyInt_Check(__pyx_t_1);
  if (!__pyx_t_2) {
    __pyx_t_3 = PyLong_Check(__pyx_t_1);
    __pyx_t_4 = __pyx_t_3;
  } else {
    __pyx_t_4 = __pyx_t_2;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_2 = (__pyx_t_4 != 0);
  if (__pyx_t_2) {

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

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

  __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core._str_hex", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_6gevent_4core_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
static PyObject *__pyx_f_6gevent_4core__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/core.pyx":179
 * 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/core.pyx":180
 *     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/core.pyx":181
 *     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;
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":182
 *     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/core.pyx":183
 *         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 = PyLong_FromUnsignedLong(__pyx_v_flags); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_7), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__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 = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__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 = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":184
 *     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/core.pyx":185
 *         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 = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_f_6gevent_4core__flags_to_list(__pyx_v_flags, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    if (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 = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (!__pyx_t_6 && 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 = 185; __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 = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
        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 = 185; __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 = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        #endif
      } else {
        __pyx_t_2 = __pyx_t_6(__pyx_t_4);
        if (unlikely(!__pyx_t_2)) {
          if (PyErr_Occurred()) {
            if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
            else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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 = ((PyObject *)__pyx_f_6gevent_4core__str_hex(__pyx_v_x)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __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 = 185; __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/core.pyx":186
 *     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_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_9), __pyx_n_s__join); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(((PyObject *)__pyx_v_as_list));
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_as_list));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_as_list));
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_8), __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  __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.core._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_4core_9_check_flags(PyObject *__pyx_self, PyObject *__pyx_arg_flags); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_AsUnsignedInt(__pyx_arg_flags); if (unlikely((__pyx_v_flags == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_8_check_flags(__pyx_self, ((unsigned int)__pyx_v_flags));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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_4core__check_flags(__pyx_v_flags, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core._check_flags", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pw_6gevent_4core_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/
static PyObject *__pyx_f_6gevent_4core__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/core.pyx":190
 *
 * 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 = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

/* "gevent/core.pyx":192
 *     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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (!__pyx_t_4 && 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 = 192; __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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
      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 = 192; __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 = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __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 = 192; __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 = 192; __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 = 192; __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 = 192; __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 = 192; __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 = 192; __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/core.pyx":193
 *     cdef int c_flag
 *     for (flag, string) in _events:
 *         c_flag = flag             # <<<<<<<<<<<<<<
 *         if events & c_flag:
 *             result.append(string)
 */
    __pyx_t_9 = __Pyx_PyInt_AsInt(__pyx_v_flag); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_c_flag = __pyx_t_9;

/* "gevent/core.pyx":194
 *     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/core.pyx":195
 *         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 = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":196
 *         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));
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":197
 *             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/core.pyx":198
 *             events = events & (~c_flag)
 *         if not events:
 *             break             # <<<<<<<<<<<<<<
 *     if events:
 *         result.append(hex(events))
 */
      goto __pyx_L4_break;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4_break:;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":199
 *         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/core.pyx":200
 *             break
 *     if events:
 *         result.append(hex(events))             # <<<<<<<<<<<<<<
 *     return '|'.join(result)
 *
 */
    __pyx_t_2 = PyInt_FromLong(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __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 = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_hex, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__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 = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

/* "gevent/core.pyx":201
 *     if events:
 *         result.append(hex(events))
 *     return '|'.join(result)             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_kp_s_9), __pyx_n_s__join); 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_1 = PyTuple_New(1); 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);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_result));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_result));
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); 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);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gevent.core._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_4core_11_events_to_str(PyObject *__pyx_self, PyObject *__pyx_arg_events); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_10_events_to_str(__pyx_self, ((int)__pyx_v_events));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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_4core__events_to_str(__pyx_v_events, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core._events_to_str", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_13supported_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_4core_13supported_backends = {__Pyx_NAMESTR("supported_backends"), (PyCFunction)__pyx_pw_6gevent_4core_13supported_backends, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6gevent_4core_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_4core_12supported_backends(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":205
 *
 * def supported_backends():
 *     return _flags_to_list(libev.ev_supported_backends())             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_4core__flags_to_list(ev_supported_backends(), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.supported_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_15recommended_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_4core_15recommended_backends = {__Pyx_NAMESTR("recommended_backends"), (PyCFunction)__pyx_pw_6gevent_4core_15recommended_backends, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6gevent_4core_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_4core_14recommended_backends(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":209
 *
 * def recommended_backends():
 *     return _flags_to_list(libev.ev_recommended_backends())             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_4core__flags_to_list(ev_recommended_backends(), 0); 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_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.recommended_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_17embeddable_backends(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_4core_17embeddable_backends = {__Pyx_NAMESTR("embeddable_backends"), (PyCFunction)__pyx_pw_6gevent_4core_17embeddable_backends, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6gevent_4core_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_4core_16embeddable_backends(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":213
 *
 * def embeddable_backends():
 *     return _flags_to_list(libev.ev_embeddable_backends())             # <<<<<<<<<<<<<<
 *
 *
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_4core__flags_to_list(ev_embeddable_backends(), 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.embeddable_backends", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyMethodDef __pyx_mdef_6gevent_4core_19time = {__Pyx_NAMESTR("time"), (PyCFunction)__pyx_pw_6gevent_4core_19time, METH_NOARGS, __Pyx_DOCSTR(0)};
static PyObject *__pyx_pw_6gevent_4core_19time(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("time (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_18time(__pyx_self);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":217
 *
 * 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 = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4loop_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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,&__pyx_n_s__default,&__pyx_n_s__ptr,0};
    PyObject* values[3] = {0,0,0};

/* "gevent/core.pyx":240
 *
 *
 *     def __init__(self, object flags=None, object default=None, size_t ptr=0):             # <<<<<<<<<<<<<<
 *         cdef unsigned int c_flags
 *         cdef object old_handler = None
 */
    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);
          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 = 240; __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_AsSize_t(values[2]); if (unlikely((__pyx_v_ptr == (size_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __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 = 240; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop___init__(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_flags, __pyx_v_default, __pyx_v_ptr);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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/core.pyx":242
 *     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/core.pyx":243
 *         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/core.pyx":243
 *         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/core.pyx":247
 *
 *
 *         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/core.pyx":245
 *         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/core.pyx":247
 *         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/core.pyx":248
 *
 *         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/core.pyx":249
 *         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);
    goto __pyx_L3;
  }
  /*else*/ {

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

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

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

/* "gevent/core.pyx":254
 *             _check_flags(c_flags)
 *             c_flags |= libev.EVFLAG_NOENV
 *             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/core.pyx":255
 *             c_flags |= libev.EVFLAG_NOENV
 *             if default is None:
 *                 default = True             # <<<<<<<<<<<<<<
 *                 if _default_loop_destroyed:
 *                     default = False
 */
      __pyx_t_3 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF_SET(__pyx_v_default, __pyx_t_3);
      __pyx_t_3 = 0;

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

/* "gevent/core.pyx":257
 *                 default = True
 *                 if _default_loop_destroyed:
 *                     default = False             # <<<<<<<<<<<<<<
 *             if default:
 *                 self._ptr = libev.gevent_ev_default_loop(c_flags)
 */
        __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF_SET(__pyx_v_default, __pyx_t_3);
        __pyx_t_3 = 0;
        goto __pyx_L5;
      }
      __pyx_L5:;
      goto __pyx_L4;
    }
    __pyx_L4:;

/* "gevent/core.pyx":258
 *                 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 = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_4) {

/* "gevent/core.pyx":259
 *                     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/core.pyx":260
 *             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/core.pyx":261
 *                 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/core.pyx":261
 *                 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 = PyLong_FromUnsignedLong(__pyx_v_c_flags); 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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_10), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __Pyx_DECREF(((PyObject *)__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 = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_builtin_SystemError, ((PyObject *)__pyx_t_5), NULL); 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(((PyObject *)__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 = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L7;
      }
      __pyx_L7:;
#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/core.pyx":263
 *                     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/core.pyx":264
 *
 *                 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)
      goto __pyx_L6;
    }
    /*else*/ {

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

/* "gevent/core.pyx":268
 *             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/core.pyx":269
 *                 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 = PyLong_FromUnsignedLong(__pyx_v_c_flags); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __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 = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
        __Pyx_GIVEREF(__pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_11), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_3));
        __Pyx_DECREF(((PyObject *)__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 = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_3));
        __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
        __pyx_t_3 = 0;
        __pyx_t_3 = PyObject_Call(__pyx_builtin_SystemError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(((PyObject *)__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 = 269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    __pyx_L6:;

/* "gevent/core.pyx":270
 *                 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_4 = __Pyx_PyObject_IsTrue(__pyx_v_default); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (!__pyx_t_4) {
      __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s____SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __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;
    } else {
      __pyx_t_6 = __pyx_t_4;
    }
    if (__pyx_t_6) {

/* "gevent/core.pyx":271
 *                     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 = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_5 = __pyx_f_6gevent_4core_set_syserr_cb(__pyx_t_3, 0); 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_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

/* "gevent/core.pyx":272
 *             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/core.pyx":273
 *                 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/core.pyx":274
 *             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 = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  __Pyx_GOTREF(__pyx_v_self->_callbacks);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks));
  __pyx_v_self->_callbacks = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.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/core.pyx":276
 *         self._callbacks = []
 *
 *     cdef _run_callbacks(self):             # <<<<<<<<<<<<<<
 *         cdef callback cb
 *         cdef object callbacks
 */

static PyObject *__pyx_f_6gevent_4core_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;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_run_callbacks", 0);

/* "gevent/core.pyx":279
 *         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 = 1000;

/* "gevent/core.pyx":280
 *         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/core.pyx":281
 *         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_1 = (((PyObject *)__pyx_v_self->_callbacks) != Py_None) && (PyList_GET_SIZE(((PyObject *)__pyx_v_self->_callbacks)) != 0);
    if (__pyx_t_1) {
      __pyx_t_2 = (__pyx_v_count > 0);
      __pyx_t_3 = __pyx_t_2;
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (!__pyx_t_3) break;

/* "gevent/core.pyx":282
 *         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_4 = ((PyObject *)__pyx_v_self->_callbacks);
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_callbacks, __pyx_t_4);
    __pyx_t_4 = 0;

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

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

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

/* "gevent/core.pyx":286
 *             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/core.pyx":287
 *                 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);
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }

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

/* "gevent/core.pyx":289
 *                 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));
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("gevent.core.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_3_stop_watchers(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_2_stop_watchers(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":292
 *
 *     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/core.pyx":293
 *     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/core.pyx":294
 *         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/core.pyx":294
 *         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));
    goto __pyx_L3;
  }
  __pyx_L3:;
#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/core.pyx":296
 *             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/core.pyx":297
 *
 *         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/core.pyx":298
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;
#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 = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_5destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_4destroy(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":303
 *     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/core.pyx":304
 *         global _default_loop_destroyed
 *         if self._ptr:
 *             self._stop_watchers()             # <<<<<<<<<<<<<<
 *             if __SYSERR_CALLBACK == self._handle_syserr:
 *                 set_syserr_cb(None)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___stop_watchers); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

/* "gevent/core.pyx":305
 *         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_3 = __Pyx_GetModuleGlobalName(__pyx_n_s____SYSERR_CALLBACK); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___handle_syserr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

/* "gevent/core.pyx":306
 *             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_4core_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4;
    }
    __pyx_L4:;

/* "gevent/core.pyx":307
 *             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/core.pyx":308
 *                 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_4core__default_loop_destroyed = 1;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":309
 *             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/core.pyx":310
 *                 _default_loop_destroyed = True
 *             libev.ev_loop_destroy(self._ptr)
 *             self._ptr = NULL             # <<<<<<<<<<<<<<
 *
 *     def __dealloc__(self):
 */
    __pyx_v_self->_ptr = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __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.core.loop.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_6gevent_4core_4loop_7__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6gevent_4core_4loop_7__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6gevent_4core_4loop_6__dealloc__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

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

static void __pyx_pf_6gevent_4core_4loop_6__dealloc__(struct PyGeventLoopObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  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("__dealloc__", 0);

/* "gevent/core.pyx":313
 *
 *     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/core.pyx":314
 *     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_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___stop_watchers); 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_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); 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_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

/* "gevent/core.pyx":315
 *         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/core.pyx":316
 *             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);
      goto __pyx_L4;
    }
    __pyx_L4:;

/* "gevent/core.pyx":317
 *             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;
    goto __pyx_L3;
  }
  __pyx_L3:;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.core.loop.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_3ptr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_3ptr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_3ptr___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":322
 *
 *         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 = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.loop.ptr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_11WatcherType_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_11WatcherType___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_6MAXPRI_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_6MAXPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":332
 *
 *        def __get__(self):
 *            return libev.EV_MAXPRI             # <<<<<<<<<<<<<<
 *
 *     property MINPRI:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(EV_MAXPRI); 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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.loop.MAXPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_6MINPRI_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_6MINPRI___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":337
 *
 *         def __get__(self):
 *             return libev.EV_MINPRI             # <<<<<<<<<<<<<<
 *
 *     def _handle_syserr(self, message, errno):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(EV_MINPRI); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.loop.MINPRI.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_9_handle_syserr(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 339; __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 = 339; __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 = 339; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_8_handle_syserr(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_message, __pyx_v_errno);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":339
 *             return libev.EV_MINPRI
 *
 *     def _handle_syserr(self, message, errno):             # <<<<<<<<<<<<<<
 *         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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;
  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("_handle_syserr", 0);

/* "gevent/core.pyx":340
 *
 *     def _handle_syserr(self, message, errno):
 *         self.handle_error(None, SystemError, SystemError(message + ': ' + os.strerror(errno)), None)             # <<<<<<<<<<<<<<
 *
 *     cpdef handle_error(self, context, type, value, tb):
 */
  __pyx_t_1 = PyNumber_Add(__pyx_v_message, ((PyObject *)__pyx_kp_s_12)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__os); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__strerror); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __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 = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_errno);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_errno);
  __Pyx_GIVEREF(__pyx_v_errno);
  __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __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 = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(__pyx_builtin_SystemError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_t_4 = ((struct __pyx_vtabstruct_6gevent_4core_loop *)__pyx_v_self->__pyx_vtab)->handle_error(__pyx_v_self, Py_None, __pyx_builtin_SystemError, __pyx_t_2, Py_None, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 340; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gevent.core.loop._handle_syserr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":342
 *         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_4core_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6gevent_4core_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;
  int __pyx_t_4;
  int __pyx_t_5;
  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 = 342; __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_4core_4loop_11handle_error)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(__pyx_v_context);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_context);
      __Pyx_GIVEREF(__pyx_v_context);
      __Pyx_INCREF(__pyx_v_type);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_type);
      __Pyx_GIVEREF(__pyx_v_type);
      __Pyx_INCREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_INCREF(__pyx_v_tb);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_tb);
      __Pyx_GIVEREF(__pyx_v_tb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

/* "gevent/core.pyx":344
 *     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/core.pyx":345
 *         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_4 = (__pyx_v_error_handler != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

/* "gevent/core.pyx":347
 *         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, ((PyObject *)__pyx_n_s__handle_error), __pyx_v_error_handler); 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_v_handle_error = __pyx_t_1;
    __pyx_t_1 = 0;

/* "gevent/core.pyx":348
 *             # 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_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_context);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_context);
    __Pyx_GIVEREF(__pyx_v_context);
    __Pyx_INCREF(__pyx_v_type);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_type);
    __Pyx_GIVEREF(__pyx_v_type);
    __Pyx_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __Pyx_INCREF(__pyx_v_tb);
    PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_tb);
    __Pyx_GIVEREF(__pyx_v_tb);
    __pyx_t_3 = PyObject_Call(__pyx_v_handle_error, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

/* "gevent/core.pyx":350
 *             handle_error(context, type, value, tb)
 *         else:
 *             self._default_handle_error(context, type, value, tb)             # <<<<<<<<<<<<<<
 *
 *     cpdef _default_handle_error(self, context, type, value, tb):
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_6gevent_4core_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_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L3:;

  __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_AddTraceback("gevent.core.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_4core_4loop_11handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 342; __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 = 342; __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 = 342; __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 = 342; __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 = 342; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_10handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":342
 *         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_pf_6gevent_4core_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 = ((struct __pyx_vtabstruct_6gevent_4core_loop *)__pyx_v_self->__pyx_vtab)->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 = 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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.loop.handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":352
 *             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_4core_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_6gevent_4core_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;
  int __pyx_t_4;
  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_13); 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);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_6gevent_4core_4loop_13_default_handle_error)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_2 = PyTuple_New(4); 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_INCREF(__pyx_v_context);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_context);
      __Pyx_GIVEREF(__pyx_v_context);
      __Pyx_INCREF(__pyx_v_type);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_type);
      __Pyx_GIVEREF(__pyx_v_type);
      __Pyx_INCREF(__pyx_v_value);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_value);
      __Pyx_GIVEREF(__pyx_v_value);
      __Pyx_INCREF(__pyx_v_tb);
      PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_tb);
      __Pyx_GIVEREF(__pyx_v_tb);
      __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

/* "gevent/core.pyx":355
 *         # 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_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__traceback); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__print_exception); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_type);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_type);
  __Pyx_GIVEREF(__pyx_v_type);
  __Pyx_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_INCREF(__pyx_v_tb);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_tb);
  __Pyx_GIVEREF(__pyx_v_tb);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":356
 *         # 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_4 = (__pyx_v_self->_ptr != 0);
  if (__pyx_t_4) {

/* "gevent/core.pyx":357
 *         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);
    goto __pyx_L3;
  }
  __pyx_L3:;

  __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_AddTraceback("gevent.core.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_4core_4loop_13_default_handle_error(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 352; __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 = 352; __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 = 352; __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 = 352; __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 = 352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_12_default_handle_error(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_context, __pyx_v_type, __pyx_v_value, __pyx_v_tb);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":352
 *             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_pf_6gevent_4core_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 = ((struct __pyx_vtabstruct_6gevent_4core_loop *)__pyx_v_self->__pyx_vtab)->_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 = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.loop._default_handle_error", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_15run(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_14;
    values[1] = __pyx_k_15;
    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 = 359; __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 = 359; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_14run(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_nowait, __pyx_v_once);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":361
 *     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/core.pyx":362
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         cdef unsigned int flags = 0
 *         if nowait:
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __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 = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":363
 *         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/core.pyx":364
 *             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 = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":365
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":366
 *         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 = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":367
 *             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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":368
 *         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/core.pyx":369
 *             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/core.pyx":368
 *         if once:
 *             flags |= libev.EVRUN_ONCE
 *         with nogil:             # <<<<<<<<<<<<<<
 *             libev.ev_run(self._ptr, flags)
 *
 */
      /*finally:*/ {
        #ifdef WITH_THREAD
        Py_BLOCK_THREADS
        #endif
      }
  }

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

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_17reinit(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_16reinit(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

/* "gevent/core.pyx":372
 *
 *     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/core.pyx":373
 *     def reinit(self):
 *         if self._ptr:
 *             libev.ev_loop_fork(self._ptr)             # <<<<<<<<<<<<<<
 *
 *     def ref(self):
 */
    ev_loop_fork(__pyx_v_self->_ptr);
    goto __pyx_L3;
  }
  __pyx_L3:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_19ref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_18ref(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":377
 *     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/core.pyx":378
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_ref(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __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 = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

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

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_21unref(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_20unref(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":383
 *     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/core.pyx":384
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_unref(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __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 = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":385
 *         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);

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

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_23break_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 387; __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_AsInt(values[0]); if (unlikely((__pyx_v_how == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_how = __pyx_k_20;
    }
  }
  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 = 387; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.break_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_22break_(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_how);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":389
 *     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/core.pyx":390
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_break(self._ptr, how)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), 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;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":391
 *         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);

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

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_25verify(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_24verify(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":395
 *     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/core.pyx":396
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_verify(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_22), 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;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

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

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_27now(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_26now(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":401
 *     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/core.pyx":402
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         return libev.ev_now(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), 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;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":403
 *         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 = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.now", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_29update(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_28update(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":407
 *     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/core.pyx":408
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_now_update(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_24), 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;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":409
 *         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);

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

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_31__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_31__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_30__repr__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

/* "gevent/core.pyx":412
 *
 *     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 = 412; __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 = 412; __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 = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_3 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___format); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_25), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gevent.core.loop.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_7default_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_7default_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_7default___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":418
 *         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/core.pyx":419
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __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 = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":420
 *             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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); 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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.default.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_9iteration_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_9iteration_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_9iteration___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":426
 *         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/core.pyx":427
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_iteration(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __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 = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":428
 *             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 = PyLong_FromUnsignedLong(ev_iteration(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.iteration.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_5depth_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_5depth_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_5depth___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":434
 *         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/core.pyx":435
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_depth(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_28), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __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 = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":436
 *             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 = PyLong_FromUnsignedLong(ev_depth(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_11backend_int_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_11backend_int___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":442
 *         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/core.pyx":443
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_backend(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __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 = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":444
 *             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 = PyLong_FromUnsignedLong(ev_backend(__pyx_v_self->_ptr)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.backend_int.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_7backend_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_7backend_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_7backend___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":450
 *         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/core.pyx":451
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __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 = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":452
 *             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/core.pyx":453
 *                 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 = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (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 = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (!__pyx_t_5 && 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 = 453; __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 = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
      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 = 453; __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 = 453; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      #endif
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        if (PyErr_Occurred()) {
          if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
          else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __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 = 453; __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 = 453; __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 = 453; __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 = 453; __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 = 453; __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 = 453; __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/core.pyx":454
 *             cdef unsigned int backend = libev.ev_backend(self._ptr)
 *             for key, value in _flags:
 *                 if key == backend:             # <<<<<<<<<<<<<<
 *                     return value
 *             return backend
 */
    __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_v_backend); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __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 = 454; __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 = 454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (__pyx_t_1) {

/* "gevent/core.pyx":455
 *             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;
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

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

  __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_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("gevent.core.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_10pendingcnt_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_10pendingcnt___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":462
 *         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/core.pyx":463
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_pending_count(self._ptr)
 *
 */
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_31), 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;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.pendingcnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_33io(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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,&__pyx_n_s__ref,&__pyx_n_s__priority,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = __pyx_k_32;

#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/core.pyx":470
 *
 *
 *     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/core.pyx":467
 *
 *
 *     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)
    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)) != 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 = 470; __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 = 467; __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 = 470; __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 = 467; __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_AsInt(values[0]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_events = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __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_from_py_vfd_socket_t(values[0]); if (unlikely((__pyx_v_fd == (vfd_socket_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_events = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __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 = 470; __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 = 467; __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.core.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_32io(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);
  __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_4core_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_4core_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/core.pyx":471
 *
 *     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/core.pyx":468
 *
 *     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 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __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_to_py_vfd_socket_t(__pyx_v_fd); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __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 = PyInt_FromLong(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __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 = PyInt_FromLong(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __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 = 471; __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 = 468; __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));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority);
  __Pyx_GIVEREF(__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 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_io)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __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 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_io)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; __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(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("gevent.core.loop.io", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_35timer(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_33;

/* "gevent/core.pyx":474
 *
 *
 *     def timer(self, double after, double repeat=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return timer(self, after, repeat, ref, priority)
 *
 */
    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 = 474; __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 = 474; __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 = 474; __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 = 474; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_34timer(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":475
 *
 *     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 = 475; __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 = 475; __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 = 475; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_timer)), ((PyObject *)__pyx_t_3), 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_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("gevent.core.loop.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_37signal(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_34;

/* "gevent/core.pyx":477
 *         return timer(self, after, repeat, ref, priority)
 *
 *     def signal(self, int signum, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return signal(self, signum, ref, priority)
 *
 */
    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 = 477; __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_AsInt(values[0]); if (unlikely((__pyx_v_signum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __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 = 477; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_36signal(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_signum, __pyx_v_ref, __pyx_v_priority);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":478
 *
 *     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 = PyInt_FromLong(__pyx_v_signum); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __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 = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_signal)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 478; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.signal", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_39idle(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_35;

/* "gevent/core.pyx":480
 *         return signal(self, signum, ref, priority)
 *
 *     def idle(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return idle(self, ref, priority)
 *
 */
    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 = 480; __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 = 480; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_38idle(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":481
 *
 *     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 = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_idle)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 481; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.idle", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_41prepare(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_36;

/* "gevent/core.pyx":483
 *         return idle(self, ref, priority)
 *
 *     def prepare(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return prepare(self, ref, priority)
 *
 */
    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 = 483; __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 = 483; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_40prepare(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":484
 *
 *     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 = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_prepare)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 484; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.prepare", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_43check(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_37;

/* "gevent/core.pyx":486
 *         return prepare(self, ref, priority)
 *
 *     def check(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return check(self, ref, priority)
 *
 */
    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 = 486; __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 = 486; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_42check(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":487
 *
 *     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 = 487; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_check)), ((PyObject *)__pyx_t_1), 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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.check", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_45fork(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_38;

/* "gevent/core.pyx":489
 *         return check(self, ref, priority)
 *
 *     def fork(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return fork(self, ref, priority)
 *
 */
    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 = 489; __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 = 489; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_44fork(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":490
 *
 *     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 = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_fork)), ((PyObject *)__pyx_t_1), NULL); 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_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.fork", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_47async(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_39;

/* "gevent/core.pyx":492
 *         return fork(self, ref, priority)
 *
 *     def async(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return async(self, ref, priority)
 *
 */
    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 = 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("async", 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.core.loop.async", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_46async(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_ref, __pyx_v_priority);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":493
 *
 *     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 = 493; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_async)), ((PyObject *)__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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.async", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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_4core_4loop_49child(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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] = __pyx_k_40;
    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 = 498; __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_AsInt(values[0]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __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 = 498; __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 = 498; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4loop_48child(((struct PyGeventLoopObject *)__pyx_v_self), __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":499
 *
 *     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 = PyInt_FromLong(__pyx_v_pid); 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_t_2 = __Pyx_PyBool_FromLong(__pyx_v_trace); 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_t_3 = PyTuple_New(4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_child)), ((PyObject *)__pyx_t_3), 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(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("gevent.core.loop.child", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_51install_sigchld(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_50install_sigchld(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_53stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_49stat(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    values[2] = __pyx_k_41;
#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))
    values[2] = __pyx_k_40;
#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/core.pyx":506
 *
 *
 *     def stat(self, bytes path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return stat(self, path, interval, ref, priority)
 *
 */
    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 = 506; __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 = 506; __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 = 506; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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), (&PyBytes_Type), 1, "path", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __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_4core_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_4core_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)
  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_4core_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_4core_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/core.pyx":507
 *
 *     def stat(self, bytes 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 = 507; __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 = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __Pyx_INCREF(((PyObject *)__pyx_v_path));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_path));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_path));
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_ref);
  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_v_ref);
  __Pyx_GIVEREF(__pyx_v_ref);
  __Pyx_INCREF(__pyx_v_priority);
  PyTuple_SET_ITEM(__pyx_t_2, 4, __pyx_v_priority);
  __Pyx_GIVEREF(__pyx_v_priority);
  __pyx_t_1 = 0;
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_stat)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.stat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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_4core_4loop_55run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_51run_callback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 509; __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 = 509; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.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_4core_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_4core_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)
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":509
 *         return stat(self, path, interval, ref, priority)
 *
 *     def run_callback(self, func, *args):             # <<<<<<<<<<<<<<
 *
 *         if not 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))
static PyObject *__pyx_pf_6gevent_4core_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_4core_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/core.pyx":511
 *     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/core.pyx":512
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         cdef callback cb = callback(func, args)
 *         self._callbacks.append(cb)
 */
#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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __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_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":513
 *         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 = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_v_func);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_func);
  __Pyx_GIVEREF(__pyx_v_func);
  __Pyx_INCREF(((PyObject *)__pyx_v_args));
  PyTuple_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __pyx_t_3 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core_callback)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_v_cb = ((struct PyGeventCallbackObject *)__pyx_t_3);
  __pyx_t_3 = 0;

/* "gevent/core.pyx":514
 *             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(((PyObject *)__pyx_v_self->_callbacks) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%s'", "append");
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 514; __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 = 514; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

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

/* "gevent/core.pyx":516
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.core.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;
}

/* 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_4core_4loop_57_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_53_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_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_4core_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)
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

#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_4core_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))
static PyObject *__pyx_pf_6gevent_4core_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;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_format", 0);

/* "gevent/core.pyx":519
 *
 *     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/core.pyx":520
 *     def _format(self):
 *         if not self._ptr:
 *             return 'destroyed'             # <<<<<<<<<<<<<<
 *         cdef object msg = self.backend
 *         if self.default:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_n_s__destroyed));
    __pyx_r = ((PyObject *)__pyx_n_s__destroyed);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":521
 *         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 = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_msg = __pyx_t_2;
  __pyx_t_2 = 0;

/* "gevent/core.pyx":522
 *             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 = 522; __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 = 522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_1) {

/* "gevent/core.pyx":523
 *         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) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, ((PyObject *)__pyx_kp_s_43)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __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 = PyNumber_InPlaceAdd(__pyx_v_msg, ((PyObject *)__pyx_kp_s_42)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; __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_SET(__pyx_v_msg, __pyx_t_2);
    __pyx_t_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/core.pyx":524
 *         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/core.pyx":524
 *         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 = 524; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_44), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_43), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; __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(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_msg, ((PyObject *)__pyx_t_3)); 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_DECREF(((PyObject *)__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/core.pyx":528
 *
 *
 *         return msg             # <<<<<<<<<<<<<<
 *
 *
 */
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
/* "gevent/core.pyx":526
 *         msg += ' pending=%s' % self.pendingcnt
 *
 *         msg += self._format_details()             # <<<<<<<<<<<<<<
 *
 *         return msg
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___format_details); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; __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 = 526; __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;

/* "gevent/core.pyx":528
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.core.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;
}

/* 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_4core_4loop_59_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_55_format_details(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_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_4core_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))
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

#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_pf_6gevent_4core_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))
static PyObject *__pyx_pf_6gevent_4core_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;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  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/core.pyx":533
 *
 *     def _format_details(self):
 *         cdef str msg = ''             # <<<<<<<<<<<<<<
 *         cdef object fileno = self.fileno()
 *         cdef object sigfd = None
 */
#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_INCREF(((PyObject *)__pyx_kp_s_45));
  __pyx_v_msg = __pyx_kp_s_45;
#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_INCREF(((PyObject *)__pyx_kp_s_44));
  __pyx_v_msg = __pyx_kp_s_44;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))

/* "gevent/core.pyx":534
 *     def _format_details(self):
 *         cdef str msg = ''
 *         cdef object fileno = self.fileno()             # <<<<<<<<<<<<<<
 *         cdef object sigfd = None
 *         cdef object activecnt = None
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__fileno); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 534; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); 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_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_fileno = __pyx_t_2;
  __pyx_t_2 = 0;

/* "gevent/core.pyx":535
 *         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/core.pyx":536
 *         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/core.pyx":537
 *         cdef object sigfd = None
 *         cdef object activecnt = None
 *         try:             # <<<<<<<<<<<<<<
 *             sigfd = self.sigfd
 *         except AttributeError:
 */
  {
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

/* "gevent/core.pyx":538
 *         cdef object activecnt = None
 *         try:
 *             sigfd = self.sigfd             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             sigfd = None
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__sigfd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_sigfd, __pyx_t_2);
      __pyx_t_2 = 0;
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

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

/* "gevent/core.pyx":540
 *             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_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    __pyx_L10_try_end:;
  }

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

/* "gevent/core.pyx":542
 *             sigfd = None
 *         try:
 *             activecnt = self.activecnt             # <<<<<<<<<<<<<<
 *         except AttributeError:
 *             pass
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__activecnt); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 542; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF_SET(__pyx_v_activecnt, __pyx_t_7);
      __pyx_t_7 = 0;
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L20_try_end;
    __pyx_L13_error:;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

/* "gevent/core.pyx":543
 *         try:
 *             activecnt = self.activecnt
 *         except AttributeError:             # <<<<<<<<<<<<<<
 *             pass
 *         if activecnt is not None:
 */
    __pyx_t_6 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
    if (__pyx_t_6) {
      PyErr_Restore(0,0,0);
      goto __pyx_L14_exception_handled;
    }
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L14_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    __pyx_L20_try_end:;
  }

/* "gevent/core.pyx":545
 *         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/core.pyx":546
 *             pass
 *         if activecnt is not None:
 *             msg += ' ref=' + repr(activecnt)             # <<<<<<<<<<<<<<
 *         if fileno is not None:
 *             msg += ' fileno=' + repr(fileno)
 */
    __pyx_t_7 = PyObject_Repr(__pyx_v_activecnt); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
#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_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_46), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_45), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_msg), __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 546; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;
    goto __pyx_L21;
  }
  __pyx_L21:;

/* "gevent/core.pyx":547
 *         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/core.pyx":548
 *             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_7 = PyObject_Repr(__pyx_v_fileno); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
#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_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_47), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_46), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_msg), __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;
    goto __pyx_L22;
  }
  __pyx_L22:;

/* "gevent/core.pyx":549
 *         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_8 = (__pyx_v_sigfd != Py_None);
  if (__pyx_t_8) {
    __pyx_t_7 = PyObject_RichCompare(__pyx_v_sigfd, __pyx_int_neg_1, Py_NE); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10 = __pyx_t_9;
  } else {
    __pyx_t_10 = __pyx_t_8;
  }
  if (__pyx_t_10) {

/* "gevent/core.pyx":550
 *             msg += ' fileno=' + repr(fileno)
 *         if sigfd is not None and sigfd != -1:
 *             msg += ' sigfd=' + repr(sigfd)             # <<<<<<<<<<<<<<
 *         return msg
 *
 */
    __pyx_t_7 = PyObject_Repr(__pyx_v_sigfd); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
#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_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_48), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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_t_1 = PyNumber_Add(((PyObject *)__pyx_kp_s_47), __pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(((PyObject *)__pyx_v_msg), __pyx_t_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(PyString_CheckExact(__pyx_t_7))||((__pyx_t_7) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected str, got %.200s", Py_TYPE(__pyx_t_7)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 550; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF_SET(__pyx_v_msg, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;
    goto __pyx_L23;
  }
  __pyx_L23:;

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

  __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_7);
  __Pyx_AddTraceback("gevent.core.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;
}

/* 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_4core_4loop_61fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_57fileno(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_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_4core_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))
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

#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_pf_6gevent_4core_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))
static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":555
 *     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/core.pyx":556
 *         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/core.pyx":557
 *         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/core.pyx":558
 *             fd = self._ptr.backend_fd
 *             if fd >= 0:
 *                 return fd             # <<<<<<<<<<<<<<
 *
 *     property activecnt:
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = PyInt_FromLong(__pyx_v_fd); 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_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

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

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_9activecnt_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_9activecnt_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_9activecnt___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":564
 *         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/core.pyx":565
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.activecnt
 *
 */
#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_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_48), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#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 = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.activecnt.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_11sig_pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_11sig_pending___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":572
 *         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/core.pyx":573
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sig_pending
 *
 */
#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_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_49), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#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 = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.sig_pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
static PyObject *__pyx_pw_6gevent_4core_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_5sigfd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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_4core_4loop_5sigfd___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":581
 *         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/core.pyx":582
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sigfd
 *
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && 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 = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.sigfd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_9origflags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4loop_9origflags_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_9origflags___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":590
 *         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/core.pyx":591
 *
 *             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) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_50), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#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 = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":592
 *             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_4core__flags_to_list(__pyx_v_self->_ptr->origflags, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.loop.origflags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_13origflags_int_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_13origflags_int___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":598
 *         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/core.pyx":599
 *
 *             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) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_52), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_51), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#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 = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_13error_handler_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_13error_handler___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":232
 * 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
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4loop_13error_handler_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4loop_13error_handler_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4loop_13error_handler_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_4loop_13error_handler_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_13error_handler_4__del__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4loop_10_callbacks_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4loop_10_callbacks___get__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

static PyObject *__pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->_callbacks));
  __pyx_r = ((PyObject *)__pyx_v_self->_callbacks);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4loop_10_callbacks_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4loop_10_callbacks_2__set__(((struct PyGeventLoopObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_4loop_10_callbacks_2__set__(struct PyGeventLoopObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 list, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->_callbacks);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->_callbacks));
  __pyx_v_self->_callbacks = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_4loop_10_callbacks_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4loop_10_callbacks_4__del__(((struct PyGeventLoopObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->_callbacks));
  __pyx_v_self->_callbacks = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_8callback_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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 = 609; __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 = 609; __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 = 609; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_8callback___init__(((struct PyGeventCallbackObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

/* "gevent/core.pyx":610
 *
 *     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/core.pyx":611
 *     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 tuple, got %.200s", Py_TYPE(__pyx_v_args)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 611; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_args);
  __Pyx_GIVEREF(__pyx_v_args);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_args);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.callback.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_8callback_3stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_8callback_2stop(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

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

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

/* "gevent/core.pyx":614
 *
 *     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/core.pyx":615
 *     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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_8callback_5__nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_8callback_5__nonzero__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__nonzero__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_8callback_4__nonzero__(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":622
 *     # '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
 */

static int __pyx_pf_6gevent_4core_8callback_4__nonzero__(struct PyGeventCallbackObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__nonzero__", 0);

/* "gevent/core.pyx":624
 *     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;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_8callback_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_8callback_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_8callback_7pending___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":628
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self.callback is not None
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":629
 *
 *         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 = 629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.callback.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_8callback_7__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_8callback_7__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_8callback_6__repr__(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":631
 *             return self.callback is not None
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"
 */

static PyObject *__pyx_pf_6gevent_4core_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

/* "gevent/core.pyx":632
 *
 *     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/core.pyx":633
 *     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) && !defined(_WIN32))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
    __pyx_r = ((PyObject *)__pyx_kp_s_45);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_44));
    __pyx_r = ((PyObject *)__pyx_kp_s_44);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_53));
    __pyx_r = ((PyObject *)__pyx_kp_s_53);
#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))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
    __pyx_r = ((PyObject *)__pyx_kp_s_52);
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_54));
    __pyx_r = ((PyObject *)__pyx_kp_s_54);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":634
 *         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/core.pyx":635
 *             return "<...>"
 *         try:
 *             format = self._format()             # <<<<<<<<<<<<<<
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.pending:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_format = __pyx_t_3;
    __pyx_t_3 = 0;

/* "gevent/core.pyx":636
 *         try:
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)             # <<<<<<<<<<<<<<
 *             if self.pending:
 *                 result += " pending"
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __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 = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __pyx_t_4 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_format);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_format);
    __Pyx_GIVEREF(__pyx_v_format);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_46), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_45), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_53), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 636; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_result = ((PyObject *)__pyx_t_4);
    __pyx_t_4 = 0;

/* "gevent/core.pyx":637
 *             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 = 637; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __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 = 637; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

/* "gevent/core.pyx":638
 *             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, )
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_46)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_54)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":639
 *             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/core.pyx":640
 *                 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 = 640; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_self->callback);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_self->callback);
      __Pyx_GIVEREF(__pyx_v_self->callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_47), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_56), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_57), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

/* "gevent/core.pyx":641
 *             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/core.pyx":642
 *                 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 = 642; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(((PyObject *)__pyx_v_self->args));
      PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_v_self->args));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self->args));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_57), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_56), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_58), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

/* "gevent/core.pyx":643
 *             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_1 = (__pyx_v_self->callback == Py_None);
    if ((__pyx_t_1 != 0)) {
      __pyx_t_5 = (__pyx_v_self->args == ((PyObject*)Py_None));
      __pyx_t_6 = (__pyx_t_5 != 0);
    } else {
      __pyx_t_6 = (__pyx_t_1 != 0);
    }
    if (__pyx_t_6) {

/* "gevent/core.pyx":644
 *                 result += " args=%r" % (self.args, )
 *             if self.callback is None and self.args is None:
 *                 result += " stopped"             # <<<<<<<<<<<<<<
 *             return result + ">"
 *         finally:
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_49)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_58)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

/* "gevent/core.pyx":645
 *             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) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_51)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_58)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_60)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 645; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#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;
  }

/* "gevent/core.pyx":647
 *             return result + ">"
 *         finally:
 *             Py_ReprLeave(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L6;
    __pyx_L4: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 3; goto __pyx_L6;
    __pyx_L5: {
      __pyx_why = 4;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L6;
    }
    __pyx_L6:;
    Py_ReprLeave(((PyObject*)__pyx_v_self));
    switch (__pyx_why) {
      case 3: goto __pyx_L0;
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }

  __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.core.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_8callback_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_8callback_8_format(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":649
 *             Py_ReprLeave(<PyObjectPtr>self)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ''
 *
 */

static PyObject *__pyx_pf_6gevent_4core_8callback_8_format(CYTHON_UNUSED struct PyGeventCallbackObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format", 0);

/* "gevent/core.pyx":650
 *
 *     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) && !defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
  __pyx_r = ((PyObject *)__pyx_kp_s_52);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_51));
  __pyx_r = ((PyObject *)__pyx_kp_s_51);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  __pyx_r = ((PyObject *)__pyx_kp_s_45);
#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_INCREF(((PyObject *)__pyx_kp_s_44));
  __pyx_r = ((PyObject *)__pyx_kp_s_44);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_8callback_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_8callback_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_8callback_8callback___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":606
 *
 * cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]:
 *     cdef public object callback             # <<<<<<<<<<<<<<
 *     cdef public tuple args
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_8callback_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_8callback_8callback_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_8callback_8callback_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_8callback_8callback_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_8callback_8callback_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_8callback_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_8callback_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_8callback_4args___get__(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":607
 * cdef public class callback [object PyGeventCallbackObject, type PyGeventCallback_Type]:
 *     cdef public object callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *
 *     def __init__(self, callback, args):
 */

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

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_8callback_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_8callback_4args_2__set__(((struct PyGeventCallbackObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_8callback_4args_2__set__(struct PyGeventCallbackObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_8callback_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_8callback_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_8callback_4args_4__del__(((struct PyGeventCallbackObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7watcher_1__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_7watcher_1__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7watcher___repr__(((struct PyGeventWatcherObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":676
 *     """Abstract base class for all the watchers"""
 *
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         if Py_ReprEnter(<PyObjectPtr>self) != 0:
 *             return "<...>"
 */

static PyObject *__pyx_pf_6gevent_4core_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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__repr__", 0);

/* "gevent/core.pyx":677
 *
 *     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/core.pyx":678
 *     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) && !defined(_WIN32))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
    __pyx_r = ((PyObject *)__pyx_kp_s_45);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_44));
    __pyx_r = ((PyObject *)__pyx_kp_s_44);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_53));
    __pyx_r = ((PyObject *)__pyx_kp_s_53);
#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))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
    __pyx_r = ((PyObject *)__pyx_kp_s_52);
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __Pyx_INCREF(((PyObject *)__pyx_kp_s_54));
    __pyx_r = ((PyObject *)__pyx_kp_s_54);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":679
 *         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/core.pyx":680
 *             return "<...>"
 *         try:
 *             format = self._format()             # <<<<<<<<<<<<<<
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.active:
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s___format); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 680; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_format = __pyx_t_3;
    __pyx_t_3 = 0;

/* "gevent/core.pyx":681
 *         try:
 *             format = self._format()
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)             # <<<<<<<<<<<<<<
 *             if self.active:
 *                 result += " active"
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s____class__); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s____name__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __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 = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_v_self));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
    __pyx_t_4 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_format);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_format);
    __Pyx_GIVEREF(__pyx_v_format);
    __pyx_t_2 = 0;
    __pyx_t_4 = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_46), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_45), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_53), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 681; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __pyx_v_result = ((PyObject *)__pyx_t_4);
    __pyx_t_4 = 0;

/* "gevent/core.pyx":682
 *             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 = 682; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __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 = 682; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

/* "gevent/core.pyx":683
 *             result = "<%s at 0x%x%s" % (self.__class__.__name__, id(self), format)
 *             if self.active:
 *                 result += " active"             # <<<<<<<<<<<<<<
 *             if self.pending:
 *                 result += " pending"
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_53)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_52)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_60)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 683; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":684
 *             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 = 684; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __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 = 684; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_1) {

/* "gevent/core.pyx":685
 *                 result += " active"
 *             if self.pending:
 *                 result += " pending"             # <<<<<<<<<<<<<<
 *             if self.callback is not None:
 *                 result += " callback=%r" % (self.callback, )
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_47)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_46)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_55)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_54)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;

/* "gevent/core.pyx":686
 *             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 = 686; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __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/core.pyx":687
 *                 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 = 687; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_4);
      __pyx_t_4 = 0;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_47), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_56), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_57), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_3);
      __pyx_t_3 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;

/* "gevent/core.pyx":688
 *             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_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__; goto __pyx_L5;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = (__pyx_t_3 != Py_None);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_5 != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":689
 *                 result += " callback=%r" % (self.callback, )
 *             if self.args is not None:
 *                 result += " args=%r" % (self.args, )             # <<<<<<<<<<<<<<
 *             return result + ">"
 *         finally:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__args); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
      __Pyx_GIVEREF(__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))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_48), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_57), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_56), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
      __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_58), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_result, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 689; __pyx_clineno = __LINE__; goto __pyx_L5;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_4);
      __pyx_t_4 = 0;
      goto __pyx_L10;
    }
    __pyx_L10:;

/* "gevent/core.pyx":690
 *             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) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_51)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_50)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_59)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L5;}
#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))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_58)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Add(__pyx_v_result, ((PyObject *)__pyx_kp_s_60)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 690; __pyx_clineno = __LINE__; goto __pyx_L5;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#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;
  }

/* "gevent/core.pyx":692
 *             return result + ">"
 *         finally:
 *             Py_ReprLeave(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 0; goto __pyx_L6;
    __pyx_L4: __pyx_exc_type = 0; __pyx_exc_value = 0; __pyx_exc_tb = 0; __pyx_exc_lineno = 0;
    __pyx_why = 3; goto __pyx_L6;
    __pyx_L5: {
      __pyx_why = 4;
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_ErrFetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L6;
    }
    __pyx_L6:;
    Py_ReprLeave(((PyObject*)__pyx_v_self));
    switch (__pyx_why) {
      case 3: goto __pyx_L0;
      case 4: {
        __Pyx_ErrRestore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1_error;
      }
    }
  }

  __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.core.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;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7watcher_3_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_7watcher_2_format(((struct PyGeventWatcherObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":694
 *             Py_ReprLeave(<PyObjectPtr>self)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ''
 *
 */

static PyObject *__pyx_pf_6gevent_4core_7watcher_2_format(CYTHON_UNUSED struct PyGeventWatcherObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_format", 0);

/* "gevent/core.pyx":695
 *
 *     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) && !defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_52));
  __pyx_r = ((PyObject *)__pyx_kp_s_52);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_51));
  __pyx_r = ((PyObject *)__pyx_kp_s_51);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_kp_s_45));
  __pyx_r = ((PyObject *)__pyx_kp_s_45);
#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_INCREF(((PyObject *)__pyx_kp_s_44));
  __pyx_r = ((PyObject *)__pyx_kp_s_44);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_3ref___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":709
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_2io_3ref___get__(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("__get__", 0);

/* "gevent/core.pyx":710
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_2io_3ref_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":712
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":714
 *         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/core.pyx":715
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_54), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_53), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_61), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_60), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __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 = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":716
 *             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 = 716; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":717
 *                 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/core.pyx":718
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":719
 *                 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/core.pyx":720
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":721
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":723
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":724
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":725
 *                 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/core.pyx":726
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":727
 *                 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/core.pyx":728
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_8callback___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":732
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_2io_8callback___get__(struct PyGeventIOObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":733
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_2io_8callback_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":735
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":736
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":737
 *         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 = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":738
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.io.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_2io_stop(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":740
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":742
 *     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/core.pyx":743
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_56), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_55), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_64), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __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 = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":744
 *         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/core.pyx":745
 *             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/core.pyx":746
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":747
 *             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/core.pyx":748
 *             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/core.pyx":749
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":750
 *         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/core.pyx":751
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":752
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_8priority___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":756
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":757
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.io.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.io.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_2io_8priority_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":759
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":760
 *
 *         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/core.pyx":761
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_58), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_57), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_64), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_66), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __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 = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":762
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 764; __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 = 764; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; __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 = 764; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.io.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_2io_2feed(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":764
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":766
 *     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/core.pyx":767
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_59), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_58), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_66), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_65), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_67), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __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 = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":768
 *         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 = 768; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":769
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":770
 *         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/core.pyx":771
 *         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/core.pyx":772
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":773
 *             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/core.pyx":774
 *             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/core.pyx":775
 *         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/core.pyx":776
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_60;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_59;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_67;
#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))
    values[1] = __pyx_k_66;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_68;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    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 = 778; __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 = 778; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_2io_4start(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_pass_events, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":778
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args, pass_events=False):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":780
 *     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/core.pyx":781
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_61), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_60), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_68), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_67), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_69), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __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 = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":782
 *         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/core.pyx":783
 *             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) && !defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_63), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_62), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_70), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_69), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_71), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __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 = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":784
 *         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 = 784; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":785
 *             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 = 785; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

/* "gevent/core.pyx":786
 *         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 = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(GEVENT_CORE_EVENTS);
    PyTuple_SET_ITEM(__pyx_t_2, 0, GEVENT_CORE_EVENTS);
    __Pyx_GIVEREF(GEVENT_CORE_EVENTS);
    __pyx_t_4 = PyNumber_Add(((PyObject *)__pyx_t_2), ((PyObject *)__pyx_v_args)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
    __pyx_v_self->args = ((PyObject*)__pyx_t_4);
    __pyx_t_4 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

/* "gevent/core.pyx":788
 *             self.args = (GEVENT_CORE_EVENTS, ) + args
 *         else:
 *             self.args = args             # <<<<<<<<<<<<<<
 *         if self._flags & 6 == 4:
 *             libev.ev_unref(self.loop._ptr)
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_args));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
    __Pyx_GOTREF(__pyx_v_self->args);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
    __pyx_v_self->args = __pyx_v_args;
  }
  __pyx_L5:;

/* "gevent/core.pyx":789
 *         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/core.pyx":790
 *             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/core.pyx":791
 *         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);
    goto __pyx_L6;
  }
  __pyx_L6:;

/* "gevent/core.pyx":792
 *             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/core.pyx":793
 *             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/core.pyx":794
 *         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/core.pyx":795
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L7;
  }
  __pyx_L7:;

  __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.core.io.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_6active___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":799
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_2io_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":800
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_7pending___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":805
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_2io_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":806
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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,&__pyx_n_s__ref,&__pyx_n_s__priority,0};
    PyObject* values[5] = {0,0,0,0,0};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_64;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[3] = __pyx_k_71;
#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))
    values[3] = __pyx_k_72;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))

/* "gevent/core.pyx":826
 *
 *
 *     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))
    values[3] = __pyx_k_63;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[3] = __pyx_k_70;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))

/* "gevent/core.pyx":810
 *
 *
 *     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)
    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 = 826; __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 = 810; __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)) != 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 = 826; __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 = 810; __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 = 826; __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 = 810; __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_AsInt(values[1]); if (unlikely((__pyx_v_fd == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_events = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __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_from_py_vfd_socket_t(values[1]); if (unlikely((__pyx_v_fd == (vfd_socket_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_events = __Pyx_PyInt_AsInt(values[2]); if (unlikely((__pyx_v_events == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __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 = 826; __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 = 810; __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.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __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_4core_2io_6__init__(((struct PyGeventIOObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_fd, __pyx_v_events, __pyx_v_ref, __pyx_v_priority);
  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_4core_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_4core_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/core.pyx":827
 *
 *     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/core.pyx":811
 *
 *     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/core.pyx":828
 *     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 = PyInt_FromLong(__pyx_v_fd); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __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/core.pyx":812
 *     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 = PyInt_FromLong(__pyx_v_events); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __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))
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_65), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_64), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_72), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_71), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_73), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_72), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __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(((PyObject *)__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 = 828; __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 = 812; __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);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __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(((PyObject *)__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 = 828; __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_filename = __pyx_f[0]; __pyx_lineno = 812; __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)
    goto __pyx_L3;
  }
  __pyx_L3:;

#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/core.pyx":829
 *         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/core.pyx":830
 *             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 = PyInt_FromLong(__pyx_v_events); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
#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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_66), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_73), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_74), __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __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(((PyObject *)__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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__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 = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":831
 *         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/core.pyx":832
 *             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))
/* "gevent/core.pyx":813
 *         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 = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_vfd = __pyx_t_4;

/* "gevent/core.pyx":814
 *             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/core.pyx":815
 *         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/core.pyx":816
 *         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/core.pyx":833
 *         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 = 833; __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/core.pyx":817
 *         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 = 817; __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/core.pyx":834
 *         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/core.pyx":818
 *         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))
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":820
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":821
 *         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_5 = (__pyx_t_1 != 0);
  if (__pyx_t_5) {

/* "gevent/core.pyx":822
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_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)
    goto __pyx_L5;
  }
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  /*else*/ {

/* "gevent/core.pyx":836
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_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_L5:;
#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/core.pyx":837
 *         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/core.pyx":838
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_5);
    goto __pyx_L6;
  }
  __pyx_L6:;
#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 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.core.io.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_2fd_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_2fd_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_2fd___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":844
 *     property fd:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.vfd_get(self._watcher.fd)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":845
 *
 *         def __get__(self):
 *             return libev.vfd_get(self._watcher.fd)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, long fd):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(vfd_get(__pyx_v_self->_watcher.fd)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 845; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.io.fd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_2fd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_fd); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsLong(__pyx_arg_fd); if (unlikely((__pyx_v_fd == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_2io_2fd_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((long)__pyx_v_fd));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":847
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":848
 *
 *         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/core.pyx":849
 *         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) && !defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_68), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_66), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_74), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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 = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":850
 *             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 = 850; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_vfd = __pyx_t_3;

/* "gevent/core.pyx":851
 *                 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/core.pyx":852
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.fd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_6events_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_6events_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_6events___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":856
 *     property events:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.events
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":857
 *
 *         def __get__(self):
 *             return self._watcher.events             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int events):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_watcher.events); 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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.io.events.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_6events_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_events); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_events); if (unlikely((__pyx_v_events == (int)-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.core.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_2io_6events_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((int)__pyx_v_events));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":859
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":860
 *
 *         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/core.pyx":861
 *         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) && !defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_70), 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) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_68), 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) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_77), 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) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_75), 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) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_78), 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) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_76), 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) && 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 = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":862
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.io.events.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_10events_str_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_2io_10events_str___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":866
 *     property events_str:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return _events_to_str(self._watcher.events)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":867
 *
 *         def __get__(self):
 *             return _events_to_str(self._watcher.events)             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6gevent_4core__events_to_str(__pyx_v_self->_watcher.events, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 867; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.io.events_str.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_2io_8_format(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":869
 *             return _events_to_str(self._watcher.events)
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ' fd=%s events=%s' % (self.fd, self.events_str)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":870
 *
 *     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 = 870; __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 = 870; __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 = 870; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __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))
  __pyx_t_2 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_71), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_69), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_78), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_76), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_79), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_77), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 870; __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(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("gevent.core.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))
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_11__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_2io_10__cinit__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":874
 *
 *
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         self._watcher.fd = -1;
 *
 */

static int __pyx_pf_6gevent_4core_2io_10__cinit__(struct PyGeventIOObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

/* "gevent/core.pyx":875
 *
 *     def __cinit__(self):
 *         self._watcher.fd = -1;             # <<<<<<<<<<<<<<
 *
 *     def __dealloc__(self):
 */
  __pyx_v_self->_watcher.fd = -1;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static void __pyx_pw_6gevent_4core_2io_13__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_6gevent_4core_2io_13__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_6gevent_4core_2io_12__dealloc__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
}

/* "gevent/core.pyx":877
 *         self._watcher.fd = -1;
 *
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         libev.vfd_free(self._watcher.fd)
 *
 */

static void __pyx_pf_6gevent_4core_2io_12__dealloc__(struct PyGeventIOObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

/* "gevent/core.pyx":878
 *
 *     def __dealloc__(self):
 *         libev.vfd_free(self._watcher.fd)             # <<<<<<<<<<<<<<
 *
 *
 */
  vfd_free(__pyx_v_self->_watcher.fd);

  __Pyx_RefNannyFinishContext();
#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_4core_2io_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_4loop___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":701
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_2io_4loop_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_2io_4loop_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_2io_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_2io_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_4loop_4__del__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_2io_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_4args___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":703
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_io _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_2io_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_2io_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_2io_4args_2__set__(((struct PyGeventIOObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_2io_4args_2__set__(struct PyGeventIOObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_2io_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_2io_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_2io_4args_4__del__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_2io_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_2io_6_flags___get__(((struct PyGeventIOObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":704
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_io _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 704; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.io._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5timer_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_3ref___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":894
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5timer_3ref___get__(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("__get__", 0);

/* "gevent/core.pyx":895
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 895; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5timer_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5timer_3ref_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":897
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":899
 *         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/core.pyx":900
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_72), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_70), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_79), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_77), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_78), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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 = 900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":901
 *             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 = 901; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":902
 *                 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/core.pyx":903
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":904
 *                 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/core.pyx":905
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":906
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":908
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":909
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":910
 *                 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/core.pyx":911
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":912
 *                 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/core.pyx":913
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5timer_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_8callback___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":917
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5timer_8callback___get__(struct PyGeventTimerObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":918
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5timer_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5timer_8callback_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":920
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":921
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":922
 *         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 = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 922; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":923
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.timer.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5timer_stop(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":925
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":927
 *     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/core.pyx":928
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_71), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_78), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_81), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_79), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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 = 928; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":929
 *         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/core.pyx":930
 *             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/core.pyx":931
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":932
 *             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/core.pyx":933
 *             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/core.pyx":934
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":935
 *         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/core.pyx":936
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":937
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5timer_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_8priority___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":941
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":942
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.timer.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5timer_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 944; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.timer.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5timer_8priority_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":944
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":945
 *
 *         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/core.pyx":946
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_74), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_72), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_81), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_79), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_82), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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 = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":947
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 949; __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 = 949; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 949; __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 = 949; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.timer.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5timer_2feed(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":949
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":951
 *     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/core.pyx":952
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_82), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_81), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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 = 952; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":953
 *         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 = 953; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":954
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":955
 *         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/core.pyx":956
 *         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/core.pyx":957
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":958
 *             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/core.pyx":959
 *             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/core.pyx":960
 *         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/core.pyx":961
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_76;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_74;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_83;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_81;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_84;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_82;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    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 = 963; __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 = 963; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5timer_4start(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":963
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":965
 *     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/core.pyx":966
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_77), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_82), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_85), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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 = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":967
 *         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/core.pyx":968
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_78), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_85), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_86), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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 = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":969
 *         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 = 969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":970
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":971
 *         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/core.pyx":972
 *         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/core.pyx":973
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":974
 *             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 = 974; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

/* "gevent/core.pyx":975
 *             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);
    goto __pyx_L6;
  }
  __pyx_L6:;

/* "gevent/core.pyx":976
 *         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/core.pyx":977
 *             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/core.pyx":978
 *         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/core.pyx":979
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L7;
  }
  __pyx_L7:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5timer_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_6active___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":983
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5timer_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":984
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 984; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5timer_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_7pending___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":989
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5timer_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":990
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5timer_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_79;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[3] = __pyx_k_77;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_86;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[3] = __pyx_k_84;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_87;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[3] = __pyx_k_85;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/core.pyx":992
 *             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)
 */
    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 = 992; __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 = 992; __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 = 992; __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 = 992; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_5timer_6__init__(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_after, __pyx_v_repeat, __pyx_v_ref, __pyx_v_priority);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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/core.pyx":993
 *
 *     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/core.pyx":994
 *     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 = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_80), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_78), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_87), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_85), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_88), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __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_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_86), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __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(((PyObject *)__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 = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_3));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
    __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__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 = 994; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":995
 *         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/core.pyx":996
 *             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/core.pyx":997
 *         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 = 997; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":998
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1000
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1001
 *         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/core.pyx":1002
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     property at:
 */
    __pyx_t_5 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_5);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("gevent.core.timer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_2at_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5timer_2at_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_2at___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1006
 *     property at:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.at
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1007
 *
 *         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 = 1007; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.timer.at.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_9again(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_81;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_79;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_88;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_86;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_89;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_87;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
    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 = 1011; __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 = 1011; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5timer_8again(((struct PyGeventTimerObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_update, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1011
 *     # QQQ: add 'after' and 'repeat' properties?
 *
 *     def again(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1013
 *     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/core.pyx":1014
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_82), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_80), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_89), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_87), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_88), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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 = 1014; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1015
 *         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 = 1015; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1016
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1017
 *         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/core.pyx":1018
 *         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/core.pyx":1019
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1020
 *             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 = 1020; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1021
 *             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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1022
 *         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/core.pyx":1023
 *             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/core.pyx":1024
 *         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/core.pyx":1025
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.timer.again", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5timer_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_4loop___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":886
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5timer_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5timer_4loop_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_5timer_4loop_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_5timer_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_5timer_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_4loop_4__del__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5timer_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_4args___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":888
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_timer _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_5timer_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5timer_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5timer_4args_2__set__(((struct PyGeventTimerObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_5timer_4args_2__set__(struct PyGeventTimerObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_5timer_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_5timer_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5timer_4args_4__del__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5timer_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5timer_6_flags___get__(((struct PyGeventTimerObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":889
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_timer _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.timer._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_6signal_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_3ref___get__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1039
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_6signal_3ref___get__(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("__get__", 0);

/* "gevent/core.pyx":1040
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1040; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.signal.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_6signal_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_6signal_3ref_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1042
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1044
 *         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/core.pyx":1045
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_81), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_88), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_89), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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 = 1045; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1046
 *             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 = 1046; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1047
 *                 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/core.pyx":1048
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":1049
 *                 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/core.pyx":1050
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":1051
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1053
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":1054
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":1055
 *                 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/core.pyx":1056
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":1057
 *                 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/core.pyx":1058
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.signal.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_6signal_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_8callback___get__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1062
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_6signal_8callback___get__(struct PyGeventSignalObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":1063
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_6signal_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_6signal_8callback_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1065
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1066
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":1067
 *         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 = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1068
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.signal.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_6signal_stop(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1070
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1072
 *     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/core.pyx":1073
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_82), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_89), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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 = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1074
 *         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/core.pyx":1075
 *             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/core.pyx":1076
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1077
 *             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/core.pyx":1078
 *             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/core.pyx":1079
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":1080
 *         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/core.pyx":1081
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":1082
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.signal.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_6signal_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_8priority___get__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1086
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1087
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.signal.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_6signal_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.signal.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_6signal_8priority_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1089
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1090
 *
 *         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/core.pyx":1091
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_85), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_83), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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 = 1091; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1092
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.signal.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1094; __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 = 1094; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __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 = 1094; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.signal.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_6signal_2feed(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1094
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1096
 *     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/core.pyx":1097
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_86), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_84), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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 = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1098
 *         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 = 1098; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1099
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1100
 *         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/core.pyx":1101
 *         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/core.pyx":1102
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1103
 *             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/core.pyx":1104
 *             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/core.pyx":1105
 *         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/core.pyx":1106
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.signal.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1108; __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 = 1108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.signal.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_6signal_4start(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1108
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1110
 *     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/core.pyx":1111
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_87), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_85), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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 = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1112
 *         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/core.pyx":1113
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_88), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_86), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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 = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1114
 *         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 = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1115
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1116
 *         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/core.pyx":1117
 *         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/core.pyx":1118
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1119
 *             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/core.pyx":1120
 *             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/core.pyx":1121
 *         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/core.pyx":1122
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.signal.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_6signal_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_6active___get__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1126
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_6signal_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":1127
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.signal.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_6signal_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_7pending___get__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1132
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_6signal_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":1133
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.signal.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_6signal_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[2] = __pyx_k_89;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[2] = __pyx_k_87;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[2] = __pyx_k_96;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[2] = __pyx_k_94;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[2] = __pyx_k_97;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[2] = __pyx_k_95;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/core.pyx":1135
 *             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)
 */
    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 = 1135; __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 = 1135; __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_AsInt(values[1]); if (unlikely((__pyx_v_signalnum == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __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 = 1135; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_6signal_6__init__(((struct PyGeventSignalObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_signalnum, __pyx_v_ref, __pyx_v_priority);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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;
  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_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/core.pyx":1136
 *
 *     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_1 = (__pyx_v_signalnum < 1);
  if (!__pyx_t_1) {
    __pyx_t_2 = PyInt_FromLong(__pyx_v_signalnum); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__signalmodule); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__NSIG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_4, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __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_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_1;
  }
  if (__pyx_t_6) {

/* "gevent/core.pyx":1137
 *     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_3 = PyInt_FromLong(__pyx_v_signalnum); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_90), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_88), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_97), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_95), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_98), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_96), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __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(((PyObject *)__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 = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__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 = 1137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1143
 *         # 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/core.pyx":1144
 *         #    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/core.pyx":1145
 *         libev.ev_signal_init(&self._watcher, <void *>gevent_callback_signal, signalnum)
 *         self.loop = loop
 *         if ref:             # <<<<<<<<<<<<<<
 *             self._flags = 0
 *         else:
 */
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_ref); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_6) {

/* "gevent/core.pyx":1146
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1148
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1149
 *         else:
 *             self._flags = 4
 *         if priority is not None:             # <<<<<<<<<<<<<<
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 */
  __pyx_t_6 = (__pyx_v_priority != Py_None);
  __pyx_t_1 = (__pyx_t_6 != 0);
  if (__pyx_t_1) {

/* "gevent/core.pyx":1150
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_7);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("gevent.core.signal.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_6signal_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_4loop___get__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1031
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_6signal_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_6signal_4loop_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_6signal_4loop_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_6signal_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_6signal_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_4loop_4__del__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_6signal_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_4args___get__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1033
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_signal _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_6signal_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_6signal_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_6signal_4args_2__set__(((struct PyGeventSignalObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_6signal_4args_2__set__(struct PyGeventSignalObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1033; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_6signal_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_6signal_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_6signal_4args_4__del__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_6signal_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_6signal_6_flags___get__(((struct PyGeventSignalObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1034
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_signal _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1034; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.signal._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4idle_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_3ref___get__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1164
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4idle_3ref___get__(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("__get__", 0);

/* "gevent/core.pyx":1165
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.idle.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4idle_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4idle_3ref_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1167
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1169
 *         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/core.pyx":1170
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_89), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_97), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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 = 1170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1171
 *             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 = 1171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1172
 *                 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/core.pyx":1173
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":1174
 *                 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/core.pyx":1175
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":1176
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1178
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":1179
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":1180
 *                 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/core.pyx":1181
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":1182
 *                 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/core.pyx":1183
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.idle.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4idle_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_8callback___get__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1187
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4idle_8callback___get__(struct PyGeventIdleObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":1188
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4idle_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4idle_8callback_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1190
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1191
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":1192
 *         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 = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1193
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.idle.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4idle_stop(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1195
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1197
 *     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/core.pyx":1198
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_90), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_97), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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 = 1198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1199
 *         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/core.pyx":1200
 *             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/core.pyx":1201
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1202
 *             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/core.pyx":1203
 *             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/core.pyx":1204
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":1205
 *         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/core.pyx":1206
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":1207
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.idle.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4idle_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_8priority___get__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1211
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1212
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.idle.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4idle_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.idle.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4idle_8priority_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1214
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1215
 *
 *         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/core.pyx":1216
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_91), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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 = 1216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1217
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.idle.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1219; __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 = 1219; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1219; __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 = 1219; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.idle.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4idle_2feed(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1219
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1221
 *     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/core.pyx":1222
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_92), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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 = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1223
 *         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 = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1224
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1225
 *         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/core.pyx":1226
 *         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/core.pyx":1227
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1228
 *             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/core.pyx":1229
 *             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/core.pyx":1230
 *         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/core.pyx":1231
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.idle.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1233; __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 = 1233; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.idle.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4idle_4start(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1233
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1235
 *     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/core.pyx":1236
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_95), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_93), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_103), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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 = 1236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1237
 *         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/core.pyx":1238
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_94), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_103), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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 = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1239
 *         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 = 1239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1240
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1241
 *         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/core.pyx":1242
 *         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/core.pyx":1243
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1244
 *             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/core.pyx":1245
 *             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/core.pyx":1246
 *         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/core.pyx":1247
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.idle.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4idle_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_6active___get__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1251
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4idle_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":1252
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.idle.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4idle_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_7pending___get__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1257
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4idle_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":1258
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.idle.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4idle_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_97;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_95;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_104;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_102;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_105;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_103;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/core.pyx":1261
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle )
 *         self.loop = loop
 */
    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 = 1261; __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 = 1261; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_4idle_6__init__(((struct PyGeventIdleObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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/core.pyx":1262
 *
 *     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/core.pyx":1263
 *     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/core.pyx":1264
 *         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 = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1265
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L3;
  }
  /*else*/ {

/* "gevent/core.pyx":1267
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1268
 *         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/core.pyx":1269
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1269; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.idle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4idle_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_4loop___get__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1156
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4idle_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4idle_4loop_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_4idle_4loop_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_4idle_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_4idle_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_4loop_4__del__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4idle_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_4args___get__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1158
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_idle _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_4idle_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4idle_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4idle_4args_2__set__(((struct PyGeventIdleObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_4idle_4args_2__set__(struct PyGeventIdleObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_4idle_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_4idle_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4idle_4args_4__del__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4idle_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4idle_6_flags___get__(((struct PyGeventIdleObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1159
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_idle _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.idle._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_7prepare_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_3ref___get__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1283
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_7prepare_3ref___get__(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("__get__", 0);

/* "gevent/core.pyx":1284
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.prepare.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_7prepare_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_7prepare_3ref_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1286
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1288
 *         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/core.pyx":1289
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_96), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_105), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_103), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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 = 1289; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1290
 *             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 = 1290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1291
 *                 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/core.pyx":1292
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":1293
 *                 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/core.pyx":1294
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":1295
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1297
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":1298
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":1299
 *                 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/core.pyx":1300
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":1301
 *                 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/core.pyx":1302
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.prepare.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_7prepare_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_8callback___get__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1306
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_7prepare_8callback___get__(struct PyGeventPrepareObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":1307
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_7prepare_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_7prepare_8callback_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1309
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1310
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":1311
 *         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 = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1312
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.prepare.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_7prepare_stop(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1314
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1316
 *     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/core.pyx":1317
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_97), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_105), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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 = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1318
 *         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/core.pyx":1319
 *             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/core.pyx":1320
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1321
 *             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/core.pyx":1322
 *             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/core.pyx":1323
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":1324
 *         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/core.pyx":1325
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":1326
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.prepare.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_7prepare_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_8priority___get__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1330
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1331
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.prepare.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_7prepare_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.prepare.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_8priority_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1333
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1334
 *
 *         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/core.pyx":1335
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_98), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_105), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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 = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1336
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.prepare.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1338; __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 = 1338; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __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 = 1338; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.prepare.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_2feed(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1338
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1340
 *     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/core.pyx":1341
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_99), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_109), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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 = 1341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1342
 *         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 = 1342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1343
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1344
 *         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/core.pyx":1345
 *         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/core.pyx":1346
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1347
 *             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/core.pyx":1348
 *             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/core.pyx":1349
 *         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/core.pyx":1350
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.prepare.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1352; __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 = 1352; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.prepare.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_4start(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1352
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1354
 *     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/core.pyx":1355
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_102), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_100), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_109), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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 = 1355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1356
 *         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/core.pyx":1357
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_103), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_101), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_109), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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 = 1357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1358
 *         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 = 1358; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1359
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1360
 *         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/core.pyx":1361
 *         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/core.pyx":1362
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1363
 *             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/core.pyx":1364
 *             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/core.pyx":1365
 *         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/core.pyx":1366
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.prepare.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_7prepare_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_6active___get__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1370
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_7prepare_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":1371
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1371; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.prepare.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_7prepare_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_7pending___get__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1376
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_7prepare_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":1377
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.prepare.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_7prepare_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_104;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_102;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_111;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_109;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_112;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_110;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/core.pyx":1380
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare )
 *         self.loop = loop
 */
    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 = 1380; __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 = 1380; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_6__init__(((struct PyGeventPrepareObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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/core.pyx":1381
 *
 *     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/core.pyx":1382
 *     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/core.pyx":1383
 *         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 = 1383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1384
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L3;
  }
  /*else*/ {

/* "gevent/core.pyx":1386
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1387
 *         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/core.pyx":1388
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.prepare.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_7prepare_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_4loop___get__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1275
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_7prepare_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_7prepare_4loop_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_7prepare_4loop_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_7prepare_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_7prepare_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_4loop_4__del__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_7prepare_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_4args___get__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1277
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_prepare _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_7prepare_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_7prepare_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_7prepare_4args_2__set__(((struct PyGeventPrepareObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_7prepare_4args_2__set__(struct PyGeventPrepareObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_7prepare_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_7prepare_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_7prepare_4args_4__del__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_7prepare_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_7prepare_6_flags___get__(((struct PyGeventPrepareObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1278
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_prepare _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.prepare._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5check_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_3ref___get__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1402
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5check_3ref___get__(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("__get__", 0);

/* "gevent/core.pyx":1403
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.check.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5check_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5check_3ref_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1405
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1407
 *         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/core.pyx":1408
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_105), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_103), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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 = 1408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1409
 *             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 = 1409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1410
 *                 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/core.pyx":1411
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":1412
 *                 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/core.pyx":1413
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":1414
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1416
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":1417
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":1418
 *                 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/core.pyx":1419
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":1420
 *                 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/core.pyx":1421
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.check.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5check_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_8callback___get__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1425
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5check_8callback___get__(struct PyGeventCheckObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":1426
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5check_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5check_8callback_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1428
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1429
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":1430
 *         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 = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 1430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1431
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.check.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5check_stop(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1433
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1435
 *     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/core.pyx":1436
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_104), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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 = 1436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1437
 *         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/core.pyx":1438
 *             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/core.pyx":1439
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1440
 *             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/core.pyx":1441
 *             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/core.pyx":1442
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":1443
 *         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/core.pyx":1444
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":1445
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.check.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5check_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_8priority___get__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1449
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1450
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1450; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.check.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5check_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.check.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5check_8priority_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1452
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1453
 *
 *         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/core.pyx":1454
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_105), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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 = 1454; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1455
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.check.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1457; __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 = 1457; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; __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 = 1457; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.check.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5check_2feed(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1457
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1459
 *     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/core.pyx":1460
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_106), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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 = 1460; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1461
 *         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 = 1461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1462
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1463
 *         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/core.pyx":1464
 *         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/core.pyx":1465
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1466
 *             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/core.pyx":1467
 *             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/core.pyx":1468
 *         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/core.pyx":1469
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.check.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1471; __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 = 1471; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.check.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5check_4start(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1471
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1473
 *     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/core.pyx":1474
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_109), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_107), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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 = 1474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1475
 *         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/core.pyx":1476
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_108), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_118), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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 = 1476; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1477
 *         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 = 1477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1478
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1479
 *         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/core.pyx":1480
 *         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/core.pyx":1481
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1482
 *             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/core.pyx":1483
 *             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/core.pyx":1484
 *         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/core.pyx":1485
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.check.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5check_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_6active___get__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1489
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5check_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":1490
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.check.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5check_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_7pending___get__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1495
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5check_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":1496
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1496; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.check.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5check_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_111;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_109;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_118;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_116;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_119;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_117;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/core.pyx":1499
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_check_init(&self._watcher, <void *>gevent_callback_check )
 *         self.loop = loop
 */
    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 = 1499; __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 = 1499; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_5check_6__init__(((struct PyGeventCheckObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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/core.pyx":1500
 *
 *     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/core.pyx":1501
 *     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/core.pyx":1502
 *         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 = 1502; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1503
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L3;
  }
  /*else*/ {

/* "gevent/core.pyx":1505
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1506
 *         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/core.pyx":1507
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.check.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5check_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_4loop___get__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1394
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5check_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5check_4loop_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_5check_4loop_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_5check_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_5check_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_4loop_4__del__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5check_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_4args___get__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1396
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_check _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_5check_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5check_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5check_4args_2__set__(((struct PyGeventCheckObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_5check_4args_2__set__(struct PyGeventCheckObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_5check_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_5check_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5check_4args_4__del__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5check_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5check_6_flags___get__(((struct PyGeventCheckObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1397
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_check _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.check._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4fork_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_3ref___get__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1521
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4fork_3ref___get__(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("__get__", 0);

/* "gevent/core.pyx":1522
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1522; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.fork.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4fork_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4fork_3ref_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1524
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1526
 *         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/core.pyx":1527
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_110), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_119), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_118), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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 = 1527; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1528
 *             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 = 1528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1529
 *                 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/core.pyx":1530
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":1531
 *                 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/core.pyx":1532
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":1533
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1535
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":1536
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":1537
 *                 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/core.pyx":1538
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":1539
 *                 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/core.pyx":1540
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.fork.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4fork_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_8callback___get__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1544
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4fork_8callback___get__(struct PyGeventForkObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":1545
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4fork_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4fork_8callback_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1547
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1548
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":1549
 *         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 = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 1549; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1550
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.fork.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4fork_stop(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1552
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1554
 *     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/core.pyx":1555
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_111), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_118), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_121), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_119), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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 = 1555; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1556
 *         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/core.pyx":1557
 *             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/core.pyx":1558
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1559
 *             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/core.pyx":1560
 *             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/core.pyx":1561
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":1562
 *         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/core.pyx":1563
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":1564
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.fork.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4fork_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_8priority___get__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1568
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1569
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1569; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.fork.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4fork_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.fork.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4fork_8priority_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1571
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1572
 *
 *         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/core.pyx":1573
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_112), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_121), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_119), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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 = 1573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1574
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.fork.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1576; __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 = 1576; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1576; __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 = 1576; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.fork.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4fork_2feed(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1576
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1578
 *     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/core.pyx":1579
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_113), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_123), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_121), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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 = 1579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1580
 *         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 = 1580; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1581
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1582
 *         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/core.pyx":1583
 *         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/core.pyx":1584
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1585
 *             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/core.pyx":1586
 *             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/core.pyx":1587
 *         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/core.pyx":1588
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.fork.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1590; __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 = 1590; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.fork.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4fork_4start(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1590
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1592
 *     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/core.pyx":1593
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_116), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_114), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_123), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_121), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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 = 1593; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1594
 *         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/core.pyx":1595
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_115), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_123), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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 = 1595; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1596
 *         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 = 1596; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1597
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1598
 *         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/core.pyx":1599
 *         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/core.pyx":1600
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1601
 *             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/core.pyx":1602
 *             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/core.pyx":1603
 *         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/core.pyx":1604
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.fork.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4fork_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_6active___get__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1608
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4fork_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":1609
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.fork.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4fork_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_7pending___get__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1614
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4fork_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":1615
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.fork.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4fork_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_118;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_116;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_125;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_123;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_126;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_124;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/core.pyx":1618
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork )
 *         self.loop = loop
 */
    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 = 1618; __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 = 1618; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_4fork_6__init__(((struct PyGeventForkObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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/core.pyx":1619
 *
 *     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/core.pyx":1620
 *     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/core.pyx":1621
 *         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 = 1621; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1622
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L3;
  }
  /*else*/ {

/* "gevent/core.pyx":1624
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1625
 *         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/core.pyx":1626
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1626; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.fork.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4fork_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_4loop___get__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1513
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4fork_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4fork_4loop_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_4fork_4loop_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_4fork_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_4fork_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_4loop_4__del__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4fork_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_4args___get__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1515
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_fork _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_4fork_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4fork_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4fork_4args_2__set__(((struct PyGeventForkObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_4fork_4args_2__set__(struct PyGeventForkObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_4fork_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_4fork_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4fork_4args_4__del__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4fork_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4fork_6_flags___get__(((struct PyGeventForkObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1516
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_fork _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.fork._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5async_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_3ref___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1640
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5async_3ref___get__(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("__get__", 0);

/* "gevent/core.pyx":1641
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1641; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5async_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5async_3ref_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1643
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1645
 *         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/core.pyx":1646
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_119), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_117), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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 = 1646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1647
 *             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 = 1647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1648
 *                 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/core.pyx":1649
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":1650
 *                 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/core.pyx":1651
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":1652
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1654
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":1655
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":1656
 *                 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/core.pyx":1657
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":1658
 *                 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/core.pyx":1659
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5async_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_8callback___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1663
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5async_8callback___get__(struct PyGeventAsyncObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":1664
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5async_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5async_8callback_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1666
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1667
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":1668
 *         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 = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 1668; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1669
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.async.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5async_stop(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1671
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1673
 *     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/core.pyx":1674
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_118), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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 = 1674; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1675
 *         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/core.pyx":1676
 *             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/core.pyx":1677
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1678
 *             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/core.pyx":1679
 *             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/core.pyx":1680
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":1681
 *         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/core.pyx":1682
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":1683
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5async_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_8priority___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1687
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1688
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1688; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.async.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5async_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.async.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5async_8priority_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1690
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1691
 *
 *         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/core.pyx":1692
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_121), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_119), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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 = 1692; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1693
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1695; __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 = 1695; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; __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 = 1695; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.async.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5async_2feed(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1695
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1697
 *     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/core.pyx":1698
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_120), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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 = 1698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1699
 *         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 = 1699; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1700
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1701
 *         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/core.pyx":1702
 *         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/core.pyx":1703
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1704
 *             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/core.pyx":1705
 *             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/core.pyx":1706
 *         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/core.pyx":1707
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1709; __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 = 1709; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.async.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5async_4start(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1709
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1711
 *     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/core.pyx":1712
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_123), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_121), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_131), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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 = 1712; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1713
 *         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/core.pyx":1714
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_122), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_131), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_132), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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 = 1714; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1715
 *         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 = 1715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1716
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1717
 *         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/core.pyx":1718
 *         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/core.pyx":1719
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1720
 *             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/core.pyx":1721
 *             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/core.pyx":1722
 *         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/core.pyx":1723
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5async_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_6active___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1727
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5async_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":1728
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5async_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_7pending___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1732
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_async_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5async_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":1733
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5async_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_125;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_123;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_132;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_130;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[1] = __pyx_k_133;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[1] = __pyx_k_131;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/core.pyx":1736
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )
 *         self.loop = loop
 */
    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 = 1736; __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 = 1736; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_5async_6__init__(((struct PyGeventAsyncObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_ref, __pyx_v_priority);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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/core.pyx":1737
 *
 *     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/core.pyx":1738
 *     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/core.pyx":1739
 *         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 = 1739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1740
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L3;
  }
  /*else*/ {

/* "gevent/core.pyx":1742
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1743
 *         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/core.pyx":1744
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     def send(self):
 */
    __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_3);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.async.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_9send(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5async_8send(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1746
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def send(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1748
 *     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/core.pyx":1749
 *
 *         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) && !defined(_WIN32))
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_124), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_133), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_131), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_134), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_132), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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 = 1749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1750
 *         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));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.async.send", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5async_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_4loop___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1632
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5async_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5async_4loop_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_5async_4loop_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_5async_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_5async_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_4loop_4__del__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5async_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_4args___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1634
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_async _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_5async_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5async_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5async_4args_2__set__(((struct PyGeventAsyncObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_5async_4args_2__set__(struct PyGeventAsyncObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1634; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_5async_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_5async_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5async_4args_4__del__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5async_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5async_6_flags___get__(((struct PyGeventAsyncObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1635
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_async _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1635; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.async._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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_4core_5child_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_3ref_1__get__(PyObject *__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))
static PyObject *__pyx_pw_6gevent_4core_4stat_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_3ref_1__get__(PyObject *__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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (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_4core_5child_3ref___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1766
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5child_3ref___get__(struct PyGeventChildObject *__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_4core_4stat_3ref___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1911
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4stat_3ref___get__(struct PyGeventStatObject *__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_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)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
/* "gevent/core.pyx":1767
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object value):
 */
#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/core.pyx":1912
 *
 *         def __get__(self):
 *             return False if self._flags & 4 else True             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object 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)
  __Pyx_XDECREF(__pyx_r);
  if (((__pyx_v_self->_flags & 4) != 0)) {
    __pyx_t_1 = 0;
  } else {
    __pyx_t_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_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1767; __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_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __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_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__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_AddTraceback("gevent.core.child.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
#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_AddTraceback("gevent.core.stat.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
#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 = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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 int __pyx_pw_6gevent_4core_5child_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_5child_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
#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_pw_6gevent_4core_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_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)
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (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_4core_5child_3ref_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1769
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_5child_3ref_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) {
#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_4core_4stat_3ref_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1914
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_4stat_3ref_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_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)
  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);

#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/core.pyx":1771
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if value:
 */
#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/core.pyx":1916
 *         def __set__(self, object value):
 *
 *             if not self.loop._ptr:             # <<<<<<<<<<<<<<
 *                 raise ValueError('operation on destroyed loop')
 *             if 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)
  __pyx_t_1 = ((!(__pyx_v_self->loop->_ptr != 0)) != 0);
  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/core.pyx":1772
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __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))
/* "gevent/core.pyx":1917
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_125), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_134), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_132), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_135), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_133), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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;
#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 = 1772; __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_filename = __pyx_f[0]; __pyx_lineno = 1917; __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)
    goto __pyx_L3;
  }
  __pyx_L3:;

#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/core.pyx":1773
 *             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 = 1773; __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/core.pyx":1918
 *             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 = 1918; __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/core.pyx":1774
 *                 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
 */
#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/core.pyx":1919
 *                 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
 */
#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_self->_flags & 4) != 0)) != 0);
    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/core.pyx":1775
 *             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)
 */
#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/core.pyx":1920
 *             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)
 */
#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 = 0;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;

#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/core.pyx":1776
 *                 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
 */
#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/core.pyx":1921
 *                 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
 */
#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_self->_flags & 2) != 0);
    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/core.pyx":1777
 *                     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:
 */
#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/core.pyx":1922
 *                     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:
 */
#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_ref(__pyx_v_self->loop->_ptr);
      goto __pyx_L6;
    }
    __pyx_L6:;

#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/core.pyx":1778
 *                 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:
 */
#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/core.pyx":1923
 *                 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:
 */
#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 = (__pyx_v_self->_flags & (~6));
    goto __pyx_L4;
  }
  /*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))
/* "gevent/core.pyx":1780
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 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/core.pyx":1925
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 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_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    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/core.pyx":1781
 *             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):
 */
#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/core.pyx":1926
 *             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):
 */
#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 = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;

#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/core.pyx":1782
 *                 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)
 */
#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/core.pyx":1927
 *                 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)
 */
#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 = (__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))
/* "gevent/core.pyx":1783
 *                     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
 */
#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/core.pyx":1928
 *                     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
 */
#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_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

#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/core.pyx":1784
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
#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/core.pyx":1929
 *                 self._flags |= 4
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)             # <<<<<<<<<<<<<<
 *                     self._flags |= 2
 *
 */
#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_unref(__pyx_v_self->loop->_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/core.pyx":1785
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
#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/core.pyx":1930
 *                 if not self._flags & 2 and libev.ev_is_active(&self._watcher):
 *                     libev.ev_unref(self.loop._ptr)
 *                     self._flags |= 2             # <<<<<<<<<<<<<<
 *
 *     property callback:
 */
#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 = (__pyx_v_self->_flags | 2);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__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_AddTraceback("gevent.core.child.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
#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_AddTraceback("gevent.core.stat.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
#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 = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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_4core_5child_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_8callback_1__get__(PyObject *__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))
static PyObject *__pyx_pw_6gevent_4core_4stat_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_8callback_1__get__(PyObject *__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_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (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_4core_5child_8callback___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1789
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5child_8callback___get__(struct PyGeventChildObject *__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_4core_4stat_8callback___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1934
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4stat_8callback___get__(struct PyGeventStatObject *__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_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 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/core.pyx":1790
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
#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/core.pyx":1935
 *
 *         def __get__(self):
 *             return self._callback             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, object callback):
 */
#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);
  __Pyx_INCREF(__pyx_v_self->_callback);
  __pyx_r = __pyx_v_self->_callback;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* 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 int __pyx_pw_6gevent_4core_5child_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_5child_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
#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_pw_6gevent_4core_4stat_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_4stat_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback) {
#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
  __Pyx_RefNannySetupContext("__set__ (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_4core_5child_8callback_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1792
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_5child_8callback_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_callback) {
#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_4core_4stat_8callback_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1937
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_4stat_8callback_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_callback) {
#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;
  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);

#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/core.pyx":1793
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":1794
 *         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 = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 1794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1795
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.child.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5child_stop(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1797
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1799
 *     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/core.pyx":1800
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_135), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_136), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __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 = 1800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1801
 *         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/core.pyx":1802
 *             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/core.pyx":1803
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1804
 *             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/core.pyx":1805
 *             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/core.pyx":1806
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":1807
 *         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/core.pyx":1808
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":1809
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.child.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_8priority___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1813
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1814
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1814; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.child.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5child_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1816; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.child.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5child_8priority_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1816
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1817
 *
 *         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/core.pyx":1818
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_136), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_137), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __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 = 1818; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1819
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.child.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1821; __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 = 1821; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; __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 = 1821; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.child.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5child_2feed(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1821
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1823
 *     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/core.pyx":1824
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_137), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __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 = 1824; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1825
 *         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 = 1825; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1826
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1827
 *         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/core.pyx":1828
 *         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/core.pyx":1829
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1830
 *             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/core.pyx":1831
 *             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/core.pyx":1832
 *         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/core.pyx":1833
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.child.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1835; __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 = 1835; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.child.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5child_4start(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1835
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1837
 *     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/core.pyx":1838
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_131), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_139), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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 = 1838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1839
 *         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/core.pyx":1840
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_132), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_139), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __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 = 1840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1841
 *         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 = 1841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1842
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1843
 *         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/core.pyx":1844
 *         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/core.pyx":1845
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1846
 *             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/core.pyx":1847
 *             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/core.pyx":1848
 *         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/core.pyx":1849
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.child.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_6active___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1853
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5child_6active___get__(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("__get__", 0);

/* "gevent/core.pyx":1854
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1854; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.child.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_7pending___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1859
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_5child_7pending___get__(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("__get__", 0);

/* "gevent/core.pyx":1860
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.child.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5child_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_133;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_140;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_141;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
    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 = 1862; __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 = 1862; __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_AsInt(values[1]); if (unlikely((__pyx_v_pid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __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 = 1862; __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 = 1862; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_5child_6__init__(((struct PyGeventChildObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_pid, __pyx_v_trace, __pyx_v_ref);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1862
 *             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')
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1863
 *
 *     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 = 1863; __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 = 1863; __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/core.pyx":1864
 *     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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_135), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_143), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __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 = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1865
 *         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/core.pyx":1866
 *             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/core.pyx":1867
 *         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/core.pyx":1868
 *         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 = 1868; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_3) {

/* "gevent/core.pyx":1869
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1871
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *
 *     def _format(self):
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.child.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_9_format(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5child_8_format(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1873
 *             self._flags = 4
 *
 *     def _format(self):             # <<<<<<<<<<<<<<
 *         return ' pid=%r rstatus=%r' % (self.pid, self.rstatus)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1874
 *
 *     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 = 1874; __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 = 1874; __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 = 1874; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
#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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_136), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_143), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __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 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_144), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; __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(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_2);
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __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_AddTraceback("gevent.core.child._format", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_3pid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_3pid_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_3pid___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1878
 *     property pid:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.pid
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1879
 *
 *         def __get__(self):
 *             return self._watcher.pid             # <<<<<<<<<<<<<<
 *
 *     property rpid:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_watcher.pid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.child.pid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_4rpid_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_4rpid_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_4rpid___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1883
 *     property rpid:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.rpid
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1884
 *
 *         def __get__(self):
 *             return self._watcher.rpid             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_watcher.rpid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1884; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.child.rpid.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5child_4rpid_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1886; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.child.rpid.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5child_4rpid_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1886
 *             return self._watcher.rpid
 *
 *         def __set__(self, int value):             # <<<<<<<<<<<<<<
 *             self._watcher.rpid = value
 *
 */

static int __pyx_pf_6gevent_4core_5child_4rpid_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/core.pyx":1887
 *
 *         def __set__(self, int value):
 *             self._watcher.rpid = value             # <<<<<<<<<<<<<<
 *
 *     property rstatus:
 */
  __pyx_v_self->_watcher.rpid = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_7rstatus_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_7rstatus_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_7rstatus___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1891
 *     property rstatus:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.rstatus
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1892
 *
 *         def __get__(self):
 *             return self._watcher.rstatus             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(__pyx_v_self->_watcher.rstatus); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1892; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.child.rstatus.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5child_7rstatus_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1894; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.child.rstatus.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_5child_7rstatus_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((int)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1894
 *             return self._watcher.rstatus
 *
 *         def __set__(self, int value):             # <<<<<<<<<<<<<<
 *             self._watcher.rstatus = value
 *
 */

static int __pyx_pf_6gevent_4core_5child_7rstatus_2__set__(struct PyGeventChildObject *__pyx_v_self, int __pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

/* "gevent/core.pyx":1895
 *
 *         def __set__(self, int value):
 *             self._watcher.rstatus = value             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_v_self->_watcher.rstatus = __pyx_v_value;

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_4loop___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1758
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5child_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5child_4loop_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_5child_4loop_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_5child_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_5child_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_4loop_4__del__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_5child_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_4args___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1760
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_child _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_5child_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_5child_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_5child_4args_2__set__(((struct PyGeventChildObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_5child_4args_2__set__(struct PyGeventChildObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1760; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_5child_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_5child_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_5child_4args_4__del__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_5child_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_5child_6_flags___get__(((struct PyGeventChildObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1761
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_child _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.child._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_3ref_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_3ref_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_3ref___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1911
 *     property ref:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return False if self._flags & 4 else True
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4stat_3ref___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/core.pyx":1912
 *
 *         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_t_1 = 0;
  } else {
    __pyx_t_1 = 1;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1912; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.ref.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4stat_3ref_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4stat_3ref_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1914
 *             return False if self._flags & 4 else True
 *
 *         def __set__(self, object value):             # <<<<<<<<<<<<<<
 *
 *             if not self.loop._ptr:
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1916
 *         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/core.pyx":1917
 *
 *             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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_137), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_144), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_145), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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 = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1918
 *             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 = 1918; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

/* "gevent/core.pyx":1919
 *                 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/core.pyx":1920
 *             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;
      goto __pyx_L5;
    }
    __pyx_L5:;

/* "gevent/core.pyx":1921
 *                 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/core.pyx":1922
 *                     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);
      goto __pyx_L6;
    }
    __pyx_L6:;

/* "gevent/core.pyx":1923
 *                 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));
    goto __pyx_L4;
  }
  /*else*/ {

/* "gevent/core.pyx":1925
 *                 self._flags &= ~6  # do not want unref, no outstanding unref
 *             else:
 *                 if self._flags & 4:             # <<<<<<<<<<<<<<
 *                     return  # ref is already False
 *                 self._flags |= 4
 */
    __pyx_t_1 = ((__pyx_v_self->_flags & 4) != 0);
    if (__pyx_t_1) {

/* "gevent/core.pyx":1926
 *             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;
      goto __pyx_L7;
    }
    __pyx_L7:;

/* "gevent/core.pyx":1927
 *                 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/core.pyx":1928
 *                     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_1 = (!((__pyx_v_self->_flags & 2) != 0));
    if (__pyx_t_1) {
      __pyx_t_3 = (ev_is_active((&__pyx_v_self->_watcher)) != 0);
    } else {
      __pyx_t_3 = __pyx_t_1;
    }
    if (__pyx_t_3) {

/* "gevent/core.pyx":1929
 *                 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/core.pyx":1930
 *                 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);
      goto __pyx_L8;
    }
    __pyx_L8:;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.ref.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_8callback_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_8callback_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_8callback___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1934
 *     property callback:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._callback
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4stat_8callback___get__(struct PyGeventStatObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);

/* "gevent/core.pyx":1935
 *
 *         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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4stat_8callback_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_callback); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4stat_8callback_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1937
 *             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, ))
 */

static int __pyx_pf_6gevent_4core_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);

#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/core.pyx":1938
 *
 *         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_1 = ((!(PyCallable_Check(((PyObject*)__pyx_v_callback)) != 0)) != 0);
  if (__pyx_t_1) {
    __pyx_t_2 = (__pyx_v_callback != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
  } else {
    __pyx_t_3 = __pyx_t_1;
  }
  if (__pyx_t_3) {

/* "gevent/core.pyx":1939
 *         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 = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_55), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_54), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __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(LIBEV_EMBED) && defined(_WIN32))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_62), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
    __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_61), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __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_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_63), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __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(((PyObject *)__pyx_t_5));
    __Pyx_DECREF(((PyObject *)__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 = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__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 = 1939; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1940
 *             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;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("gevent.core.stat.callback.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_1stop(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4stat_stop(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1942
 *             self._callback = callback
 *
 *     def stop(self):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1944
 *     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/core.pyx":1945
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_126), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_145), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_133), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_134), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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 = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1946
 *         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/core.pyx":1947
 *             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/core.pyx":1948
 *         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));
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1949
 *             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/core.pyx":1950
 *             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/core.pyx":1951
 *         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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

/* "gevent/core.pyx":1952
 *         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/core.pyx":1953
 *         self.args = None
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)             # <<<<<<<<<<<<<<
 *             self._flags &= ~1
 *
 */
    Py_DECREF(((PyObject*)__pyx_v_self));

/* "gevent/core.pyx":1954
 *         if self._flags & 1:
 *             Py_DECREF(<PyObjectPtr>self)
 *             self._flags &= ~1             # <<<<<<<<<<<<<<
 *
 *     property priority:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags & (~1));
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.stop", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_8priority_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_8priority_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_8priority___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1958
 *     property priority:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return libev.ev_priority(&self._watcher)
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1959
 *
 *         def __get__(self):
 *             return libev.ev_priority(&self._watcher)             # <<<<<<<<<<<<<<
 *
 *         def __set__(self, int priority):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(ev_priority((&__pyx_v_self->_watcher))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.stat.priority.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4stat_8priority_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_priority); /*proto*/
static int __pyx_pw_6gevent_4core_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_AsInt(__pyx_arg_priority); if (unlikely((__pyx_v_priority == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1961; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.stat.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4stat_8priority_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((int)__pyx_v_priority));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1961
 *             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")
 */

static int __pyx_pf_6gevent_4core_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/core.pyx":1962
 *
 *         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/core.pyx":1963
 *         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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_139), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_127), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_146), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_134), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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 = PyObject_Call(__pyx_builtin_AttributeError, ((PyObject *)__pyx_k_tuple_135), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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 = 1963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1964
 *             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);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.priority.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_3feed(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1966; __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 = 1966; __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_AsInt(values[0]); if (unlikely((__pyx_v_revents == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; __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 = 1966; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.stat.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4stat_2feed(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_revents, __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1966
 *             libev.ev_set_priority(&self._watcher, priority)
 *
 *     def feed(self, int revents, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1968
 *     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/core.pyx":1969
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_140), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_128), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_147), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_135), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_136), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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 = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1970
 *         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 = 1970; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1971
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1972
 *         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/core.pyx":1973
 *         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/core.pyx":1974
 *         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);
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1975
 *             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/core.pyx":1976
 *             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/core.pyx":1977
 *         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/core.pyx":1978
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.feed", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_5start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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 = 1980; __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 = 1980; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("gevent.core.stat.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_6gevent_4core_4stat_4start(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_callback, __pyx_v_args);
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1980
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":1982
 *     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/core.pyx":1983
 *
 *         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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_141), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_129), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_148), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_136), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_137), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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 = 1983; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":1984
 *         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/core.pyx":1985
 *             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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_142), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_130), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_149), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_137), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_150), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_k_tuple_138), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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 = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L4;
  }
  __pyx_L4:;

/* "gevent/core.pyx":1986
 *         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 = 1986; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":1987
 *             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(((PyObject *)__pyx_v_args));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_args));
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = __pyx_v_args;

/* "gevent/core.pyx":1988
 *         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/core.pyx":1989
 *         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/core.pyx":1990
 *         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);
    goto __pyx_L5;
  }
  __pyx_L5:;

/* "gevent/core.pyx":1991
 *             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/core.pyx":1992
 *             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/core.pyx":1993
 *         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/core.pyx":1994
 *         if not self._flags & 1:
 *             Py_INCREF(<PyObjectPtr>self)
 *             self._flags |= 1             # <<<<<<<<<<<<<<
 *
 *     property active:
 */
    __pyx_v_self->_flags = (__pyx_v_self->_flags | 1);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.start", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_6active_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_6active_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_6active___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1998
 *     property active:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_active(&self._watcher) else False
 *
 */

static PyObject *__pyx_pf_6gevent_4core_4stat_6active___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/core.pyx":1999
 *
 *         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_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1999; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.active.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_7pending_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_7pending_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_7pending___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":2004
 *     property pending:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *     cdef readonly bytes path
 */

static PyObject *__pyx_pf_6gevent_4core_4stat_7pending___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/core.pyx":2005
 *
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False             # <<<<<<<<<<<<<<
 *     cdef readonly bytes path
 *
 */
  __Pyx_XDECREF(__pyx_r);
  if ((ev_is_pending((&__pyx_v_self->_watcher)) != 0)) {
    __pyx_t_1 = 1;
  } else {
    __pyx_t_1 = 0;
  }
  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2005; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.pending.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4stat_7__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_6gevent_4core_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};
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_143;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
    values[3] = __pyx_k_131;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_150;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[3] = __pyx_k_138;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
    values[3] = __pyx_k_151;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
    values[3] = __pyx_k_139;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)

/* "gevent/core.pyx":2008
 *     cdef readonly bytes path
 *
 *     def __init__(self, loop loop, bytes path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>self.path, interval)
 */
    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 = 2008; __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 = 2008; __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 = 2008; __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 = 2008; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_loop, 1, "loop", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_path), (&PyBytes_Type), 1, "path", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_pf_6gevent_4core_4stat_6__init__(((struct PyGeventStatObject *)__pyx_v_self), __pyx_v_loop, __pyx_v_path, __pyx_v_interval, __pyx_v_ref, __pyx_v_priority);
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  char *__pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

/* "gevent/core.pyx":2009
 *
 *     def __init__(self, loop loop, bytes path, float interval=0.0, ref=True, priority=None):
 *         self.path = path             # <<<<<<<<<<<<<<
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>self.path, interval)
 *         self.loop = loop
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_path));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_path));
  __Pyx_GOTREF(__pyx_v_self->path);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->path));
  __pyx_v_self->path = __pyx_v_path;

/* "gevent/core.pyx":2010
 *     def __init__(self, loop loop, bytes path, float interval=0.0, ref=True, priority=None):
 *         self.path = path
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>self.path, interval)             # <<<<<<<<<<<<<<
 *         self.loop = loop
 *         if ref:
 */
  __pyx_t_1 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_self->path)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2010; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  ev_stat_init((&__pyx_v_self->_watcher), ((void *)gevent_callback_stat), ((char *)__pyx_t_1), __pyx_v_interval);

/* "gevent/core.pyx":2011
 *         self.path = path
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>self.path, 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/core.pyx":2012
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>self.path, 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 = 2012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_2) {

/* "gevent/core.pyx":2013
 *         self.loop = loop
 *         if ref:
 *             self._flags = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self._flags = 4
 */
    __pyx_v_self->_flags = 0;
    goto __pyx_L3;
  }
  /*else*/ {

/* "gevent/core.pyx":2015
 *             self._flags = 0
 *         else:
 *             self._flags = 4             # <<<<<<<<<<<<<<
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)
 */
    __pyx_v_self->_flags = 4;
  }
  __pyx_L3:;

/* "gevent/core.pyx":2016
 *         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_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

/* "gevent/core.pyx":2017
 *             self._flags = 4
 *         if priority is not None:
 *             libev.ev_set_priority(&self._watcher, priority)             # <<<<<<<<<<<<<<
 *
 *     property attr:
 */
    __pyx_t_4 = __Pyx_PyInt_AsInt(__pyx_v_priority); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2017; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ev_set_priority((&__pyx_v_self->_watcher), __pyx_t_4);
    goto __pyx_L4;
  }
  __pyx_L4:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.stat.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_4attr_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_4attr_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_4attr___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":2021
 *     property attr:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if not self._watcher.attr.st_nlink:
 *                 return
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":2022
 *
 *         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/core.pyx":2023
 *         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;
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":2024
 *             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 = 2024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.attr.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_4prev_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_4prev_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_4prev___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":2028
 *     property prev:
 *
 *        def __get__(self):             # <<<<<<<<<<<<<<
 *             if not self._watcher.prev.st_nlink:
 *                 return
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":2029
 *
 *        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/core.pyx":2030
 *        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;
    goto __pyx_L3;
  }
  __pyx_L3:;

/* "gevent/core.pyx":2031
 *             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 = 2031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("gevent.core.stat.prev.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_8interval_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_8interval_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_8interval___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":2035
 *     property interval:
 *
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             return self._watcher.interval
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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/core.pyx":2036
 *
 *         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 = 2036; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.stat.interval.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_4loop_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_4loop_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_4loop___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1903
 *
 *
 *     cdef public loop loop             # <<<<<<<<<<<<<<
 *     cdef object _callback
 *     cdef public tuple args
 */

static PyObject *__pyx_pf_6gevent_4core_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;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4stat_4loop_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4stat_4loop_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_4stat_4loop_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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_4core_loop))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1903; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->loop);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->loop));
  __pyx_v_self->loop = ((struct PyGeventLoopObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_4stat_4loop_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_4stat_4loop_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_4loop_4__del__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_4args_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_4args_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_4args___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1905
 *     cdef public loop loop
 *     cdef object _callback
 *     cdef public tuple args             # <<<<<<<<<<<<<<
 *     cdef readonly int _flags
 *     cdef libev.ev_stat _watcher
 */

static PyObject *__pyx_pf_6gevent_4core_4stat_4args___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->args));
  __pyx_r = ((PyObject *)__pyx_v_self->args);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_6gevent_4core_4stat_4args_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_6gevent_4core_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_4core_4stat_4args_2__set__(((struct PyGeventStatObject *)__pyx_v_self), ((PyObject *)__pyx_v_value));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_4stat_4args_2__set__(struct PyGeventStatObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  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 tuple, got %.200s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1905; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->args);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("gevent.core.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_4core_4stat_4args_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_6gevent_4core_4stat_4args_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_4args_4__del__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_6gevent_4core_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(((PyObject *)__pyx_v_self->args));
  __pyx_v_self->args = ((PyObject*)Py_None);

  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_6_flags_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_4stat_6_flags___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":1906
 *     cdef object _callback
 *     cdef public tuple args
 *     cdef readonly int _flags             # <<<<<<<<<<<<<<
 *     cdef libev.ev_stat _watcher
 *
 */

static PyObject *__pyx_pf_6gevent_4core_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 = PyInt_FromLong(__pyx_v_self->_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1906; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.stat._flags.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_6gevent_4core_4stat_4path_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_4stat_4path_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_6gevent_4core_4stat_4path___get__(((struct PyGeventStatObject *)__pyx_v_self));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":2006
 *         def __get__(self):
 *             return True if libev.ev_is_pending(&self._watcher) else False
 *     cdef readonly bytes path             # <<<<<<<<<<<<<<
 *
 *     def __init__(self, loop loop, bytes path, float interval=0.0, ref=True, priority=None):
 */

static PyObject *__pyx_pf_6gevent_4core_4stat_4path___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->path));
  __pyx_r = ((PyObject *)__pyx_v_self->path);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":2042
 *
 *
 * cdef void _syserr_cb(char* msg) with gil:             # <<<<<<<<<<<<<<
 *     try:
 *         __SYSERR_CALLBACK(msg, errno)
 */

static void __pyx_f_6gevent_4core__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;
  int __pyx_t_9;
  int __pyx_t_10;
  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/core.pyx":2043
 *
 * 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/core.pyx":2044
 * cdef void _syserr_cb(char* msg) with gil:
 *     try:
 *         __SYSERR_CALLBACK(msg, errno)             # <<<<<<<<<<<<<<
 *     except:
 *         set_syserr_cb(None)
 */
      __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s____SYSERR_CALLBACK); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_msg); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __pyx_t_6 = PyInt_FromLong(errno); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_t_5));
      __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      __pyx_t_5 = 0;
      __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2044; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L10_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

/* "gevent/core.pyx":2045
 *     try:
 *         __SYSERR_CALLBACK(msg, errno)
 *     except:             # <<<<<<<<<<<<<<
 *         set_syserr_cb(None)
 *         print_exc = getattr(traceback, 'print_exc', None)
 */
    /*except:*/ {
      __Pyx_AddTraceback("gevent.core._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2045; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_4);

/* "gevent/core.pyx":2046
 *         __SYSERR_CALLBACK(msg, errno)
 *     except:
 *         set_syserr_cb(None)             # <<<<<<<<<<<<<<
 *         print_exc = getattr(traceback, 'print_exc', None)
 *         if print_exc is not None:
 */
      __pyx_t_5 = __pyx_f_6gevent_4core_set_syserr_cb(Py_None, 0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2046; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

/* "gevent/core.pyx":2047
 *     except:
 *         set_syserr_cb(None)
 *         print_exc = getattr(traceback, 'print_exc', None)             # <<<<<<<<<<<<<<
 *         if print_exc is not None:
 *             print_exc()
 */
      __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__traceback); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_8 = __Pyx_GetAttr3(__pyx_t_5, ((PyObject *)__pyx_n_s__print_exc), Py_None); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2047; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_v_print_exc = __pyx_t_8;
      __pyx_t_8 = 0;

/* "gevent/core.pyx":2048
 *         set_syserr_cb(None)
 *         print_exc = getattr(traceback, 'print_exc', None)
 *         if print_exc is not None:             # <<<<<<<<<<<<<<
 *             print_exc()
 *
 */
      __pyx_t_9 = (__pyx_v_print_exc != Py_None);
      __pyx_t_10 = (__pyx_t_9 != 0);
      if (__pyx_t_10) {

/* "gevent/core.pyx":2049
 *         print_exc = getattr(traceback, 'print_exc', None)
 *         if print_exc is not None:
 *             print_exc()             # <<<<<<<<<<<<<<
 *
 *
 */
        __pyx_t_8 = PyObject_Call(__pyx_v_print_exc, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2049; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        goto __pyx_L13;
      }
      __pyx_L13:;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_exception_handled;
    }
    __pyx_L5_except_error:;
    __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:;
  }

  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_WriteUnraisable("gevent.core._syserr_cb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_print_exc);
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  PyGILState_Release(__pyx_gilstate_save);
  #endif
}

/* "gevent/core.pyx":2052
 *
 *
 * cpdef set_syserr_cb(callback):             # <<<<<<<<<<<<<<
 *     global __SYSERR_CALLBACK
 *     if callback is None:
 */

static PyObject *__pyx_pw_6gevent_4core_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/
static PyObject *__pyx_f_6gevent_4core_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/core.pyx":2054
 * 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/core.pyx":2055
 *     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/core.pyx":2056
 *     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 = 2056; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }

/* "gevent/core.pyx":2057
 *         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 = 2057; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

/* "gevent/core.pyx":2058
 *         __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_4core__syserr_cb));

/* "gevent/core.pyx":2059
 *     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 = 2059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L3;
  }
  /*else*/ {

/* "gevent/core.pyx":2061
 *         __SYSERR_CALLBACK = callback
 *     else:
 *         raise TypeError('Expected callable or None, got %r' % (callback, ))             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_callback);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_callback);
    __Pyx_GIVEREF(__pyx_v_callback);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
    __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_144), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_132), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_151), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_139), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_152), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __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_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_140), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __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(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(((PyObject *)__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 = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(((PyObject *)__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 = 2061; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L3:;

  __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.core.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_4core_21set_syserr_cb(PyObject *__pyx_self, PyObject *__pyx_v_callback); /*proto*/
static PyObject *__pyx_pw_6gevent_4core_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_4core_20set_syserr_cb(__pyx_self, ((PyObject *)__pyx_v_callback));
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "gevent/core.pyx":2052
 *
 *
 * cpdef set_syserr_cb(callback):             # <<<<<<<<<<<<<<
 *     global __SYSERR_CALLBACK
 *     if callback is None:
 */

static PyObject *__pyx_pf_6gevent_4core_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_4core_set_syserr_cb(__pyx_v_callback, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("gevent.core.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_4core_watcher(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = (*t->tp_alloc)(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_6gevent_4core_watcher(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_watcher[] = {
  {__Pyx_NAMESTR("_format"), (PyCFunction)__pyx_pw_6gevent_4core_7watcher_3_format, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventWatcher_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.watcher"), /*tp_name*/
  sizeof(struct PyGeventWatcherObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_watcher, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_6gevent_4core_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*/
  __Pyx_DOCSTR("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_4core_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_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_check(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventCheckObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_check(PyObject *o) {
  struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_check(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_check(PyObject *o) {
  struct PyGeventCheckObject *p = (struct PyGeventCheckObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_5check_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5check_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5check_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5check_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5check_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5check_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5check_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5check_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5check_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5check_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5check_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5check_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5check_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5check_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5check_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5check_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5check_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5check_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5check_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5check_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_5check_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5check_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5check_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5check_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5check_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_5check_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5check__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5check_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_check[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_5check_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_5check_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_5check_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_check[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_5check_ref, __pyx_setprop_6gevent_4core_5check_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_5check_callback, __pyx_setprop_6gevent_4core_5check_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_5check_priority, __pyx_setprop_6gevent_4core_5check_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_5check_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_5check_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_5check_loop, __pyx_setprop_6gevent_4core_5check_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_5check_args, __pyx_setprop_6gevent_4core_5check_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_5check__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventCheck_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.check"), /*tp_name*/
  sizeof(struct PyGeventCheckObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_check, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_check, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_check, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_check, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_check, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_5check_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_timer(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventTimerObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_timer(PyObject *o) {
  struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_timer(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_timer(PyObject *o) {
  struct PyGeventTimerObject *p = (struct PyGeventTimerObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_5timer_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5timer_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5timer_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5timer_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5timer_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5timer_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5timer_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5timer_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5timer_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5timer_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5timer_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5timer_at(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_2at_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5timer_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5timer_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5timer_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_5timer_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5timer_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5timer_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5timer_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_5timer_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5timer__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5timer_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_timer[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_5timer_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_5timer_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_5timer_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("again"), (PyCFunction)__pyx_pw_6gevent_4core_5timer_9again, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_timer[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_5timer_ref, __pyx_setprop_6gevent_4core_5timer_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_5timer_callback, __pyx_setprop_6gevent_4core_5timer_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_5timer_priority, __pyx_setprop_6gevent_4core_5timer_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_5timer_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_5timer_pending, 0, 0, 0},
  {(char *)"at", __pyx_getprop_6gevent_4core_5timer_at, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_5timer_loop, __pyx_setprop_6gevent_4core_5timer_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_5timer_args, __pyx_setprop_6gevent_4core_5timer_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_5timer__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventTimer_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.timer"), /*tp_name*/
  sizeof(struct PyGeventTimerObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_timer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_timer, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_timer, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_timer, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_timer, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_5timer_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_signal(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventSignalObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_signal(PyObject *o) {
  struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_signal(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_signal(PyObject *o) {
  struct PyGeventSignalObject *p = (struct PyGeventSignalObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_6signal_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_6signal_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_6signal_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_6signal_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_6signal_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_6signal_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_6signal_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_6signal_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_6signal_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_6signal_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_6signal_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_6signal_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_6signal_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_6signal_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_6signal_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_6signal_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_6signal_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_6signal_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_6signal_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_6signal_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_6signal_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_6signal_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_6signal_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_6signal_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_6signal_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_6signal_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_6signal__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_6signal_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_signal[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_6signal_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_6signal_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_6signal_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_signal[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_6signal_ref, __pyx_setprop_6gevent_4core_6signal_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_6signal_callback, __pyx_setprop_6gevent_4core_6signal_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_6signal_priority, __pyx_setprop_6gevent_4core_6signal_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_6signal_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_6signal_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_6signal_loop, __pyx_setprop_6gevent_4core_6signal_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_6signal_args, __pyx_setprop_6gevent_4core_6signal_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_6signal__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventSignal_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.signal"), /*tp_name*/
  sizeof(struct PyGeventSignalObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_signal, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_signal, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_signal, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_signal, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_signal, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_6signal_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_fork(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventForkObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_fork(PyObject *o) {
  struct PyGeventForkObject *p = (struct PyGeventForkObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_fork(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventForkObject *p = (struct PyGeventForkObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_fork(PyObject *o) {
  struct PyGeventForkObject *p = (struct PyGeventForkObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_4fork_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4fork_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4fork_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4fork_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4fork_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4fork_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4fork_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4fork_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4fork_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4fork_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4fork_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4fork_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4fork_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4fork_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4fork_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4fork_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4fork_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4fork_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4fork_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4fork_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_4fork_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4fork_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4fork_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4fork_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4fork_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_4fork_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4fork__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4fork_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_fork[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_4fork_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_4fork_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_4fork_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_fork[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_4fork_ref, __pyx_setprop_6gevent_4core_4fork_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_4fork_callback, __pyx_setprop_6gevent_4core_4fork_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_4fork_priority, __pyx_setprop_6gevent_4core_4fork_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_4fork_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_4fork_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_4fork_loop, __pyx_setprop_6gevent_4core_4fork_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_4fork_args, __pyx_setprop_6gevent_4core_4fork_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_4fork__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventFork_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.fork"), /*tp_name*/
  sizeof(struct PyGeventForkObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_fork, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_fork, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_fork, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_fork, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_fork, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_4fork_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_stat(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventStatObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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);
  return o;
}

static void __pyx_tp_dealloc_6gevent_4core_stat(PyObject *o) {
  struct PyGeventStatObject *p = (struct PyGeventStatObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  Py_CLEAR(p->path);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_stat(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventStatObject *p = (struct PyGeventStatObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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;
  }
  if (p->path) {
    e = (*v)(p->path, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_4core_stat(PyObject *o) {
  struct PyGeventStatObject *p = (struct PyGeventStatObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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);
  tmp = ((PyObject*)p->path);
  p->path = ((PyObject*)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4stat_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4stat_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4stat_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4stat_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4stat_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4stat_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_attr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_4attr_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_prev(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_4prev_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_interval(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_8interval_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4stat_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4stat_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_4stat_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4stat_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4stat_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_4stat_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4stat__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_6_flags_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4stat_path(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4stat_4path_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_stat[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_4stat_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_4stat_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_4stat_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_stat[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_4stat_ref, __pyx_setprop_6gevent_4core_4stat_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_4stat_callback, __pyx_setprop_6gevent_4core_4stat_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_4stat_priority, __pyx_setprop_6gevent_4core_4stat_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_4stat_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_4stat_pending, 0, 0, 0},
  {(char *)"attr", __pyx_getprop_6gevent_4core_4stat_attr, 0, 0, 0},
  {(char *)"prev", __pyx_getprop_6gevent_4core_4stat_prev, 0, 0, 0},
  {(char *)"interval", __pyx_getprop_6gevent_4core_4stat_interval, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_4stat_loop, __pyx_setprop_6gevent_4core_4stat_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_4stat_args, __pyx_setprop_6gevent_4core_4stat_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_4stat__flags, 0, 0, 0},
  {(char *)"path", __pyx_getprop_6gevent_4core_4stat_path, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventStat_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.stat"), /*tp_name*/
  sizeof(struct PyGeventStatObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_stat, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_stat, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_stat, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_stat, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_stat, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_4stat_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_6gevent_4core_loop __pyx_vtable_6gevent_4core_loop;

static PyObject *__pyx_tp_new_6gevent_4core_loop(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct PyGeventLoopObject *p;
  PyObject *o;
  o = (*t->tp_alloc)(t, 0);
  if (unlikely(!o)) return 0;
  p = ((struct PyGeventLoopObject *)o);
  p->__pyx_vtab = __pyx_vtabptr_6gevent_4core_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_4core_loop(PyObject *o) {
  struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o;
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_6gevent_4core_4loop_7__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(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_4core_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_4core_loop(PyObject *o) {
  struct PyGeventLoopObject *p = (struct PyGeventLoopObject *)o;
  PyObject* tmp;
  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_4core_4loop_ptr(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_3ptr_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_WatcherType(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_11WatcherType_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_MAXPRI(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_6MAXPRI_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_MINPRI(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_6MINPRI_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_default(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_7default_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_iteration(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_9iteration_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_depth(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_5depth_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_backend_int(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_11backend_int_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_backend(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_7backend_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_pendingcnt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_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_4core_4loop_activecnt(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_9activecnt_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_sig_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_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_4core_4loop_sigfd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_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_4core_4loop_origflags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_9origflags_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4loop_origflags_int(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_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_4core_4loop_error_handler(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_13error_handler_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4loop_error_handler(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4loop_13error_handler_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_4loop_13error_handler_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4loop__callbacks(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4loop_10_callbacks_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4loop__callbacks(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4loop_10_callbacks_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_4loop_10_callbacks_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6gevent_4core_loop[] = {
  {__Pyx_NAMESTR("_stop_watchers"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_3_stop_watchers, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("destroy"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_5destroy, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_handle_syserr"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_9_handle_syserr, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("handle_error"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_11handle_error, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_default_handle_error"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_13_default_handle_error, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("run"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_15run, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("reinit"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_17reinit, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("ref"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_19ref, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("unref"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_21unref, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("break_"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_23break_, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("verify"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_25verify, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("now"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_27now, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("update"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_29update, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("io"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_33io, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("timer"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_35timer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("signal"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_37signal, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("idle"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_39idle, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("prepare"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_41prepare, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("check"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_43check, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fork"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_45fork, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("async"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_47async, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(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_NAMESTR("child"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_49child, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("install_sigchld"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_51install_sigchld, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("stat"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_53stat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("run_callback"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_55run_callback, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_format"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_57_format, METH_NOARGS, __Pyx_DOCSTR(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_NAMESTR("stat"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_49stat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("run_callback"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_51run_callback, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_format"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_53_format, METH_NOARGS, __Pyx_DOCSTR(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))
  {__Pyx_NAMESTR("_format_details"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_59_format_details, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fileno"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_61fileno, METH_NOARGS, __Pyx_DOCSTR(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))
  {__Pyx_NAMESTR("_format_details"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_55_format_details, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("fileno"), (PyCFunction)__pyx_pw_6gevent_4core_4loop_57fileno, METH_NOARGS, __Pyx_DOCSTR(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_4core_loop[] = {
  {(char *)"ptr", __pyx_getprop_6gevent_4core_4loop_ptr, 0, 0, 0},
  {(char *)"WatcherType", __pyx_getprop_6gevent_4core_4loop_WatcherType, 0, 0, 0},
  {(char *)"MAXPRI", __pyx_getprop_6gevent_4core_4loop_MAXPRI, 0, 0, 0},
  {(char *)"MINPRI", __pyx_getprop_6gevent_4core_4loop_MINPRI, 0, 0, 0},
  {(char *)"default", __pyx_getprop_6gevent_4core_4loop_default, 0, 0, 0},
  {(char *)"iteration", __pyx_getprop_6gevent_4core_4loop_iteration, 0, 0, 0},
  {(char *)"depth", __pyx_getprop_6gevent_4core_4loop_depth, 0, 0, 0},
  {(char *)"backend_int", __pyx_getprop_6gevent_4core_4loop_backend_int, 0, 0, 0},
  {(char *)"backend", __pyx_getprop_6gevent_4core_4loop_backend, 0, 0, 0},
  {(char *)"pendingcnt", __pyx_getprop_6gevent_4core_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_4core_4loop_activecnt, 0, 0, 0},
  {(char *)"sig_pending", __pyx_getprop_6gevent_4core_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_4core_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_4core_4loop_origflags, 0, 0, 0},
  {(char *)"origflags_int", __pyx_getprop_6gevent_4core_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_4core_4loop_error_handler, __pyx_setprop_6gevent_4core_4loop_error_handler, 0, 0},
  {(char *)"_callbacks", __pyx_getprop_6gevent_4core_4loop__callbacks, __pyx_setprop_6gevent_4core_4loop__callbacks, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventLoop_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.loop"), /*tp_name*/
  sizeof(struct PyGeventLoopObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_loop, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_6gevent_4core_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_4core_loop, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_loop, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_loop, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_loop, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_4loop_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *__pyx_freelist_6gevent_4core___pyx_scope_struct__genexpr[8];
static int __pyx_freecount_6gevent_4core___pyx_scope_struct__genexpr = 0;

static PyObject *__pyx_tp_new_6gevent_4core___pyx_scope_struct__genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *p;
  PyObject *o;
  if (likely((__pyx_freecount_6gevent_4core___pyx_scope_struct__genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr)))) {
    o = (PyObject*)__pyx_freelist_6gevent_4core___pyx_scope_struct__genexpr[--__pyx_freecount_6gevent_4core___pyx_scope_struct__genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr));
    PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *)o);
  p->__pyx_v_flag = 0;
  p->__pyx_v_string = 0;
  p->__pyx_t_0 = 0;
  return o;
}

static void __pyx_tp_dealloc_6gevent_4core___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_flag);
  Py_CLEAR(p->__pyx_v_string);
  Py_CLEAR(p->__pyx_t_0);
  if ((__pyx_freecount_6gevent_4core___pyx_scope_struct__genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr))) {
    __pyx_freelist_6gevent_4core___pyx_scope_struct__genexpr[__pyx_freecount_6gevent_4core___pyx_scope_struct__genexpr++] = ((struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_6gevent_4core___pyx_scope_struct__genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_4core___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;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6gevent_4core___pyx_scope_struct__genexpr(PyObject *o) {
  struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *p = (struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr *)o;
  PyObject* tmp;
  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);
  tmp = ((PyObject*)p->__pyx_t_0);
  p->__pyx_t_0 = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

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

static PyTypeObject __pyx_type_6gevent_4core___pyx_scope_struct__genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.__pyx_scope_struct__genexpr"), /*tp_name*/
  sizeof(struct __pyx_obj_6gevent_4core___pyx_scope_struct__genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core___pyx_scope_struct__genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #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_4core___pyx_scope_struct__genexpr, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core___pyx_scope_struct__genexpr, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core___pyx_scope_struct__genexpr, /*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_4core___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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_idle(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventIdleObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_idle(PyObject *o) {
  struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_idle(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_idle(PyObject *o) {
  struct PyGeventIdleObject *p = (struct PyGeventIdleObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_4idle_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4idle_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4idle_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4idle_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4idle_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4idle_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4idle_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4idle_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4idle_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4idle_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4idle_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4idle_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4idle_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4idle_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4idle_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4idle_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_4idle_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4idle_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4idle_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4idle_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_4idle_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4idle_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4idle_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_4idle_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_4idle_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_4idle_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_4idle__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_4idle_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_idle[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_4idle_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_4idle_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_4idle_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_idle[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_4idle_ref, __pyx_setprop_6gevent_4core_4idle_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_4idle_callback, __pyx_setprop_6gevent_4core_4idle_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_4idle_priority, __pyx_setprop_6gevent_4core_4idle_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_4idle_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_4idle_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_4idle_loop, __pyx_setprop_6gevent_4core_4idle_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_4idle_args, __pyx_setprop_6gevent_4core_4idle_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_4idle__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventIdle_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.idle"), /*tp_name*/
  sizeof(struct PyGeventIdleObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_idle, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_idle, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_idle, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_idle, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_idle, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_4idle_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #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 PyObject *__pyx_tp_new_6gevent_4core_child(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventChildObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_child(PyObject *o) {
  struct PyGeventChildObject *p = (struct PyGeventChildObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_child(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventChildObject *p = (struct PyGeventChildObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_child(PyObject *o) {
  struct PyGeventChildObject *p = (struct PyGeventChildObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_5child_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5child_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5child_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5child_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5child_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5child_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5child_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5child_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5child_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5child_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5child_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5child_pid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_3pid_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5child_rpid(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_4rpid_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5child_rpid(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5child_4rpid_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5child_rstatus(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_7rstatus_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5child_rstatus(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5child_7rstatus_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5child_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5child_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5child_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_5child_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5child_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5child_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5child_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_5child_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5child__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5child_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_child[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_5child_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_5child_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_5child_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_format"), (PyCFunction)__pyx_pw_6gevent_4core_5child_9_format, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_child[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_5child_ref, __pyx_setprop_6gevent_4core_5child_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_5child_callback, __pyx_setprop_6gevent_4core_5child_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_5child_priority, __pyx_setprop_6gevent_4core_5child_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_5child_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_5child_pending, 0, 0, 0},
  {(char *)"pid", __pyx_getprop_6gevent_4core_5child_pid, 0, 0, 0},
  {(char *)"rpid", __pyx_getprop_6gevent_4core_5child_rpid, __pyx_setprop_6gevent_4core_5child_rpid, 0, 0},
  {(char *)"rstatus", __pyx_getprop_6gevent_4core_5child_rstatus, __pyx_setprop_6gevent_4core_5child_rstatus, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_5child_loop, __pyx_setprop_6gevent_4core_5child_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_5child_args, __pyx_setprop_6gevent_4core_5child_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_5child__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventChild_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.child"), /*tp_name*/
  sizeof(struct PyGeventChildObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_child, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_child, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_child, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_child, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_child, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_5child_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_child, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

#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_4core_prepare(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventPrepareObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_prepare(PyObject *o) {
  struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_prepare(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_prepare(PyObject *o) {
  struct PyGeventPrepareObject *p = (struct PyGeventPrepareObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_7prepare_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_7prepare_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_7prepare_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_7prepare_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_7prepare_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_7prepare_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_7prepare_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_7prepare_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_7prepare_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_7prepare_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_7prepare_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_7prepare_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_7prepare_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_7prepare_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_7prepare_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_7prepare_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_7prepare_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_7prepare_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_7prepare_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_7prepare_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_7prepare_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_7prepare_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_7prepare_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_7prepare_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_7prepare_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_7prepare_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_7prepare__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_7prepare_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_prepare[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_7prepare_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_7prepare_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_7prepare_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_prepare[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_7prepare_ref, __pyx_setprop_6gevent_4core_7prepare_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_7prepare_callback, __pyx_setprop_6gevent_4core_7prepare_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_7prepare_priority, __pyx_setprop_6gevent_4core_7prepare_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_7prepare_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_7prepare_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_7prepare_loop, __pyx_setprop_6gevent_4core_7prepare_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_7prepare_args, __pyx_setprop_6gevent_4core_7prepare_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_7prepare__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventPrepare_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.prepare"), /*tp_name*/
  sizeof(struct PyGeventPrepareObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_prepare, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_prepare, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_prepare, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_prepare, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_prepare, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_7prepare_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_callback(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct PyGeventCallbackObject *p;
  PyObject *o;
  o = (*t->tp_alloc)(t, 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_4core_callback(PyObject *o) {
  struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->callback);
  Py_CLEAR(p->args);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6gevent_4core_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_4core_callback(PyObject *o) {
  struct PyGeventCallbackObject *p = (struct PyGeventCallbackObject *)o;
  PyObject* 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_4core_8callback_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_8callback_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_8callback_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_8callback_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_8callback_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_8callback_8callback_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_8callback_8callback_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_8callback_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_8callback_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_8callback_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_8callback_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_8callback_4args_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_6gevent_4core_callback[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_8callback_3stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_format"), (PyCFunction)__pyx_pw_6gevent_4core_8callback_9_format, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_callback[] = {
  {(char *)"pending", __pyx_getprop_6gevent_4core_8callback_pending, 0, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_8callback_callback, __pyx_setprop_6gevent_4core_8callback_callback, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_8callback_args, __pyx_setprop_6gevent_4core_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
  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_4core_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
  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
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  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*/
  #if PY_VERSION_HEX >= 0x02050000
  0, /*nb_index*/
  #endif
};

DL_EXPORT(PyTypeObject) PyGeventCallback_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.callback"), /*tp_name*/
  sizeof(struct PyGeventCallbackObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_callback, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_6gevent_4core_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_4core_callback, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_callback, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_callback, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_callback, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_8callback_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_io(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventIOObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_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_4core_io(PyObject *o) {
  struct PyGeventIOObject *p = (struct PyGeventIOObject *)o;
  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_4core_2io_13__dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(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);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_io(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventIOObject *p = (struct PyGeventIOObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_io(PyObject *o) {
  struct PyGeventIOObject *p = (struct PyGeventIOObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_2io_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_2io_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_2io_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_2io_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_2io_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_2io_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_2io_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_2io_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_2io_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_2io_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_2io_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_2io_fd(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_2fd_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_2io_fd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_2io_2fd_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_2io_events(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_6events_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_2io_events(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_2io_6events_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_2io_events_str(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_10events_str_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_2io_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_2io_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_2io_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_2io_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_2io_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_2io_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_2io_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_2io_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_2io__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_2io_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_io[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_2io_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_2io_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_2io_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_format"), (PyCFunction)__pyx_pw_6gevent_4core_2io_9_format, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_io[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_2io_ref, __pyx_setprop_6gevent_4core_2io_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_2io_callback, __pyx_setprop_6gevent_4core_2io_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_2io_priority, __pyx_setprop_6gevent_4core_2io_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_2io_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_2io_pending, 0, 0, 0},
  {(char *)"fd", __pyx_getprop_6gevent_4core_2io_fd, __pyx_setprop_6gevent_4core_2io_fd, 0, 0},
  {(char *)"events", __pyx_getprop_6gevent_4core_2io_events, __pyx_setprop_6gevent_4core_2io_events, 0, 0},
  {(char *)"events_str", __pyx_getprop_6gevent_4core_2io_events_str, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_2io_loop, __pyx_setprop_6gevent_4core_2io_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_2io_args, __pyx_setprop_6gevent_4core_2io_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_2io__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventIO_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.io"), /*tp_name*/
  sizeof(struct PyGeventIOObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_io, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_io, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_io, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_io, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_io, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_2io_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core_async(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct PyGeventAsyncObject *p;
  PyObject *o = __pyx_tp_new_6gevent_4core_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_4core_async(PyObject *o) {
  struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->loop);
  Py_CLEAR(p->_callback);
  Py_CLEAR(p->args);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_6gevent_4core_watcher(o);
}

static int __pyx_tp_traverse_6gevent_4core_async(PyObject *o, visitproc v, void *a) {
  int e;
  struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o;
  e = ((likely(__pyx_ptype_6gevent_4core_watcher)) ? ((__pyx_ptype_6gevent_4core_watcher->tp_traverse) ? __pyx_ptype_6gevent_4core_watcher->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_6gevent_4core_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_4core_async(PyObject *o) {
  struct PyGeventAsyncObject *p = (struct PyGeventAsyncObject *)o;
  PyObject* tmp;
  if (likely(__pyx_ptype_6gevent_4core_watcher)) { if (__pyx_ptype_6gevent_4core_watcher->tp_clear) __pyx_ptype_6gevent_4core_watcher->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_6gevent_4core_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_4core_5async_ref(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5async_3ref_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5async_ref(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5async_3ref_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5async_callback(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5async_8callback_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5async_callback(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5async_8callback_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5async_priority(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5async_8priority_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5async_priority(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5async_8priority_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5async_active(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5async_6active_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5async_pending(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5async_7pending_1__get__(o);
}

static PyObject *__pyx_getprop_6gevent_4core_5async_loop(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5async_4loop_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5async_loop(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5async_4loop_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_5async_4loop_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5async_args(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5async_4args_1__get__(o);
}

static int __pyx_setprop_6gevent_4core_5async_args(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_6gevent_4core_5async_4args_3__set__(o, v);
  }
  else {
    return __pyx_pw_6gevent_4core_5async_4args_5__del__(o);
  }
}

static PyObject *__pyx_getprop_6gevent_4core_5async__flags(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_6gevent_4core_5async_6_flags_1__get__(o);
}

static PyMethodDef __pyx_methods_6gevent_4core_async[] = {
  {__Pyx_NAMESTR("stop"), (PyCFunction)__pyx_pw_6gevent_4core_5async_1stop, METH_NOARGS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("feed"), (PyCFunction)__pyx_pw_6gevent_4core_5async_3feed, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("start"), (PyCFunction)__pyx_pw_6gevent_4core_5async_5start, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("send"), (PyCFunction)__pyx_pw_6gevent_4core_5async_9send, METH_NOARGS, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6gevent_4core_async[] = {
  {(char *)"ref", __pyx_getprop_6gevent_4core_5async_ref, __pyx_setprop_6gevent_4core_5async_ref, 0, 0},
  {(char *)"callback", __pyx_getprop_6gevent_4core_5async_callback, __pyx_setprop_6gevent_4core_5async_callback, 0, 0},
  {(char *)"priority", __pyx_getprop_6gevent_4core_5async_priority, __pyx_setprop_6gevent_4core_5async_priority, 0, 0},
  {(char *)"active", __pyx_getprop_6gevent_4core_5async_active, 0, 0, 0},
  {(char *)"pending", __pyx_getprop_6gevent_4core_5async_pending, 0, 0, 0},
  {(char *)"loop", __pyx_getprop_6gevent_4core_5async_loop, __pyx_setprop_6gevent_4core_5async_loop, 0, 0},
  {(char *)"args", __pyx_getprop_6gevent_4core_5async_args, __pyx_setprop_6gevent_4core_5async_args, 0, 0},
  {(char *)"_flags", __pyx_getprop_6gevent_4core_5async__flags, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

DL_EXPORT(PyTypeObject) PyGeventAsync_Type = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core.async"), /*tp_name*/
  sizeof(struct PyGeventAsyncObject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core_async, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_6gevent_4core_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_4core_async, /*tp_traverse*/
  __pyx_tp_clear_6gevent_4core_async, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6gevent_4core_async, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6gevent_4core_async, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_6gevent_4core_5async_7__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6gevent_4core_async, /*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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyObject *__pyx_tp_new_6gevent_4core__EVENTSType(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  o = (*t->tp_alloc)(t, 0);
  if (unlikely(!o)) return 0;
  return o;
}

static void __pyx_tp_dealloc_6gevent_4core__EVENTSType(PyObject *o) {
  (*Py_TYPE(o)->tp_free)(o);
}

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

static PyTypeObject __pyx_type_6gevent_4core__EVENTSType = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("gevent.core._EVENTSType"), /*tp_name*/
  sizeof(struct __pyx_obj_6gevent_4core__EVENTSType), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6gevent_4core__EVENTSType, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #else
  0, /*reserved*/
  #endif
  __pyx_pw_6gevent_4core_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_4core__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_4core__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*/
  #if PY_VERSION_HEX >= 0x02060000
  0, /*tp_version_tag*/
  #endif
  #if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("_flags_to_list"), (PyCFunction)__pyx_pw_6gevent_4core_5_flags_to_list, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_flags_to_int"), (PyCFunction)__pyx_pw_6gevent_4core_7_flags_to_int, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_check_flags"), (PyCFunction)__pyx_pw_6gevent_4core_9_check_flags, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("_events_to_str"), (PyCFunction)__pyx_pw_6gevent_4core_11_events_to_str, METH_O, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("set_syserr_cb"), (PyCFunction)__pyx_pw_6gevent_4core_21set_syserr_cb, METH_O, __Pyx_DOCSTR(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
    __Pyx_NAMESTR("core"),
    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_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 1, 0},
  {&__pyx_kp_s_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 0, 1, 0},
  {&__pyx_kp_s_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 0, 1, 0},
  {&__pyx_kp_s_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 0, 1, 0},
  {&__pyx_n_s_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_132, __pyx_k_132, sizeof(__pyx_k_132), 0, 0, 1, 0},
  {&__pyx_n_s_134, __pyx_k_134, sizeof(__pyx_k_134), 0, 0, 1, 1},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  {&__pyx_kp_s_136, __pyx_k_136, sizeof(__pyx_k_136), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_140, __pyx_k_140, sizeof(__pyx_k_140), 0, 0, 1, 0},
  {&__pyx_n_s_142, __pyx_k_142, sizeof(__pyx_k_142), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_n_s_146, __pyx_k_146, sizeof(__pyx_k_146), 0, 0, 1, 1},
  {&__pyx_kp_s_148, __pyx_k_148, sizeof(__pyx_k_148), 0, 0, 1, 0},
  {&__pyx_n_s_149, __pyx_k_149, sizeof(__pyx_k_149), 0, 0, 1, 1},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_n_s_137, __pyx_k_137, sizeof(__pyx_k_137), 0, 0, 1, 1},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_139, __pyx_k_139, sizeof(__pyx_k_139), 0, 0, 1, 0},
  {&__pyx_n_s_141, __pyx_k_141, sizeof(__pyx_k_141), 0, 0, 1, 1},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_143, __pyx_k_143, sizeof(__pyx_k_143), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 0},
  {&__pyx_n_s_153, __pyx_k_153, sizeof(__pyx_k_153), 0, 0, 1, 1},
  {&__pyx_kp_s_155, __pyx_k_155, sizeof(__pyx_k_155), 0, 0, 1, 0},
  {&__pyx_n_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 1},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_n_s_144, __pyx_k_144, sizeof(__pyx_k_144), 0, 0, 1, 1},
  {&__pyx_n_s_150, __pyx_k_150, sizeof(__pyx_k_150), 0, 0, 1, 1},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_152, __pyx_k_152, sizeof(__pyx_k_152), 0, 0, 1, 0},
  {&__pyx_n_s_154, __pyx_k_154, sizeof(__pyx_k_154), 0, 0, 1, 1},
  {&__pyx_kp_s_156, __pyx_k_156, sizeof(__pyx_k_156), 0, 0, 1, 0},
  {&__pyx_n_s_157, __pyx_k_157, sizeof(__pyx_k_157), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_n_s_145, __pyx_k_145, sizeof(__pyx_k_145), 0, 0, 1, 1},
  {&__pyx_n_s_151, __pyx_k_151, sizeof(__pyx_k_151), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_n_s_162, __pyx_k_162, sizeof(__pyx_k_162), 0, 0, 1, 1},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_n_s_163, __pyx_k_163, sizeof(__pyx_k_163), 0, 0, 1, 1},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
  {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
  {&__pyx_kp_s_3, __pyx_k_3, sizeof(__pyx_k_3), 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_42, __pyx_k_42, sizeof(__pyx_k_42), 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_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
  {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
  {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
  {&__pyx_kp_s_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 0, 1, 0},
  {&__pyx_kp_s_47, __pyx_k_47, sizeof(__pyx_k_47), 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(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 0, 1, 0},
#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))
  {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
  {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && 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)) || (defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
#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(LIBEV_EMBED))
  {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 0},
#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))
  {&__pyx_kp_s_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 0, 1, 0},
  {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  {&__pyx_kp_s_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 0, 1, 0},
  {&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 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_kp_s_6, __pyx_k_6, sizeof(__pyx_k_6), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && 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))
  {&__pyx_kp_s_62, __pyx_k_62, sizeof(__pyx_k_62), 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) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  {&__pyx_kp_s_61, __pyx_k_61, sizeof(__pyx_k_61), 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) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!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))
  {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  {&__pyx_kp_s_65, __pyx_k_65, sizeof(__pyx_k_65), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  {&__pyx_kp_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 0, 1, 0},
  {&__pyx_kp_s_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_7, __pyx_k_7, sizeof(__pyx_k_7), 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(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
#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)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && 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(LIBEV_EMBED))
  {&__pyx_kp_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
  {&__pyx_kp_s_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 0, 1, 0},
#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))
  {&__pyx_kp_s_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__pyx_kp_s_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_97, __pyx_k_97, sizeof(__pyx_k_97), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_95, __pyx_k_95, sizeof(__pyx_k_95), 0, 0, 1, 0},
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  {&__pyx_kp_s_98, __pyx_k_98, sizeof(__pyx_k_98), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  {&__pyx_kp_s_96, __pyx_k_96, sizeof(__pyx_k_96), 0, 0, 1, 0},
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  {&__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_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_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_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__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__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_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_n_s___IOFDSET, __pyx_k___IOFDSET, sizeof(__pyx_k___IOFDSET), 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____all__, __pyx_k____all__, sizeof(__pyx_k____all__), 0, 0, 1, 1},
  {&__pyx_n_s____builtins__, __pyx_k____builtins__, sizeof(__pyx_k____builtins__), 0, 0, 1, 1},
  {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
  {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
  {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
  {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
  {&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1},
  {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
  {&__pyx_n_s___events, __pyx_k___events, sizeof(__pyx_k___events), 0, 0, 1, 1},
  {&__pyx_n_s___flags, __pyx_k___flags, sizeof(__pyx_k___flags), 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___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___handle_syserr, __pyx_k___handle_syserr, sizeof(__pyx_k___handle_syserr), 0, 0, 1, 1},
  {&__pyx_n_s___stop_watchers, __pyx_k___stop_watchers, sizeof(__pyx_k___stop_watchers), 0, 0, 1, 1},
  {&__pyx_n_s__active, __pyx_k__active, sizeof(__pyx_k__active), 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__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__args, __pyx_k__args, sizeof(__pyx_k__args), 0, 0, 1, 1},
  {&__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__callback, __pyx_k__callback, sizeof(__pyx_k__callback), 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__default, __pyx_k__default, sizeof(__pyx_k__default), 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__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_n_s__events, __pyx_k__events, sizeof(__pyx_k__events), 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(LIBEV_EMBED))
  {&__pyx_n_s__fileno, __pyx_k__fileno, sizeof(__pyx_k__fileno), 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__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 0, 0, 1, 1},
  {&__pyx_n_s__forkcheck, __pyx_k__forkcheck, sizeof(__pyx_k__forkcheck), 0, 0, 1, 1},
  {&__pyx_n_s__func, __pyx_k__func, sizeof(__pyx_k__func), 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__handle_error, __pyx_k__handle_error, sizeof(__pyx_k__handle_error), 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_n_s__interval, __pyx_k__interval, sizeof(__pyx_k__interval), 0, 0, 1, 1},
  {&__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_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__message, __pyx_k__message, sizeof(__pyx_k__message), 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_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_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},
#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_n_s__ptr, __pyx_k__ptr, sizeof(__pyx_k__ptr), 0, 0, 1, 1},
  {&__pyx_n_s__ref, __pyx_k__ref, sizeof(__pyx_k__ref), 0, 0, 1, 1},
  {&__pyx_n_s__repeat, __pyx_k__repeat, sizeof(__pyx_k__repeat), 0, 0, 1, 1},
  {&__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_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},
#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__sorted, __pyx_k__sorted, sizeof(__pyx_k__sorted), 0, 0, 1, 1},
  {&__pyx_n_s__split, __pyx_k__split, sizeof(__pyx_k__split), 0, 0, 1, 1},
  {&__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__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 = 8; __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 = 166; __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 = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_sorted = __Pyx_GetBuiltinName(__pyx_n_s__sorted); if (!__pyx_builtin_sorted) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __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 = 173; __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 = 261; __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 = 412; __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 = 539; __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 = 737; __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 = 761; __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/core.pyx":161
 *     try:
 *         if isinstance(flags, basestring):
 *             flags = flags.split(',')             # <<<<<<<<<<<<<<
 *         for value in flags:
 *             value = value.strip().lower()
 */
  __pyx_k_tuple_4 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_3)); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_4);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));

/* "gevent/core.pyx":362
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         cdef unsigned int flags = 0
 *         if nowait:
 */
  __pyx_k_tuple_17 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_17);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));

/* "gevent/core.pyx":378
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_ref(self._ptr)
 *
 */
  __pyx_k_tuple_18 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_18);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));

/* "gevent/core.pyx":384
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_unref(self._ptr)
 *
 */
  __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_19);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));

/* "gevent/core.pyx":390
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_break(self._ptr, how)
 *
 */
  __pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_21);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));

/* "gevent/core.pyx":396
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_verify(self._ptr)
 *
 */
  __pyx_k_tuple_22 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_22);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));

/* "gevent/core.pyx":402
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         return libev.ev_now(self._ptr)
 *
 */
  __pyx_k_tuple_23 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_23);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));

/* "gevent/core.pyx":408
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_now_update(self._ptr)
 *
 */
  __pyx_k_tuple_24 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_24);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));

/* "gevent/core.pyx":419
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return True if libev.ev_is_default_loop(self._ptr) else False
 *
 */
  __pyx_k_tuple_26 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_26);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));

/* "gevent/core.pyx":427
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_iteration(self._ptr)
 *
 */
  __pyx_k_tuple_27 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_27);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));

/* "gevent/core.pyx":435
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_depth(self._ptr)
 *
 */
  __pyx_k_tuple_28 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_28);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_28));

/* "gevent/core.pyx":443
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_backend(self._ptr)
 *
 */
  __pyx_k_tuple_29 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_29);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));

/* "gevent/core.pyx":451
 *
 *             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_k_tuple_30 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_30);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));

/* "gevent/core.pyx":463
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return libev.ev_pending_count(self._ptr)
 *
 */
  __pyx_k_tuple_31 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_31);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));

/* "gevent/core.pyx":512
 *
 *         if not self._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         cdef callback cb = callback(func, args)
 *         self._callbacks.append(cb)
 */
#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_k_tuple_42 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_42);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));
#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_k_tuple_41 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_41);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))

/* "gevent/core.pyx":565
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.activecnt
 *
 */
#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_k_tuple_49 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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_k_tuple_48 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 565; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_48);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_48));

/* "gevent/core.pyx":573
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sig_pending
 *
 */
  __pyx_k_tuple_49 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_49);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_49));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":573
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sig_pending
 *
 */
  __pyx_k_tuple_50 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 573; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":591
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return _flags_to_list(self._ptr.origflags)
 *
 */
  __pyx_k_tuple_50 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __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/core.pyx":582
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sigfd
 *
 */
  __pyx_k_tuple_50 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_50);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_50));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":591
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return _flags_to_list(self._ptr.origflags)
 *
 */
  __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
/* "gevent/core.pyx":599
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.origflags
 *
 */
  __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __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/core.pyx":582
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.sigfd
 *
 */
  __pyx_k_tuple_51 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_51);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_51));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":599
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.origflags
 *
 */
  __pyx_k_tuple_52 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
/* "gevent/core.pyx":591
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return _flags_to_list(self._ptr.origflags)
 *
 */
  __pyx_k_tuple_52 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_52);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_52));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && 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(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD)
/* "gevent/core.pyx":715
 *
 *             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) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_54 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_54);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_53 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __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/core.pyx":599
 *
 *             if not self._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             return self._ptr.origflags
 *
 */
  __pyx_k_tuple_53 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __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(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_53);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));
#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)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/core.pyx":743
 *
 *         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)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_56 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_56);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_56));
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_55 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_55);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_55));
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))

/* "gevent/core.pyx":761
 *         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)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_58 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __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_k_tuple_57 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_57);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));

/* "gevent/core.pyx":767
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_58 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_58);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":767
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_59 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_59);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_59));

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/core.pyx":781
 *
 *         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)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_61 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __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(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_61 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_61);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_61));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_60 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __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_k_tuple_60 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_60);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/core.pyx":783
 *             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)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_63 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __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(LIBEV_EMBED) && defined(_WIN32))

#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)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/core.pyx":743
 *
 *         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(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_63 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_63);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_63));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_62 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __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_k_tuple_62 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __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/core.pyx":715
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_62 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; __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_k_tuple_62);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));
#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(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/core.pyx":849
 *         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)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_68 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_67)); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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_k_tuple_66 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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(LIBEV_EMBED) && defined(_WIN32))

#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)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/core.pyx":761
 *         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(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_65 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
  __pyx_k_tuple_64 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __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/core.pyx":743
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_64 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __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(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_64);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));

#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))
/* "gevent/core.pyx":767
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_65 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __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(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_65);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":767
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_66 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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))
/* "gevent/core.pyx":761
 *         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_k_tuple_66 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 761; __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(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_66);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_66));

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":861
 *         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_k_tuple_68 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_67)); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __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(LIBEV_EMBED))
/* "gevent/core.pyx":781
 *
 *         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(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_68 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_68);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":861
 *         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_k_tuple_70 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __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/core.pyx":900
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_70 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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_k_tuple_67 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __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/core.pyx":767
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_67 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; __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(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_67);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));

#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))
/* "gevent/core.pyx":781
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_69 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_69);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
/* "gevent/core.pyx":783
 *             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)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_70 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_70);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":900
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_72 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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/core.pyx":928
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_71 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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_k_tuple_71 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __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(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_71);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_71));

#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))
/* "gevent/core.pyx":946
 *         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_k_tuple_72 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_72);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":928
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_73 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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/core.pyx":952
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_73 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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_k_tuple_69 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_69);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/core.pyx":849
 *         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 /* (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_73 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_72)); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_73);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":946
 *         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_k_tuple_74 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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_k_tuple_74 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_73)); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_74);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));

#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))
/* "gevent/core.pyx":952
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_75 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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/core.pyx":966
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_75 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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/core.pyx":849
 *         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_k_tuple_75 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_74)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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_k_tuple_76 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_75)); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __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/core.pyx":861
 *         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_k_tuple_76 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_75)); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_76);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":861
 *         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) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_75 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_74)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD)
  __Pyx_GOTREF(__pyx_k_tuple_75);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));

#endif /* (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":966
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_77 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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/core.pyx":861
 *         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_k_tuple_77 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_76)); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __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))
/* "gevent/core.pyx":900
 *
 *             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)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_77 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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_k_tuple_77);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/core.pyx":968
 *             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)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_78 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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/core.pyx":928
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_78 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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_k_tuple_78 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_77)); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __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_k_tuple_78 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_78)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_78);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_78));
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_76 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_76);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))

/* "gevent/core.pyx":1014
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_82 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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_k_tuple_80 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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))

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":900
 *
 *             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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_79 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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/core.pyx":946
 *         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_k_tuple_79 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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/core.pyx":928
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_79 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_79);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":928
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_80 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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/core.pyx":952
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_80 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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_k_tuple_80 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __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/core.pyx":946
 *         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_k_tuple_80 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_80)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_80);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_80));

#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))
/* "gevent/core.pyx":1045
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_81 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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/core.pyx":946
 *         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_k_tuple_81 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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/core.pyx":928
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_81 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; __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/core.pyx":952
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_81 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_81);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81));

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":1073
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_82 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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/core.pyx":952
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_82 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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))
/* "gevent/core.pyx":966
 *
 *         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)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_82 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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/core.pyx":946
 *         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_k_tuple_82 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_82)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 946; __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)
  __Pyx_GOTREF(__pyx_k_tuple_82);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_82));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1045
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_83 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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/core.pyx":1091
 *         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_k_tuple_83 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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/core.pyx":968
 *             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_k_tuple_83 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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/core.pyx":952
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_83 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 952; __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_k_tuple_83 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_83)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_83);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_83));

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1073
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_84 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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/core.pyx":1097
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_84 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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))
/* "gevent/core.pyx":966
 *
 *         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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_84 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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/core.pyx":968
 *             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_k_tuple_84 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_84)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_84);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_84));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1091
 *         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_k_tuple_85 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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/core.pyx":1111
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_85 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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/core.pyx":968
 *             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_k_tuple_85 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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_k_tuple_85 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_85)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 966; __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(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_85);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_85));

#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) && !defined(_WIN32))
/* "gevent/core.pyx":1097
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_86 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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/core.pyx":1113
 *             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_k_tuple_86 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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/core.pyx":968
 *             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_k_tuple_86 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_86)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 968; __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(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_86);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_86));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1111
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_87 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
/* "gevent/core.pyx":1014
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
#endif /* (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_87 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_87)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_87);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_87));

#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))
/* "gevent/core.pyx":1113
 *             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_k_tuple_88 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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/core.pyx":1045
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_88 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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_k_tuple_88 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_88)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_88);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_88));

#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))
/* "gevent/core.pyx":1170
 *
 *             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)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_91 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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_k_tuple_89 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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/core.pyx":1014
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_89 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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/core.pyx":1073
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_89 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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/core.pyx":1045
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_89 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_89)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_89);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_89));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":1198
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_90 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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/core.pyx":1045
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_90 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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/core.pyx":1091
 *         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_k_tuple_90 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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_k_tuple_90 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1014; __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/core.pyx":1073
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_90 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_90)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_90);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_90));

#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))
/* "gevent/core.pyx":1216
 *         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_k_tuple_91 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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/core.pyx":1073
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_91 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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/core.pyx":1097
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_91 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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/core.pyx":1045
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_91 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1045; __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/core.pyx":1091
 *         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_k_tuple_91 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_91)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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_k_tuple_91);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_91));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1198
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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/core.pyx":1222
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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/core.pyx":1091
 *         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_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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/core.pyx":1111
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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/core.pyx":1073
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __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/core.pyx":1097
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_92 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_92)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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_k_tuple_92);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_92));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1216
 *         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_k_tuple_93 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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/core.pyx":1236
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_93 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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/core.pyx":1097
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_93 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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/core.pyx":1113
 *             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_k_tuple_93 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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/core.pyx":1091
 *         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_k_tuple_93 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; __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/core.pyx":1111
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_93 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_93)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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_k_tuple_93);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_93));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1222
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_94 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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/core.pyx":1238
 *             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_k_tuple_94 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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/core.pyx":1111
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_94 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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/core.pyx":1097
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_94 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __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/core.pyx":1113
 *             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_k_tuple_94 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_94)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_94);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_94));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1236
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_95 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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/core.pyx":1113
 *             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_k_tuple_95 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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/core.pyx":1111
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_95 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_95)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __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_k_tuple_95);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_95));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1238
 *             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_k_tuple_96 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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/core.pyx":1289
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_96 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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))
/* "gevent/core.pyx":1170
 *
 *             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)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_96 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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/core.pyx":1113
 *             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_k_tuple_96 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_96)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __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(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_96);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_96));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1289
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_98 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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/core.pyx":1317
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_97 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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/core.pyx":1198
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_97 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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_k_tuple_97 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_97)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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_k_tuple_97);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_97));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":1335
 *         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_k_tuple_98 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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))
/* "gevent/core.pyx":1170
 *
 *             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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_98 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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/core.pyx":1216
 *         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_k_tuple_98 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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/core.pyx":1198
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_98 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_98)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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)
  __Pyx_GOTREF(__pyx_k_tuple_98);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_98));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1317
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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/core.pyx":1341
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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/core.pyx":1198
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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/core.pyx":1222
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; __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/core.pyx":1216
 *         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_k_tuple_99 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_99)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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_k_tuple_99);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_99));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1335
 *         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_k_tuple_100 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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/core.pyx":1355
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_100 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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/core.pyx":1216
 *         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_k_tuple_100 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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/core.pyx":1236
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_100 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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/core.pyx":1198
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_100 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1198; __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/core.pyx":1222
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_100 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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_k_tuple_100);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_100));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1341
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_101 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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/core.pyx":1357
 *             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_k_tuple_101 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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/core.pyx":1222
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_101 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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/core.pyx":1238
 *             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_k_tuple_101 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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/core.pyx":1216
 *         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_k_tuple_101 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; __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/core.pyx":1236
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_101 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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_k_tuple_101);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_101));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1355
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_102 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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/core.pyx":1236
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_102 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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/core.pyx":1222
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_102 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; __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/core.pyx":1238
 *             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_k_tuple_102 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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_k_tuple_102);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_102));

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1357
 *             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_k_tuple_103 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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/core.pyx":1408
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_103 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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/core.pyx":1238
 *             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_k_tuple_103 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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))
/* "gevent/core.pyx":1289
 *
 *             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)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_103 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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/core.pyx":1236
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_103 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_103)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; __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)
  __Pyx_GOTREF(__pyx_k_tuple_103);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_103));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1408
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_105 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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/core.pyx":1436
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_104 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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/core.pyx":1317
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_104 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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/core.pyx":1238
 *             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_k_tuple_104 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __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_k_tuple_104 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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_k_tuple_104);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_104));

#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":1454
 *         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_k_tuple_105 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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))
/* "gevent/core.pyx":1289
 *
 *             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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_105 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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/core.pyx":1335
 *         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_k_tuple_105 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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/core.pyx":1317
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_105 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_105)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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)
  __Pyx_GOTREF(__pyx_k_tuple_105);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_105));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1436
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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/core.pyx":1460
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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/core.pyx":1317
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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/core.pyx":1341
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; __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/core.pyx":1335
 *         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_k_tuple_106 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_106)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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_k_tuple_106);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_106));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1454
 *         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_k_tuple_107 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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/core.pyx":1474
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_107 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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/core.pyx":1335
 *         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_k_tuple_107 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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/core.pyx":1355
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_107 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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/core.pyx":1317
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_107 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __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/core.pyx":1341
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_107 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_107)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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_k_tuple_107);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_107));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1460
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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/core.pyx":1476
 *             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_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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/core.pyx":1341
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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/core.pyx":1357
 *             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_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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/core.pyx":1335
 *         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_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __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/core.pyx":1355
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_108 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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_k_tuple_108);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_108));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1474
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_109 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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/core.pyx":1355
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_109 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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/core.pyx":1341
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_109 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; __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/core.pyx":1357
 *             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_k_tuple_109 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_109)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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_k_tuple_109);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_109));

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1476
 *             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_k_tuple_110 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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/core.pyx":1527
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_110 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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/core.pyx":1357
 *             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_k_tuple_110 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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))
/* "gevent/core.pyx":1408
 *
 *             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)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_110 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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/core.pyx":1355
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_110 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_110)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1355; __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)
  __Pyx_GOTREF(__pyx_k_tuple_110);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_110));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1527
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_112 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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/core.pyx":1555
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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/core.pyx":1436
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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/core.pyx":1357
 *             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_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; __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_k_tuple_111 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_111)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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_k_tuple_111);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_111));

#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":1573
 *         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_k_tuple_112 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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))
/* "gevent/core.pyx":1408
 *
 *             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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_112 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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/core.pyx":1454
 *         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_k_tuple_112 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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/core.pyx":1436
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_112 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_112)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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)
  __Pyx_GOTREF(__pyx_k_tuple_112);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_112));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1555
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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/core.pyx":1579
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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/core.pyx":1436
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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/core.pyx":1460
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; __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/core.pyx":1454
 *         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_k_tuple_113 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_113)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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_k_tuple_113);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_113));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1573
 *         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_k_tuple_114 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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/core.pyx":1593
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_114 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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/core.pyx":1454
 *         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_k_tuple_114 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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/core.pyx":1474
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_114 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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/core.pyx":1436
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_114 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1436; __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/core.pyx":1460
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_114 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_114)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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_k_tuple_114);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_114));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1579
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_115 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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/core.pyx":1595
 *             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_k_tuple_115 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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/core.pyx":1460
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_115 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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/core.pyx":1476
 *             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_k_tuple_115 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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/core.pyx":1454
 *         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_k_tuple_115 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; __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/core.pyx":1474
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_115 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_115)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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_k_tuple_115);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_115));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1593
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_116 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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/core.pyx":1474
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_116 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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/core.pyx":1460
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_116 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1460; __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/core.pyx":1476
 *             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_k_tuple_116 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_116)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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_k_tuple_116);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_116));

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1595
 *             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_k_tuple_117 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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/core.pyx":1646
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_117 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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/core.pyx":1476
 *             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_k_tuple_117 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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))
/* "gevent/core.pyx":1527
 *
 *             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)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_117 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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/core.pyx":1474
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_117 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_117)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1474; __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)
  __Pyx_GOTREF(__pyx_k_tuple_117);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_117));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1646
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_119 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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/core.pyx":1674
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_118 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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/core.pyx":1555
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_118 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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/core.pyx":1476
 *             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_k_tuple_118 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1476; __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_k_tuple_118 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_118)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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_k_tuple_118);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_118));

#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":1692
 *         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_k_tuple_119 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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))
/* "gevent/core.pyx":1527
 *
 *             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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_119 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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/core.pyx":1573
 *         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_k_tuple_119 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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/core.pyx":1555
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_119 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_119)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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)
  __Pyx_GOTREF(__pyx_k_tuple_119);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_119));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1674
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_120 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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/core.pyx":1698
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_120 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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/core.pyx":1555
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_120 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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/core.pyx":1579
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_120 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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_k_tuple_120 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; __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/core.pyx":1573
 *         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_k_tuple_120 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_120)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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_k_tuple_120);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_120));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1692
 *         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_k_tuple_121 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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/core.pyx":1712
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_121 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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/core.pyx":1573
 *         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_k_tuple_121 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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/core.pyx":1593
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_121 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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/core.pyx":1555
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_121 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; __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/core.pyx":1579
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_121 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_121)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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_k_tuple_121);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_121));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1698
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_122 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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/core.pyx":1714
 *             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_k_tuple_122 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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/core.pyx":1579
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_122 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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/core.pyx":1595
 *             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_k_tuple_122 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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/core.pyx":1573
 *         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_k_tuple_122 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1573; __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/core.pyx":1593
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_122 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_122)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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_k_tuple_122);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_122));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1712
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_123 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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/core.pyx":1593
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_123 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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/core.pyx":1579
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_123 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1579; __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/core.pyx":1595
 *             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_k_tuple_123 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_123)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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_k_tuple_123);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_123));

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1714
 *             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_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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/core.pyx":1749
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)
 *
 */
  __pyx_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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/core.pyx":1595
 *             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_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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))
/* "gevent/core.pyx":1646
 *
 *             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)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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/core.pyx":1593
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_124 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_124)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1593; __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)
  __Pyx_GOTREF(__pyx_k_tuple_124);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_124));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1749
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         libev.ev_async_send(self.loop._ptr, &self._watcher)
 *
 */
  __pyx_k_tuple_126 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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/core.pyx":1917
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_125 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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/core.pyx":1674
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_125 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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/core.pyx":1595
 *             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_k_tuple_125 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; __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_k_tuple_125 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_125)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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_k_tuple_125);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_125));

#endif /* (!EV_USE_SIGNALFD && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
/* "gevent/core.pyx":1945
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_126 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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))
/* "gevent/core.pyx":1646
 *
 *             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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_126 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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/core.pyx":1692
 *         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_k_tuple_126 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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/core.pyx":1674
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_126 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_126)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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)
  __Pyx_GOTREF(__pyx_k_tuple_126);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_126));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1772
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __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/core.pyx":1963
 *         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_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_56)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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/core.pyx":1674
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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/core.pyx":1698
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1646; __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/core.pyx":1692
 *         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_k_tuple_127 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_127)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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_k_tuple_127);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_127));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1800
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __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/core.pyx":1969
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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/core.pyx":1692
 *         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_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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/core.pyx":1712
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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/core.pyx":1674
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1674; __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/core.pyx":1698
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_128 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_128)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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_k_tuple_128);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_128));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1818
 *         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_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __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/core.pyx":1983
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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/core.pyx":1698
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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/core.pyx":1714
 *             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_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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/core.pyx":1692
 *         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_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; __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/core.pyx":1712
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_129 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_129)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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_k_tuple_129);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_129));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1824
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_130 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __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/core.pyx":1985
 *             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_k_tuple_130 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_61)); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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/core.pyx":1712
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_130 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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/core.pyx":1698
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_130 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1698; __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/core.pyx":1714
 *             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_k_tuple_130 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_130)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_130);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_130));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1838
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_131 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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/core.pyx":1714
 *             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_k_tuple_131 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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))
/* "gevent/core.pyx":1749
 *
 *         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) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_131 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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/core.pyx":1712
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_131 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_131)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1712; __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(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_131);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_131));

#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1840
 *             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_k_tuple_132 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __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/core.pyx":1917
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_132 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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/core.pyx":1714
 *             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_k_tuple_132 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; __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_k_tuple_132 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_132)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_132);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_132));

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1864
 *     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_k_tuple_135 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_134)); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __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))
/* "gevent/core.pyx":1749
 *
 *         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) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_133 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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/core.pyx":1945
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_133 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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/core.pyx":1917
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_133 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_133);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_133));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1772
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_134 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __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/core.pyx":1963
 *         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_k_tuple_134 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_63)); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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_k_tuple_134 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; __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/core.pyx":1945
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_134 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_134)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_134);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_134));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1800
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_135 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __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/core.pyx":1969
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_135 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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/core.pyx":1772
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_135 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1772; __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/core.pyx":1963
 *         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_k_tuple_135 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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_k_tuple_135);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_135));

#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/core.pyx":1917
 *
 *             if not self.loop._ptr:
 *                 raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *             if value:
 *                 if not self._flags & 4:
 */
  __pyx_k_tuple_137 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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/core.pyx":1818
 *         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_k_tuple_136 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __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/core.pyx":1983
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_136 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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/core.pyx":1800
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_136 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1800; __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/core.pyx":1969
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_136 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_136)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_k_tuple_136);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_136));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1824
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_137 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __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/core.pyx":1985
 *             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_k_tuple_137 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_68)); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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/core.pyx":1818
 *         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_k_tuple_137 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; __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/core.pyx":1983
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_137 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_137)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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_k_tuple_137);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_137));

#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/core.pyx":1945
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_138 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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/core.pyx":1838
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_138 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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/core.pyx":1824
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_138 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1824; __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/core.pyx":1985
 *             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_k_tuple_138 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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_k_tuple_138);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_138));

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1963
 *         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_k_tuple_139 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_57)); if (unlikely(!__pyx_k_tuple_139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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/core.pyx":1840
 *             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_k_tuple_139 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __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/core.pyx":1838
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_139 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1838; __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_k_tuple_139);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_139));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1969
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_140 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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))
/* "gevent/core.pyx":8
 * import sys
 * # Work around lack of absolute_import in Cython
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * import traceback
 * import signal as signalmodule
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_140 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__os)); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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/core.pyx":1840
 *             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_k_tuple_140 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1840; __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(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_140);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_140));

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) || (!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))
/* "gevent/core.pyx":1983
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_141 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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_k_tuple_141 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__os)); if (unlikely(!__pyx_k_tuple_141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_141);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_141));

#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))
/* "gevent/core.pyx":1985
 *             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_k_tuple_142 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_62)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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))
/* "gevent/core.pyx":1864
 *     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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_142 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_141)); if (unlikely(!__pyx_k_tuple_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_k_tuple_142);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_142));

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
/* "gevent/core.pyx":8
 * import sys
 * # Work around lack of absolute_import in Cython
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * import traceback
 * import signal as signalmodule
 */
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_145 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__os)); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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_k_tuple_143 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_142)); if (unlikely(!__pyx_k_tuple_143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_143);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_143));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1917
 *
 *             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)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_144 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_144)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_144);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_144));

/* "gevent/core.pyx":1945
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_145 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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_k_tuple_145 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1917; __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_k_tuple_145);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_145));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_tuple_133 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__os)); if (unlikely(!__pyx_k_tuple_133)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_133);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_133));
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))

/* "gevent/core.pyx":1963
 *         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_k_tuple_146 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_64)); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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/core.pyx":1945
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if self._flags & 2:
 *             libev.ev_ref(self.loop._ptr)
 */
  __pyx_k_tuple_146 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1945; __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_k_tuple_146);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_146));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1969
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_147 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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/core.pyx":1963
 *         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_k_tuple_147 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_65)); if (unlikely(!__pyx_k_tuple_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1963; __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_k_tuple_147);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_147));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1983
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_148 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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/core.pyx":1969
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         self.callback = callback
 *         self.args = args
 */
  __pyx_k_tuple_148 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1969; __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_k_tuple_148);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_148));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1985
 *             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_k_tuple_149 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __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/core.pyx":1983
 *
 *         if not self.loop._ptr:
 *             raise ValueError('operation on destroyed loop')             # <<<<<<<<<<<<<<
 *         if callback is None:
 *             raise TypeError('callback must be callable, not None')
 */
  __pyx_k_tuple_149 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_16)); if (unlikely(!__pyx_k_tuple_149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1983; __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_k_tuple_149);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_149));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1985
 *             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_k_tuple_150 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_70)); if (unlikely(!__pyx_k_tuple_150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_150);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_150));

#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":8
 * import sys
 * # Work around lack of absolute_import in Cython
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * import traceback
 * import signal as signalmodule
 */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_152 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__os)); if (unlikely(!__pyx_k_tuple_152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_152);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_152));
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_tuple_153 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__os)); if (unlikely(!__pyx_k_tuple_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_k_tuple_153);
  __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_153));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !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/core.pyx":91
 *
 *
 * 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_k_codeobj_147 = (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_148, __pyx_n_s__get_version, 91, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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_k_codeobj_135 = (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_136, __pyx_n_s__get_version, 91, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_135)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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_k_codeobj_154 = (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_155, __pyx_n_s__get_version, 91, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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_k_codeobj_142 = (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_143, __pyx_n_s__get_version, 91, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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_k_codeobj_155 = (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_156, __pyx_n_s__get_version, 91, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_155)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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_k_codeobj_143 = (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_144, __pyx_n_s__get_version, 91, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_143)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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/core.pyx":95
 *
 *
 * 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_k_codeobj_150 = (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_148, __pyx_n_s__get_header_version, 95, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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_k_codeobj_138 = (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_136, __pyx_n_s__get_header_version, 95, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_138)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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_k_codeobj_157 = (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_155, __pyx_n_s__get_header_version, 95, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_157)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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_k_codeobj_145 = (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_143, __pyx_n_s__get_header_version, 95, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_145)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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_k_codeobj_158 = (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_156, __pyx_n_s__get_header_version, 95, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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_k_codeobj_146 = (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_144, __pyx_n_s__get_header_version, 95, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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/core.pyx":204
 *
 *
 * 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_k_codeobj_151 = (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_148, __pyx_n_s__supported_backends, 204, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_151)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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_k_codeobj_139 = (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_136, __pyx_n_s__supported_backends, 204, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_139)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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_k_codeobj_158 = (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_155, __pyx_n_s__supported_backends, 204, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_158)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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_k_codeobj_146 = (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_143, __pyx_n_s__supported_backends, 204, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_146)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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_k_codeobj_159 = (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_156, __pyx_n_s__supported_backends, 204, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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_k_codeobj_147 = (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_144, __pyx_n_s__supported_backends, 204, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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/core.pyx":208
 *
 *
 * 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_k_codeobj_152 = (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_148, __pyx_n_s_146, 208, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_152)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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_k_codeobj_140 = (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_136, __pyx_n_s_134, 208, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_140)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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_k_codeobj_159 = (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_155, __pyx_n_s_153, 208, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_159)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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_k_codeobj_147 = (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_143, __pyx_n_s_141, 208, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_147)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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_k_codeobj_160 = (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_156, __pyx_n_s_154, 208, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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_k_codeobj_148 = (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_144, __pyx_n_s_142, 208, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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/core.pyx":212
 *
 *
 * 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_k_codeobj_153 = (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_148, __pyx_n_s__embeddable_backends, 212, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_153)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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_k_codeobj_141 = (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_136, __pyx_n_s__embeddable_backends, 212, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_141)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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_k_codeobj_160 = (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_155, __pyx_n_s__embeddable_backends, 212, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_160)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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_k_codeobj_148 = (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_143, __pyx_n_s__embeddable_backends, 212, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_148)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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_k_codeobj_161 = (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_156, __pyx_n_s__embeddable_backends, 212, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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_k_codeobj_149 = (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_144, __pyx_n_s__embeddable_backends, 212, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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/core.pyx":216
 *
 *
 * 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_k_codeobj_154 = (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_148, __pyx_n_s__time, 216, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_154)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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_k_codeobj_142 = (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_136, __pyx_n_s__time, 216, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_142)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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_k_codeobj_161 = (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_155, __pyx_n_s__time, 216, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_161)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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_k_codeobj_149 = (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_143, __pyx_n_s__time, 216, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_149)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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_k_codeobj_162 = (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_156, __pyx_n_s__time, 216, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_162)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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_k_codeobj_150 = (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_144, __pyx_n_s__time, 216, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_150)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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 initcore(void); /*proto*/
PyMODINIT_FUNC initcore(void)
#else
PyMODINIT_FUNC PyInit_core(void); /*proto*/
PyMODINIT_FUNC PyInit_core(void)
#endif
{
  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;
  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;
  int __pyx_t_18;
  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_core(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_Generator_USED
  if (__pyx_Generator_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(__Pyx_NAMESTR("core"), __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);
  #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.core")) {
      if (unlikely(PyDict_SetItemString(modules, "gevent.core", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
  }
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__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 (__Pyx_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 (unlikely(__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__core) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Constants init code ---*/
  if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Global init code ---*/
  GEVENT_CORE_EVENTS = Py_None; Py_INCREF(Py_None);
  /*--- Variable export code ---*/
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&PyGeventWatcher_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "watcher", (PyObject *)&PyGeventWatcher_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_watcher = &PyGeventWatcher_Type;
  PyGeventCheck_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventCheck_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "check", (PyObject *)&PyGeventCheck_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1391; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_check = &PyGeventCheck_Type;
  PyGeventTimer_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventTimer_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "timer", (PyObject *)&PyGeventTimer_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_timer = &PyGeventTimer_Type;
  PyGeventSignal_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventSignal_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "signal", (PyObject *)&PyGeventSignal_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_signal = &PyGeventSignal_Type;
  PyGeventFork_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventFork_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "fork", (PyObject *)&PyGeventFork_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_fork = &PyGeventFork_Type;
  PyGeventStat_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventStat_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "stat", (PyObject *)&PyGeventStat_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_stat = &PyGeventStat_Type;
  __pyx_vtabptr_6gevent_4core_loop = &__pyx_vtable_6gevent_4core_loop;
  __pyx_vtable_6gevent_4core_loop._run_callbacks = (PyObject *(*)(struct PyGeventLoopObject *))__pyx_f_6gevent_4core_4loop__run_callbacks;
  __pyx_vtable_6gevent_4core_loop.handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_4core_4loop_handle_error;
  __pyx_vtable_6gevent_4core_loop._default_handle_error = (PyObject *(*)(struct PyGeventLoopObject *, PyObject *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_6gevent_4core_4loop__default_handle_error;
  if (PyType_Ready(&PyGeventLoop_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(PyGeventLoop_Type.tp_dict, __pyx_vtabptr_6gevent_4core_loop) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "loop", (PyObject *)&PyGeventLoop_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_loop = &PyGeventLoop_Type;
  if (PyType_Ready(&__pyx_type_6gevent_4core___pyx_scope_struct__genexpr) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core___pyx_scope_struct__genexpr = &__pyx_type_6gevent_4core___pyx_scope_struct__genexpr;
  PyGeventIdle_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventIdle_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "idle", (PyObject *)&PyGeventIdle_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_idle = &PyGeventIdle_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_4core_watcher;
  if (PyType_Ready(&PyGeventChild_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "child", (PyObject *)&PyGeventChild_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_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)
  PyGeventPrepare_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventPrepare_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "prepare", (PyObject *)&PyGeventPrepare_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_prepare = &PyGeventPrepare_Type;
  if (PyType_Ready(&PyGeventCallback_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "callback", (PyObject *)&PyGeventCallback_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_callback = &PyGeventCallback_Type;
  PyGeventIO_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventIO_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "io", (PyObject *)&PyGeventIO_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 698; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_io = &PyGeventIO_Type;
  PyGeventAsync_Type.tp_base = __pyx_ptype_6gevent_4core_watcher;
  if (PyType_Ready(&PyGeventAsync_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "async", (PyObject *)&PyGeventAsync_Type) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1629; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core_async = &PyGeventAsync_Type;
  if (PyType_Ready(&__pyx_type_6gevent_4core__EVENTSType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6gevent_4core__EVENTSType = &__pyx_type_6gevent_4core__EVENTSType;
  /*--- Type import code ---*/
  /*--- Variable import code ---*/
  /*--- Function import code ---*/
  /*--- Execution code ---*/

/* "gevent/core.pyx":6
 * cimport libev
 * from python cimport *
 * import sys             # <<<<<<<<<<<<<<
 * # Work around lack of absolute_import in Cython
 * os = __import__('os', level=0)
 */
  __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__sys), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

/* "gevent/core.pyx":8
 * import sys
 * # Work around lack of absolute_import in Cython
 * os = __import__('os', level=0)             # <<<<<<<<<<<<<<
 * import traceback
 * import signal as signalmodule
 */
  __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__level), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_k_tuple_145), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_k_tuple_133), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_k_tuple_152), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_k_tuple_140), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_k_tuple_153), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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 = PyObject_Call(__pyx_builtin___import__, ((PyObject *)__pyx_k_tuple_141), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__os, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":9
 * # Work around lack of absolute_import in Cython
 * os = __import__('os', level=0)
 * import traceback             # <<<<<<<<<<<<<<
 * import signal as signalmodule
 *
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__traceback), 0, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__traceback, __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/core.pyx":10
 * os = __import__('os', level=0)
 * import traceback
 * import signal as signalmodule             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = __Pyx_Import(((PyObject *)__pyx_n_s__signal), 0, -1); 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_d, __pyx_n_s__signalmodule, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":13
 *
 *
 * __all__ = ['get_version',             # <<<<<<<<<<<<<<
 *            'get_header_version',
 *            'supported_backends',
 */
  __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__get_version));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_n_s__get_version));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__get_version));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__get_header_version));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_n_s__get_header_version));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__get_header_version));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__supported_backends));
  PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_n_s__supported_backends));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__supported_backends));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_n_s_146));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s_146));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_146));
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_n_s_134));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s_134));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_134));
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_n_s_153));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s_153));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_153));
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_n_s_141));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s_141));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_141));
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_n_s_154));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s_154));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_154));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __Pyx_INCREF(((PyObject *)__pyx_n_s_142));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_n_s_142));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s_142));
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_INCREF(((PyObject *)__pyx_n_s__embeddable_backends));
  PyList_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_n_s__embeddable_backends));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__embeddable_backends));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__time));
  PyList_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_n_s__time));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__time));
  __Pyx_INCREF(((PyObject *)__pyx_n_s__loop));
  PyList_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_n_s__loop));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__loop));
  if (PyDict_SetItem(__pyx_d, __pyx_n_s____all__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

/* "gevent/core.pyx":45
 *
 *
 * UNDEF = libev.EV_UNDEF             # <<<<<<<<<<<<<<
 * NONE = libev.EV_NONE
 * READ = libev.EV_READ
 */
  __pyx_t_2 = PyInt_FromLong(EV_UNDEF); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __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 = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":46
 *
 * UNDEF = libev.EV_UNDEF
 * NONE = libev.EV_NONE             # <<<<<<<<<<<<<<
 * READ = libev.EV_READ
 * WRITE = libev.EV_WRITE
 */
  __pyx_t_2 = PyInt_FromLong(EV_NONE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __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 = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":47
 * UNDEF = libev.EV_UNDEF
 * NONE = libev.EV_NONE
 * READ = libev.EV_READ             # <<<<<<<<<<<<<<
 * WRITE = libev.EV_WRITE
 * TIMER = libev.EV_TIMER
 */
  __pyx_t_2 = PyInt_FromLong(EV_READ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __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 = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":48
 * NONE = libev.EV_NONE
 * READ = libev.EV_READ
 * WRITE = libev.EV_WRITE             # <<<<<<<<<<<<<<
 * TIMER = libev.EV_TIMER
 * PERIODIC = libev.EV_PERIODIC
 */
  __pyx_t_2 = PyInt_FromLong(EV_WRITE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __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 = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":49
 * READ = libev.EV_READ
 * WRITE = libev.EV_WRITE
 * TIMER = libev.EV_TIMER             # <<<<<<<<<<<<<<
 * PERIODIC = libev.EV_PERIODIC
 * SIGNAL = libev.EV_SIGNAL
 */
  __pyx_t_2 = PyInt_FromLong(EV_TIMER); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __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 = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":50
 * WRITE = libev.EV_WRITE
 * TIMER = libev.EV_TIMER
 * PERIODIC = libev.EV_PERIODIC             # <<<<<<<<<<<<<<
 * SIGNAL = libev.EV_SIGNAL
 * CHILD = libev.EV_CHILD
 */
  __pyx_t_2 = PyInt_FromLong(EV_PERIODIC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __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 = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":51
 * TIMER = libev.EV_TIMER
 * PERIODIC = libev.EV_PERIODIC
 * SIGNAL = libev.EV_SIGNAL             # <<<<<<<<<<<<<<
 * CHILD = libev.EV_CHILD
 * STAT = libev.EV_STAT
 */
  __pyx_t_2 = PyInt_FromLong(EV_SIGNAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __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 = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":52
 * PERIODIC = libev.EV_PERIODIC
 * SIGNAL = libev.EV_SIGNAL
 * CHILD = libev.EV_CHILD             # <<<<<<<<<<<<<<
 * STAT = libev.EV_STAT
 * IDLE = libev.EV_IDLE
 */
  __pyx_t_2 = PyInt_FromLong(EV_CHILD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __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 = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":53
 * SIGNAL = libev.EV_SIGNAL
 * CHILD = libev.EV_CHILD
 * STAT = libev.EV_STAT             # <<<<<<<<<<<<<<
 * IDLE = libev.EV_IDLE
 * PREPARE = libev.EV_PREPARE
 */
  __pyx_t_2 = PyInt_FromLong(EV_STAT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __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 = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":54
 * CHILD = libev.EV_CHILD
 * STAT = libev.EV_STAT
 * IDLE = libev.EV_IDLE             # <<<<<<<<<<<<<<
 * PREPARE = libev.EV_PREPARE
 * CHECK = libev.EV_CHECK
 */
  __pyx_t_2 = PyInt_FromLong(EV_IDLE); 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__IDLE, __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/core.pyx":55
 * STAT = libev.EV_STAT
 * IDLE = libev.EV_IDLE
 * PREPARE = libev.EV_PREPARE             # <<<<<<<<<<<<<<
 * CHECK = libev.EV_CHECK
 * EMBED = libev.EV_EMBED
 */
  __pyx_t_2 = PyInt_FromLong(EV_PREPARE); 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__PREPARE, __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/core.pyx":56
 * IDLE = libev.EV_IDLE
 * PREPARE = libev.EV_PREPARE
 * CHECK = libev.EV_CHECK             # <<<<<<<<<<<<<<
 * EMBED = libev.EV_EMBED
 * FORK = libev.EV_FORK
 */
  __pyx_t_2 = PyInt_FromLong(EV_CHECK); 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__CHECK, __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/core.pyx":57
 * PREPARE = libev.EV_PREPARE
 * CHECK = libev.EV_CHECK
 * EMBED = libev.EV_EMBED             # <<<<<<<<<<<<<<
 * FORK = libev.EV_FORK
 * CLEANUP = libev.EV_CLEANUP
 */
  __pyx_t_2 = PyInt_FromLong(EV_EMBED); 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__EMBED, __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/core.pyx":58
 * CHECK = libev.EV_CHECK
 * EMBED = libev.EV_EMBED
 * FORK = libev.EV_FORK             # <<<<<<<<<<<<<<
 * CLEANUP = libev.EV_CLEANUP
 * ASYNC = libev.EV_ASYNC
 */
  __pyx_t_2 = PyInt_FromLong(EV_FORK); 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__FORK, __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/core.pyx":59
 * EMBED = libev.EV_EMBED
 * FORK = libev.EV_FORK
 * CLEANUP = libev.EV_CLEANUP             # <<<<<<<<<<<<<<
 * ASYNC = libev.EV_ASYNC
 * CUSTOM = libev.EV_CUSTOM
 */
  __pyx_t_2 = PyInt_FromLong(EV_CLEANUP); 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__CLEANUP, __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/core.pyx":60
 * FORK = libev.EV_FORK
 * CLEANUP = libev.EV_CLEANUP
 * ASYNC = libev.EV_ASYNC             # <<<<<<<<<<<<<<
 * CUSTOM = libev.EV_CUSTOM
 * ERROR = libev.EV_ERROR
 */
  __pyx_t_2 = PyInt_FromLong(EV_ASYNC); 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__ASYNC, __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/core.pyx":61
 * CLEANUP = libev.EV_CLEANUP
 * ASYNC = libev.EV_ASYNC
 * CUSTOM = libev.EV_CUSTOM             # <<<<<<<<<<<<<<
 * ERROR = libev.EV_ERROR
 *
 */
  __pyx_t_2 = PyInt_FromLong(EV_CUSTOM); 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__CUSTOM, __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/core.pyx":62
 * ASYNC = libev.EV_ASYNC
 * CUSTOM = libev.EV_CUSTOM
 * ERROR = libev.EV_ERROR             # <<<<<<<<<<<<<<
 *
 * READWRITE = libev.EV_READ | libev.EV_WRITE
 */
  __pyx_t_2 = PyInt_FromLong(EV_ERROR); 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__ERROR, __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/core.pyx":64
 * ERROR = libev.EV_ERROR
 *
 * READWRITE = libev.EV_READ | libev.EV_WRITE             # <<<<<<<<<<<<<<
 *
 * MINPRI = libev.EV_MINPRI
 */
  __pyx_t_2 = PyInt_FromLong((EV_READ | EV_WRITE)); 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__READWRITE, __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/core.pyx":66
 * READWRITE = libev.EV_READ | libev.EV_WRITE
 *
 * MINPRI = libev.EV_MINPRI             # <<<<<<<<<<<<<<
 * MAXPRI = libev.EV_MAXPRI
 *
 */
  __pyx_t_2 = PyInt_FromLong(EV_MINPRI); 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__MINPRI, __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/core.pyx":67
 *
 * MINPRI = libev.EV_MINPRI
 * MAXPRI = libev.EV_MAXPRI             # <<<<<<<<<<<<<<
 *
 * BACKEND_PORT = libev.EVBACKEND_PORT
 */
  __pyx_t_2 = PyInt_FromLong(EV_MAXPRI); 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__MAXPRI, __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/core.pyx":69
 * MAXPRI = libev.EV_MAXPRI
 *
 * BACKEND_PORT = libev.EVBACKEND_PORT             # <<<<<<<<<<<<<<
 * BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE
 * BACKEND_EPOLL = libev.EVBACKEND_EPOLL
 */
  __pyx_t_2 = PyInt_FromLong(EVBACKEND_PORT); 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__BACKEND_PORT, __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/core.pyx":70
 *
 * BACKEND_PORT = libev.EVBACKEND_PORT
 * BACKEND_KQUEUE = libev.EVBACKEND_KQUEUE             # <<<<<<<<<<<<<<
 * BACKEND_EPOLL = libev.EVBACKEND_EPOLL
 * BACKEND_POLL = libev.EVBACKEND_POLL
 */
  __pyx_t_2 = PyInt_FromLong(EVBACKEND_KQUEUE); 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__BACKEND_KQUEUE, __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/core.pyx":71
 * 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 = PyInt_FromLong(EVBACKEND_EPOLL); 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__BACKEND_EPOLL, __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/core.pyx":72
 * 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 = PyInt_FromLong(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __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 = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":73
 * 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 = PyInt_FromLong(EVBACKEND_SELECT); 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__BACKEND_SELECT, __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/core.pyx":74
 * 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 = PyInt_FromLong(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __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 = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":75
 * BACKEND_SELECT = libev.EVBACKEND_SELECT
 * FORKCHECK = libev.EVFLAG_FORKCHECK
 * NOINOTIFY = libev.EVFLAG_NOINOTIFY             # <<<<<<<<<<<<<<
 * SIGNALFD = libev.EVFLAG_SIGNALFD
 * NOSIGMASK = libev.EVFLAG_NOSIGMASK
 */
  __pyx_t_2 = PyInt_FromLong(EVFLAG_NOINOTIFY); 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__NOINOTIFY, __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/core.pyx":76
 * FORKCHECK = libev.EVFLAG_FORKCHECK
 * NOINOTIFY = libev.EVFLAG_NOINOTIFY
 * SIGNALFD = libev.EVFLAG_SIGNALFD             # <<<<<<<<<<<<<<
 * NOSIGMASK = libev.EVFLAG_NOSIGMASK
 *
 */
  __pyx_t_2 = PyInt_FromLong(EVFLAG_SIGNALFD); 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__SIGNALFD, __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/core.pyx":77
 * NOINOTIFY = libev.EVFLAG_NOINOTIFY
 * SIGNALFD = libev.EVFLAG_SIGNALFD
 * NOSIGMASK = libev.EVFLAG_NOSIGMASK             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = PyInt_FromLong(EVFLAG_NOSIGMASK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __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 = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":87
 *
 *
 * cdef public object GEVENT_CORE_EVENTS = _EVENTSType()             # <<<<<<<<<<<<<<
 * EVENTS = GEVENT_CORE_EVENTS
 *
 */
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6gevent_4core__EVENTSType)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __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/core.pyx":88
 *
 * 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 = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

/* "gevent/core.pyx":91
 *
 *
 * 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_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_1get_version, NULL, __pyx_n_s_149); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_1get_version, NULL, __pyx_n_s_137); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_1get_version, NULL, __pyx_n_s_156); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_1get_version, NULL, __pyx_n_s_144); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_1get_version, NULL, __pyx_n_s_157); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_1get_version, NULL, __pyx_n_s_145); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__get_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":95
 *
 *
 * 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_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_3get_header_version, NULL, __pyx_n_s_149); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_3get_header_version, NULL, __pyx_n_s_137); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_3get_header_version, NULL, __pyx_n_s_156); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_3get_header_version, NULL, __pyx_n_s_144); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_3get_header_version, NULL, __pyx_n_s_157); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_3get_header_version, NULL, __pyx_n_s_145); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__get_header_version, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":100
 *
 * # 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 = PyInt_FromLong(EVBACKEND_PORT); 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);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__port));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__port));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__port));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":101
 * # 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 = PyInt_FromLong(EVBACKEND_KQUEUE); 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);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__kqueue));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__kqueue));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__kqueue));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":102
 * _flags = [(libev.EVBACKEND_PORT, 'port'),
 *           (libev.EVBACKEND_KQUEUE, 'kqueue'),
 *           (libev.EVBACKEND_EPOLL, 'epoll'),             # <<<<<<<<<<<<<<
 *           (libev.EVBACKEND_POLL, 'poll'),
 *           (libev.EVBACKEND_SELECT, 'select'),
 */
  __pyx_t_2 = PyInt_FromLong(EVBACKEND_EPOLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __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 = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__epoll));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__epoll));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__epoll));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":103
 *           (libev.EVBACKEND_KQUEUE, 'kqueue'),
 *           (libev.EVBACKEND_EPOLL, 'epoll'),
 *           (libev.EVBACKEND_POLL, 'poll'),             # <<<<<<<<<<<<<<
 *           (libev.EVBACKEND_SELECT, 'select'),
 *           (libev.EVFLAG_NOENV, 'noenv'),
 */
  __pyx_t_2 = PyInt_FromLong(EVBACKEND_POLL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __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 = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__poll));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__poll));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__poll));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":104
 *           (libev.EVBACKEND_EPOLL, 'epoll'),
 *           (libev.EVBACKEND_POLL, 'poll'),
 *           (libev.EVBACKEND_SELECT, 'select'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_NOENV, 'noenv'),
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
 */
  __pyx_t_2 = PyInt_FromLong(EVBACKEND_SELECT); 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);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__select));
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_n_s__select));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__select));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":105
 *           (libev.EVBACKEND_POLL, 'poll'),
 *           (libev.EVBACKEND_SELECT, 'select'),
 *           (libev.EVFLAG_NOENV, 'noenv'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
 */
  __pyx_t_2 = PyInt_FromLong(EVFLAG_NOENV); 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_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__noenv));
  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__noenv));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__noenv));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":106
 *           (libev.EVBACKEND_SELECT, 'select'),
 *           (libev.EVFLAG_NOENV, 'noenv'),
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
 *           (libev.EVFLAG_SIGNALFD, 'signalfd'),
 */
  __pyx_t_2 = PyInt_FromLong(EVFLAG_FORKCHECK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __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 = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__forkcheck));
  PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_n_s__forkcheck));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__forkcheck));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":107
 *           (libev.EVFLAG_NOENV, 'noenv'),
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_SIGNALFD, 'signalfd'),
 *           (libev.EVFLAG_NOSIGMASK, 'nosigmask')]
 */
  __pyx_t_2 = PyInt_FromLong(EVFLAG_NOINOTIFY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __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 = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__noinotify));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_n_s__noinotify));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__noinotify));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":108
 *           (libev.EVFLAG_FORKCHECK, 'forkcheck'),
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
 *           (libev.EVFLAG_SIGNALFD, 'signalfd'),             # <<<<<<<<<<<<<<
 *           (libev.EVFLAG_NOSIGMASK, 'nosigmask')]
 *
 */
  __pyx_t_2 = PyInt_FromLong(EVFLAG_SIGNALFD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __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 = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__signalfd));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_n_s__signalfd));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__signalfd));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":109
 *           (libev.EVFLAG_NOINOTIFY, 'noinotify'),
 *           (libev.EVFLAG_SIGNALFD, 'signalfd'),
 *           (libev.EVFLAG_NOSIGMASK, 'nosigmask')]             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = PyInt_FromLong(EVFLAG_NOSIGMASK); 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_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__nosigmask));
  PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_n_s__nosigmask));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__nosigmask));
  __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(10); 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);
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  PyList_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_t_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
  PyList_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  PyList_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_t_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
  PyList_SET_ITEM(__pyx_t_2, 7, ((PyObject *)__pyx_t_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
  PyList_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_t_10));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
  PyList_SET_ITEM(__pyx_t_2, 9, ((PyObject *)__pyx_t_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
  __pyx_t_1 = 0;
  __pyx_t_3 = 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;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s___flags, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

/* "gevent/core.pyx":112
 *
 *
 * _flags_str2int = dict((string, flag) for (flag, string) in _flags)             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = __pyx_pf_6gevent_4core_22genexpr(NULL); 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_11 = PyTuple_New(1); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)(&PyDict_Type))), ((PyObject *)__pyx_t_11), NULL); 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_DECREF(((PyObject *)__pyx_t_11)); __pyx_t_11 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s___flags_str2int, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":115
 *
 *
 * _events = [(libev.EV_READ,     'READ'),             # <<<<<<<<<<<<<<
 *            (libev.EV_WRITE,    'WRITE'),
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_READ); 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_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__READ));
  PyTuple_SET_ITEM(__pyx_t_11, 1, ((PyObject *)__pyx_n_s__READ));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__READ));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":116
 *
 * _events = [(libev.EV_READ,     'READ'),
 *            (libev.EV_WRITE,    'WRITE'),             # <<<<<<<<<<<<<<
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 *            (libev.EV_PERIODIC, 'PERIODIC'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_WRITE); 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);
  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__WRITE));
  PyTuple_SET_ITEM(__pyx_t_10, 1, ((PyObject *)__pyx_n_s__WRITE));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__WRITE));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":117
 * _events = [(libev.EV_READ,     'READ'),
 *            (libev.EV_WRITE,    'WRITE'),
 *            (libev.EV__IOFDSET, '_IOFDSET'),             # <<<<<<<<<<<<<<
 *            (libev.EV_PERIODIC, 'PERIODIC'),
 *            (libev.EV_SIGNAL,   'SIGNAL'),
 */
  __pyx_t_2 = PyInt_FromLong(EV__IOFDSET); 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_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s___IOFDSET));
  PyTuple_SET_ITEM(__pyx_t_9, 1, ((PyObject *)__pyx_n_s___IOFDSET));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s___IOFDSET));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":118
 *            (libev.EV_WRITE,    'WRITE'),
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 *            (libev.EV_PERIODIC, 'PERIODIC'),             # <<<<<<<<<<<<<<
 *            (libev.EV_SIGNAL,   'SIGNAL'),
 *            (libev.EV_CHILD,    'CHILD'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_PERIODIC); 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_8 = PyTuple_New(2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__PERIODIC));
  PyTuple_SET_ITEM(__pyx_t_8, 1, ((PyObject *)__pyx_n_s__PERIODIC));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PERIODIC));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":119
 *            (libev.EV__IOFDSET, '_IOFDSET'),
 *            (libev.EV_PERIODIC, 'PERIODIC'),
 *            (libev.EV_SIGNAL,   'SIGNAL'),             # <<<<<<<<<<<<<<
 *            (libev.EV_CHILD,    'CHILD'),
 *            (libev.EV_STAT,     'STAT'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_SIGNAL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __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 = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__SIGNAL));
  PyTuple_SET_ITEM(__pyx_t_7, 1, ((PyObject *)__pyx_n_s__SIGNAL));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__SIGNAL));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":120
 *            (libev.EV_PERIODIC, 'PERIODIC'),
 *            (libev.EV_SIGNAL,   'SIGNAL'),
 *            (libev.EV_CHILD,    'CHILD'),             # <<<<<<<<<<<<<<
 *            (libev.EV_STAT,     'STAT'),
 *            (libev.EV_IDLE,     'IDLE'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_CHILD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __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 = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__CHILD));
  PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_n_s__CHILD));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CHILD));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":121
 *            (libev.EV_SIGNAL,   'SIGNAL'),
 *            (libev.EV_CHILD,    'CHILD'),
 *            (libev.EV_STAT,     'STAT'),             # <<<<<<<<<<<<<<
 *            (libev.EV_IDLE,     'IDLE'),
 *            (libev.EV_PREPARE,  'PREPARE'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_STAT); 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_5 = PyTuple_New(2); 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);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__STAT));
  PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_n_s__STAT));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__STAT));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":122
 *            (libev.EV_CHILD,    'CHILD'),
 *            (libev.EV_STAT,     'STAT'),
 *            (libev.EV_IDLE,     'IDLE'),             # <<<<<<<<<<<<<<
 *            (libev.EV_PREPARE,  'PREPARE'),
 *            (libev.EV_CHECK,    'CHECK'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_IDLE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __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 = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__IDLE));
  PyTuple_SET_ITEM(__pyx_t_4, 1, ((PyObject *)__pyx_n_s__IDLE));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__IDLE));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":123
 *            (libev.EV_STAT,     'STAT'),
 *            (libev.EV_IDLE,     'IDLE'),
 *            (libev.EV_PREPARE,  'PREPARE'),             # <<<<<<<<<<<<<<
 *            (libev.EV_CHECK,    'CHECK'),
 *            (libev.EV_EMBED,    'EMBED'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_PREPARE); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __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 = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__PREPARE));
  PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_n_s__PREPARE));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__PREPARE));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":124
 *            (libev.EV_IDLE,     'IDLE'),
 *            (libev.EV_PREPARE,  'PREPARE'),
 *            (libev.EV_CHECK,    'CHECK'),             # <<<<<<<<<<<<<<
 *            (libev.EV_EMBED,    'EMBED'),
 *            (libev.EV_FORK,     'FORK'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_CHECK); 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_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__CHECK));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_n_s__CHECK));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CHECK));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":125
 *            (libev.EV_PREPARE,  'PREPARE'),
 *            (libev.EV_CHECK,    'CHECK'),
 *            (libev.EV_EMBED,    'EMBED'),             # <<<<<<<<<<<<<<
 *            (libev.EV_FORK,     'FORK'),
 *            (libev.EV_CLEANUP,  'CLEANUP'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_EMBED); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __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 = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_12);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__EMBED));
  PyTuple_SET_ITEM(__pyx_t_12, 1, ((PyObject *)__pyx_n_s__EMBED));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__EMBED));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":126
 *            (libev.EV_CHECK,    'CHECK'),
 *            (libev.EV_EMBED,    'EMBED'),
 *            (libev.EV_FORK,     'FORK'),             # <<<<<<<<<<<<<<
 *            (libev.EV_CLEANUP,  'CLEANUP'),
 *            (libev.EV_ASYNC,    'ASYNC'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_FORK); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_13 = PyTuple_New(2); if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_13);
  PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__FORK));
  PyTuple_SET_ITEM(__pyx_t_13, 1, ((PyObject *)__pyx_n_s__FORK));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__FORK));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":127
 *            (libev.EV_EMBED,    'EMBED'),
 *            (libev.EV_FORK,     'FORK'),
 *            (libev.EV_CLEANUP,  'CLEANUP'),             # <<<<<<<<<<<<<<
 *            (libev.EV_ASYNC,    'ASYNC'),
 *            (libev.EV_CUSTOM,   'CUSTOM'),
 */
  __pyx_t_2 = PyInt_FromLong(EV_CLEANUP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = PyTuple_New(2); if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_14);
  PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__CLEANUP));
  PyTuple_SET_ITEM(__pyx_t_14, 1, ((PyObject *)__pyx_n_s__CLEANUP));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CLEANUP));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":128
 *            (libev.EV_FORK,     'FORK'),
 *            (libev.EV_CLEANUP,  'CLEANUP'),
 *            (libev.EV_ASYNC,    'ASYNC'),             # <<<<<<<<<<<<<<
 *            (libev.EV_CUSTOM,   'CUSTOM'),
 *            (libev.EV_ERROR,    'ERROR')]
 */
  __pyx_t_2 = PyInt_FromLong(EV_ASYNC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_15 = PyTuple_New(2); if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_15);
  PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ASYNC));
  PyTuple_SET_ITEM(__pyx_t_15, 1, ((PyObject *)__pyx_n_s__ASYNC));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ASYNC));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":129
 *            (libev.EV_CLEANUP,  'CLEANUP'),
 *            (libev.EV_ASYNC,    'ASYNC'),
 *            (libev.EV_CUSTOM,   'CUSTOM'),             # <<<<<<<<<<<<<<
 *            (libev.EV_ERROR,    'ERROR')]
 *
 */
  __pyx_t_2 = PyInt_FromLong(EV_CUSTOM); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_16 = PyTuple_New(2); if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_16);
  PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__CUSTOM));
  PyTuple_SET_ITEM(__pyx_t_16, 1, ((PyObject *)__pyx_n_s__CUSTOM));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__CUSTOM));
  __pyx_t_2 = 0;

/* "gevent/core.pyx":130
 *            (libev.EV_ASYNC,    'ASYNC'),
 *            (libev.EV_CUSTOM,   'CUSTOM'),
 *            (libev.EV_ERROR,    'ERROR')]             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = PyInt_FromLong(EV_ERROR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_n_s__ERROR));
  PyTuple_SET_ITEM(__pyx_t_17, 1, ((PyObject *)__pyx_n_s__ERROR));
  __Pyx_GIVEREF(((PyObject *)__pyx_n_s__ERROR));
  __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(16); 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);
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_11));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_11));
  PyList_SET_ITEM(__pyx_t_2, 1, ((PyObject *)__pyx_t_10));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
  PyList_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_9));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_9));
  PyList_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_t_8));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
  PyList_SET_ITEM(__pyx_t_2, 4, ((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  PyList_SET_ITEM(__pyx_t_2, 5, ((PyObject *)__pyx_t_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
  PyList_SET_ITEM(__pyx_t_2, 6, ((PyObject *)__pyx_t_5));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
  PyList_SET_ITEM(__pyx_t_2, 7, ((PyObject *)__pyx_t_4));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
  PyList_SET_ITEM(__pyx_t_2, 8, ((PyObject *)__pyx_t_3));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
  PyList_SET_ITEM(__pyx_t_2, 9, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  PyList_SET_ITEM(__pyx_t_2, 10, ((PyObject *)__pyx_t_12));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_12));
  PyList_SET_ITEM(__pyx_t_2, 11, ((PyObject *)__pyx_t_13));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_13));
  PyList_SET_ITEM(__pyx_t_2, 12, ((PyObject *)__pyx_t_14));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_14));
  PyList_SET_ITEM(__pyx_t_2, 13, ((PyObject *)__pyx_t_15));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_15));
  PyList_SET_ITEM(__pyx_t_2, 14, ((PyObject *)__pyx_t_16));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_16));
  PyList_SET_ITEM(__pyx_t_2, 15, ((PyObject *)__pyx_t_17));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_17));
  __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_3 = 0;
  __pyx_t_1 = 0;
  __pyx_t_12 = 0;
  __pyx_t_13 = 0;
  __pyx_t_14 = 0;
  __pyx_t_15 = 0;
  __pyx_t_16 = 0;
  __pyx_t_17 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s___events, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

/* "gevent/core.pyx":146
 *
 *
 * if sys.version_info[0] >= 3:             # <<<<<<<<<<<<<<
 *     basestring = (bytes, str)
 * else:
 */
  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_17 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__version_info); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_17);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_17, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  __pyx_t_17 = PyObject_RichCompare(__pyx_t_2, __pyx_int_3, Py_GE); __Pyx_XGOTREF(__pyx_t_17); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_18 = __Pyx_PyObject_IsTrue(__pyx_t_17); if (unlikely(__pyx_t_18 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
  if (__pyx_t_18) {

/* "gevent/core.pyx":147
 *
 * if sys.version_info[0] >= 3:
 *     basestring = (bytes, str)             # <<<<<<<<<<<<<<
 * else:
 *     basestring = __builtins__.basestring
 */
    __pyx_t_17 = PyTuple_New(2); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_17);
    __Pyx_INCREF(((PyObject *)((PyObject*)(&PyBytes_Type))));
    PyTuple_SET_ITEM(__pyx_t_17, 0, ((PyObject *)((PyObject*)(&PyBytes_Type))));
    __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyBytes_Type))));
    __Pyx_INCREF(((PyObject *)((PyObject*)(&PyString_Type))));
    PyTuple_SET_ITEM(__pyx_t_17, 1, ((PyObject *)((PyObject*)(&PyString_Type))));
    __Pyx_GIVEREF(((PyObject *)((PyObject*)(&PyString_Type))));
    if (PyDict_SetItem(__pyx_d, __pyx_n_s__basestring, ((PyObject *)__pyx_t_17)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_t_17)); __pyx_t_17 = 0;
    goto __pyx_L2;
  }
  /*else*/ {

/* "gevent/core.pyx":149
 *     basestring = (bytes, str)
 * else:
 *     basestring = __builtins__.basestring             # <<<<<<<<<<<<<<
 *
 *
 */
    __pyx_t_17 = __Pyx_GetModuleGlobalName(__pyx_n_s____builtins__); if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_17);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_17, __pyx_n_s__basestring); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
    if (PyDict_SetItem(__pyx_d, __pyx_n_s__basestring, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L2:;

/* "gevent/core.pyx":204
 *
 *
 * 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_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_13supported_backends, NULL, __pyx_n_s_149); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_13supported_backends, NULL, __pyx_n_s_137); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_13supported_backends, NULL, __pyx_n_s_156); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_13supported_backends, NULL, __pyx_n_s_144); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_13supported_backends, NULL, __pyx_n_s_157); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_13supported_backends, NULL, __pyx_n_s_145); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__supported_backends, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":208
 *
 *
 * 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_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_15recommended_backends, NULL, __pyx_n_s_149); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_15recommended_backends, NULL, __pyx_n_s_137); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_15recommended_backends, NULL, __pyx_n_s_156); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_15recommended_backends, NULL, __pyx_n_s_144); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_15recommended_backends, NULL, __pyx_n_s_157); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_15recommended_backends, NULL, __pyx_n_s_145); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_146, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_134, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_153, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_141, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_154, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_142, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":212
 *
 *
 * 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_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_17embeddable_backends, NULL, __pyx_n_s_149); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_17embeddable_backends, NULL, __pyx_n_s_137); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_17embeddable_backends, NULL, __pyx_n_s_156); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_17embeddable_backends, NULL, __pyx_n_s_144); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_17embeddable_backends, NULL, __pyx_n_s_157); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_17embeddable_backends, NULL, __pyx_n_s_145); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__embeddable_backends, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":216
 *
 *
 * 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_t_2 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_19time, NULL, __pyx_n_s_149); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_19time, NULL, __pyx_n_s_137); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_19time, NULL, __pyx_n_s_156); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_19time, NULL, __pyx_n_s_144); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_19time, NULL, __pyx_n_s_157); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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 = PyCFunction_NewEx(&__pyx_mdef_6gevent_4core_19time, NULL, __pyx_n_s_145); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __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);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__time, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":222
 *
 *
 * cdef bint _default_loop_destroyed = False             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_v_6gevent_4core__default_loop_destroyed = 0;

/* "gevent/core.pyx":359
 *             libev.ev_break(self._ptr, libev.EVBREAK_ONE)
 *
 *     def run(self, nowait=False, once=False):             # <<<<<<<<<<<<<<
 *
 *         if not self._ptr:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_14 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_15 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

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

#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/core.pyx":470
 *
 *
 *     def io(self, int fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return io(self, fd, events, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; __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/core.pyx":467
 *
 *
 *     def io(self, libev.vfd_socket_t fd, int events, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return io(self, fd, events, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; __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_k_32 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":474
 *
 *
 *     def timer(self, double after, double repeat=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return timer(self, after, repeat, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_33 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":477
 *         return timer(self, after, repeat, ref, priority)
 *
 *     def signal(self, int signum, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return signal(self, signum, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_34 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":480
 *         return signal(self, signum, ref, priority)
 *
 *     def idle(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return idle(self, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_35 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":483
 *         return idle(self, ref, priority)
 *
 *     def prepare(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return prepare(self, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 483; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_36 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":486
 *         return prepare(self, ref, priority)
 *
 *     def check(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return check(self, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_37 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":489
 *         return check(self, ref, priority)
 *
 *     def fork(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return fork(self, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_38 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":492
 *         return fork(self, ref, priority)
 *
 *     def async(self, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return async(self, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_39 = __pyx_t_2;
  __Pyx_GIVEREF(__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))
/* "gevent/core.pyx":498
 *
 *
 *     def child(self, int pid, bint trace=0, ref=True):             # <<<<<<<<<<<<<<
 *         return child(self, pid, trace, ref)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __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/core.pyx":506
 *
 *
 *     def stat(self, bytes path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return stat(self, path, interval, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __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_k_40 = __pyx_t_2;
  __Pyx_GIVEREF(__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))
/* "gevent/core.pyx":506
 *
 *
 *     def stat(self, bytes path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         return stat(self, path, interval, ref, priority)
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_41 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 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)
/* "gevent/core.pyx":778
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args, pass_events=False):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_60 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_59 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_67 = __pyx_t_2;
#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))
  __pyx_k_66 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_68 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__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))
/* "gevent/core.pyx":826
 *
 *
 *     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)
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; __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/core.pyx":810
 *
 *
 *     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)
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 810; __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))
  __pyx_k_64 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_63 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_71 = __pyx_t_2;
#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))
  __pyx_k_70 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_72 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":963
 *             self._flags |= 1
 *
 *     def start(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 963; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_76 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_74 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_83 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_81 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_84 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_82 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":992
 *             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)
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; __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)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_77 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_84 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_85 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":1011
 *     # QQQ: add 'after' and 'repeat' properties?
 *
 *     def again(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __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(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __pyx_k_87 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

#endif /* (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1011
 *     # QQQ: add 'after' and 'repeat' properties?
 *
 *     def again(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __pyx_k_86 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && defined(_WIN32))
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 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(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1011
 *     # QQQ: add 'after' and 'repeat' properties?
 *
 *     def again(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#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)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  __pyx_k_79 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1011
 *     # QQQ: add 'after' and 'repeat' properties?
 *
 *     def again(self, object callback, *args, update=True):             # <<<<<<<<<<<<<<
 *
 *         if not self.loop._ptr:
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_81 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_88 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_89 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32))
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 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)
/* "gevent/core.pyx":1135
 *             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)
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_89 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_87 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_96 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_94 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_97 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_95 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":1261
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_idle_init(&self._watcher, <void *>gevent_callback_idle )
 *         self.loop = loop
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_97 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_95 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_104 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_102 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_105 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_103 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":1380
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_prepare_init(&self._watcher, <void *>gevent_callback_prepare )
 *         self.loop = loop
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_104 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_102 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_111 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_109 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_112 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_110 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":1499
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_check_init(&self._watcher, <void *>gevent_callback_check )
 *         self.loop = loop
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1499; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_111 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_109 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_118 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_116 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_119 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_117 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":1618
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_fork_init(&self._watcher, <void *>gevent_callback_fork )
 *         self.loop = loop
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1618; __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) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_118 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_116 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_123 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_126 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_124 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED))
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":1736
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )
 *         self.loop = loop
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED) && defined(_WIN32)) || (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) */
#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(_WIN32))
  __pyx_k_125 = __pyx_t_2;
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

#endif /* (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
/* "gevent/core.pyx":1736
 *
 *
 *     def __init__(self, loop loop , ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         libev.ev_async_init(&self._watcher, <void *>gevent_callback_async )
 *         self.loop = loop
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k_132 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_133 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (defined(LIBEV_EMBED) && !defined(_WIN32))
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

#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(_WIN32))
/* "gevent/core.pyx":1862
 *             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')
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1862; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) || (!EV_USE_SIGNALFD && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_133 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_123 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_140 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_130 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_141 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_131 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":2008
 *     cdef readonly bytes path
 *
 *     def __init__(self, loop loop, bytes path, float interval=0.0, ref=True, priority=None):             # <<<<<<<<<<<<<<
 *         self.path = path
 *         libev.ev_stat_init(&self._watcher, <void *>gevent_callback_stat, <char*>self.path, interval)
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2008; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_143 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_131 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_150 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_138 = __pyx_t_2;
#endif /* (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  __pyx_k_151 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32))
  __pyx_k_139 = __pyx_t_2;
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD)
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

/* "gevent/core.pyx":2039
 *
 *
 * __SYSERR_CALLBACK = None             # <<<<<<<<<<<<<<
 *
 *
 */
  if (PyDict_SetItem(__pyx_d, __pyx_n_s____SYSERR_CALLBACK, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2039; __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/core.pyx":2076
 *
 *
 * LIBEV_EMBED = False             # <<<<<<<<<<<<<<
 *
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __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/core.pyx":2065
 *
 *
 * LIBEV_EMBED = True             # <<<<<<<<<<<<<<
 * EV_USE_FLOOR = libev.EV_USE_FLOOR
 * EV_USE_CLOCK_SYSCALL = libev.EV_USE_CLOCK_SYSCALL
 */
  __pyx_t_2 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __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_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */
#if (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__LIBEV_EMBED, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (!EV_USE_SIGNALFD && !defined(LIBEV_EMBED)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__LIBEV_EMBED, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2066
 *
 * 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_2 = PyInt_FromLong(EV_USE_FLOOR); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__EV_USE_FLOOR, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2067
 * 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_2 = PyInt_FromLong(EV_USE_CLOCK_SYSCALL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED)) */
#if (!EV_USE_SIGNALFD && defined(LIBEV_EMBED) && !defined(_WIN32))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_162, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __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))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_150, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __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))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_163, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __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))
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_151, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED) && defined(_WIN32)) */
#if (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (defined(LIBEV_EMBED))
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2068
 * 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_2 = PyInt_FromLong(EV_USE_REALTIME); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__EV_USE_REALTIME, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2069
 * 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_2 = PyInt_FromLong(EV_USE_MONOTONIC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__EV_USE_MONOTONIC, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2070
 * 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_2 = PyInt_FromLong(EV_USE_NANOSLEEP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__EV_USE_NANOSLEEP, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2071
 * 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_2 = PyInt_FromLong(EV_USE_INOTIFY); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__EV_USE_INOTIFY, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2071; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2072
 * 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_2 = PyInt_FromLong(EV_USE_SIGNALFD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__EV_USE_SIGNALFD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2072; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2073
 * 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_2 = PyInt_FromLong(EV_USE_EVENTFD); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__EV_USE_EVENTFD, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":2074
 * EV_USE_SIGNALFD = libev.EV_USE_SIGNALFD
 * EV_USE_EVENTFD = libev.EV_USE_EVENTFD
 * EV_USE_4HEAP = libev.EV_USE_4HEAP             # <<<<<<<<<<<<<<
 *
 *
 */
  __pyx_t_2 = PyInt_FromLong(EV_USE_4HEAP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s__EV_USE_4HEAP, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2074; __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_DECREF(__pyx_t_2); __pyx_t_2 = 0;

/* "gevent/core.pyx":1
 * # Generated by cythonpp.py on 2014-04-30 16:45:07             # <<<<<<<<<<<<<<
 * # Copyright (c) 2009-2012 Denis Bilenko. See LICENSE for details.
 * cimport cython
 */
  __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_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);
  if (__pyx_m) {
    __Pyx_AddTraceback("init gevent.core", __pyx_clineno, __pyx_lineno, __pyx_filename);
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init gevent.core");
  }
  __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 /* CYTHON_REFNANNY */

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 '%s' 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 (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%s 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;
}

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 (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
        goto bad;
    #endif
    Py_INCREF(local_type);
    Py_INCREF(local_value);
    Py_INCREF(local_tb);
    *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;
/* Make sure tstate is in a consistent state when we XDECREF
       these objects (DECREF may run arbitrary code). */
    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;
}

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 PY_VERSION_HEX < 0x02050000
    if (PyClass_Check(type)) {
    #else
    if (PyType_Check(type)) {
    #endif
#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;
        #if PY_VERSION_HEX < 0x02050000
        if (PyInstance_Check(type)) {
            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
            Py_INCREF(type);
        } else {
            type = 0;
            PyErr_SetString(PyExc_TypeError,
                "raise: exception must be an old-style class or instance");
            goto raise_error;
        }
        #else
        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;
        }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else /* Python 3+ */
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 *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 = PyEval_CallObject(type, args);
        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) {
        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);
        }
    }
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,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        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,
                 "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" 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_Format(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 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 (!r) {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError))
            goto bad;
        PyErr_Clear();
        r = d;
        Py_INCREF(d);
    }
    return r;
bad:
    return NULL;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 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 CYTHON_INLINE int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CPYTHON_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,
        "%s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        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 void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #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);
    }
}

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 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
    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 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,
                                                              int wraparound, 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,
                                                              int wraparound, 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, int wraparound, 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 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 PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_VERSION_HEX < 0x03030000
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    #if PY_VERSION_HEX >= 0x02050000
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                #if PY_VERSION_HEX < 0x03030000
                PyObject *py_level = PyInt_FromLong(1);
                if (!py_level)
                    goto bad;
                module = PyObject_CallFunctionObjArgs(py_import,
                    name, global_dict, empty_dict, list, py_level, NULL);
                Py_DECREF(py_level);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                #endif
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0; /* try absolute import on failure */
        }
        #endif
        if (!module) {
            #if PY_VERSION_HEX < 0x03030000
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
    #else
    if (level>0) {
        PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
        goto bad;
    }
    module = PyObject_CallFunctionObjArgs(py_import,
        name, global_dict, empty_dict, list, NULL);
    #endif
bad:
    #if PY_VERSION_HEX < 0x03030000
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
#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_from_py_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 = const_zero < neg_one;
    if (sizeof(vfd_socket_t) == sizeof(char)) {
        if (is_unsigned)
            return (vfd_socket_t)__Pyx_PyInt_AsUnsignedChar(x);
        else
            return (vfd_socket_t)__Pyx_PyInt_AsSignedChar(x);
    } else if (sizeof(vfd_socket_t) == sizeof(short)) {
        if (is_unsigned)
            return (vfd_socket_t)__Pyx_PyInt_AsUnsignedShort(x);
        else
            return (vfd_socket_t)__Pyx_PyInt_AsSignedShort(x);
    } else if (sizeof(vfd_socket_t) == sizeof(int)) {
        if (is_unsigned)
            return (vfd_socket_t)__Pyx_PyInt_AsUnsignedInt(x);
        else
            return (vfd_socket_t)__Pyx_PyInt_AsSignedInt(x);
    } else if (sizeof(vfd_socket_t) == sizeof(long)) {
        if (is_unsigned)
            return (vfd_socket_t)__Pyx_PyInt_AsUnsignedLong(x);
        else
            return (vfd_socket_t)__Pyx_PyInt_AsSignedLong(x);
    } else if (sizeof(vfd_socket_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return (vfd_socket_t)__Pyx_PyInt_AsUnsignedLongLong(x);
        else
            return (vfd_socket_t)__Pyx_PyInt_AsSignedLongLong(x);
    }  else {
        #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;
    }
}

static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_vfd_socket_t(vfd_socket_t val) {
    const vfd_socket_t neg_one = (vfd_socket_t)-1, const_zero = (vfd_socket_t)0;
    const int is_unsigned = const_zero < neg_one;
    if ((sizeof(vfd_socket_t) == sizeof(char))  ||
        (sizeof(vfd_socket_t) == sizeof(short))) {
        return PyInt_FromLong((long)val);
    } else if ((sizeof(vfd_socket_t) == sizeof(int)) ||
               (sizeof(vfd_socket_t) == sizeof(long))) {
        if (is_unsigned)
            return PyLong_FromUnsignedLong((unsigned long)val);
        else
            return PyInt_FromLong((long)val);
    } else if (sizeof(vfd_socket_t) == sizeof(PY_LONG_LONG)) {
        if (is_unsigned)
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
        else
            return PyLong_FromLongLong((PY_LONG_LONG)val);
    } else {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&val;
        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 CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    const char neg_one = (char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    const short neg_one = (short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    const signed char neg_one = (signed char)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    const signed short neg_one = (signed short)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    const signed int neg_one = (signed int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
    const int neg_one = (int)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (is_unsigned && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
    const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(unsigned long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned long");
                return (unsigned long)-1;
            }
            return (unsigned long)PyLong_AsUnsignedLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(unsigned long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (unsigned long)PyLong_AsLong(x);
        }
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to unsigned PY_LONG_LONG");
                return (unsigned PY_LONG_LONG)-1;
            }
            return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
    const long neg_one = (long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to long");
                return (long)-1;
            }
            return (long)PyLong_AsUnsignedLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(long) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (long)PyLong_AsLong(x);
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to PY_LONG_LONG");
                return (PY_LONG_LONG)-1;
            }
            return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
    const signed long neg_one = (signed long)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(signed long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed long");
                return (signed long)-1;
            }
            return (signed long)PyLong_AsUnsignedLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(signed long)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (signed long)PyLong_AsLong(x);
        }
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
#include "longintrepr.h"
#endif
#endif
static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
    const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (is_unsigned && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            if (unlikely(Py_SIZE(x) < 0)) {
                PyErr_SetString(PyExc_OverflowError,
                                "can't convert negative value to signed PY_LONG_LONG");
                return (signed PY_LONG_LONG)-1;
            }
            return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
        } else {
#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
#if CYTHON_USE_PYLONG_INTERNALS
            if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
                switch (Py_SIZE(x)) {
                    case  0: return 0;
                    case  1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                    case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
                }
            }
#endif
#endif
            return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
        }
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

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

static PyObject *__Pyx_Generator_Next(PyObject *self);
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Generator_Close(PyObject *self);
static PyObject *__Pyx_Generator_Throw(PyObject *gen, PyObject *args);
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_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 (unlikely(et != PyExc_StopIteration) &&
            unlikely(!PyErr_GivenExceptionMatches(et, PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (likely(!ev) || !PyObject_IsInstance(ev, PyExc_StopIteration)) {
            if (!ev) {
                Py_INCREF(Py_None);
                ev = Py_None;
            }
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = ev;
            return 0;
        }
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_IsInstance(ev, 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 = PyObject_GetAttr(ev, __pyx_n_s__args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PyObject_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_Generator_ExceptionClear(__pyx_GeneratorObject *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_Generator_CheckRunning(__pyx_GeneratorObject *gen) {
    if (unlikely(gen->is_running)) {
        PyErr_SetString(PyExc_ValueError,
                        "generator already executing");
        return 1;
    }
    return 0;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_SendEx(__pyx_GeneratorObject *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
/* Generators always return to their most recent caller, not
         * necessarily their creator. */
        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_Generator_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
/* Don't keep the reference to f_back any longer than necessary.  It
         * may keep a chain of frames alive or it could create a reference
         * cycle. */
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_CLEAR(f->f_back);
        }
#endif
    } else {
        __Pyx_Generator_ExceptionClear(self);
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Generator_FinishDelegation(__pyx_GeneratorObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Generator_Undelegate(gen);
    __Pyx_PyGen_FetchStopIterationValue(&val);
    ret = __Pyx_Generator_SendEx(gen, val);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_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_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, Py_None);
}
static PyObject *__Pyx_Generator_Send(PyObject *self, PyObject *value) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Send(yf, value);
        } else {
            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;
        }
        return __Pyx_Generator_FinishDelegation(gen);
    }
    return __Pyx_Generator_SendEx(gen, value);
}
static int __Pyx_Generator_CloseIter(__pyx_GeneratorObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Generator_Close(yf);
        if (!retval)
            return -1;
    } else {
        PyObject *meth;
        gen->is_running = 1;
        meth = PyObject_GetAttr(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_Close(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(__Pyx_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Generator_CloseIter(gen, yf);
        __Pyx_Generator_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
#if PY_VERSION_HEX < 0x02050000
        PyErr_SetNone(PyExc_StopIteration);
#else
        PyErr_SetNone(PyExc_GeneratorExit);
#endif
    retval = __Pyx_Generator_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
#if PY_VERSION_HEX >= 0x02050000
        || raised_exception == PyExc_GeneratorExit
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_GeneratorExit)
#endif
        || PyErr_GivenExceptionMatches(raised_exception, PyExc_StopIteration))
    {
        if (raised_exception) PyErr_Clear();      /* ignore these errors */
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx_Generator_Throw(PyObject *self, PyObject *args) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) 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_Generator_CheckRunning(gen)))
        return NULL;
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
#if PY_VERSION_HEX >= 0x02050000
        if (PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit)) {
            int err = __Pyx_Generator_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Generator_Undelegate(gen);
            if (err < 0)
                return __Pyx_Generator_SendEx(gen, NULL);
            goto throw_here;
        }
#endif
        gen->is_running = 1;
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Throw(yf, args);
        } else {
            PyObject *meth = PyObject_GetAttr(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_Generator_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_Generator_FinishDelegation(gen);
        }
        return ret;
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Generator_SendEx(gen, NULL);
}
static int __Pyx_Generator_traverse(PyObject *self, visitproc visit, void *arg) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) 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_Generator_clear(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) 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);
    return 0;
}
static void __Pyx_Generator_dealloc(PyObject *self) {
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    PyObject_GC_Track(self);
    if (gen->resume_label > 0) {
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
            return;                     /* resurrected.  :( */
    }
    PyObject_GC_UnTrack(self);
    __Pyx_Generator_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Generator_del(PyObject *self) {
    PyObject *res;
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_GeneratorObject *gen = (__pyx_GeneratorObject *) self;
    if (gen->resume_label <= 0)
        return ;
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
    res = __Pyx_Generator_Close(self);
    if (res == NULL)
        PyErr_WriteUnraisable(self);
    else
        Py_DECREF(res);
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
/* Undo the temporary resurrection; can't use DECREF here, it would
     * cause a recursive call.
     */
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0)
        return; /* this is the normal path out */
/* close() resurrected it!  Make it look like the original Py_DECREF
     * never happened.
     */
    {
        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);
/* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
     * we need to undo that. */
    _Py_DEC_REFTOTAL;
#endif
/* If Py_TRACE_REFS, _Py_NewReference re-added self to the object
     * chain, so no more to do there.
     * If COUNT_ALLOCS, the original decref bumped tp_frees, and
     * _Py_NewReference bumped tp_allocs:  both of those need to be
     * undone.
     */
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
}
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running",
#if PY_VERSION_HEX >= 0x02060000
     T_BOOL,
#else
     T_BYTE,
#endif
     offsetof(__pyx_GeneratorObject, is_running),
     READONLY,
     NULL},
    {0, 0, 0, 0, 0}
};
static PyMethodDef __pyx_Generator_methods[] = {
    {__Pyx_NAMESTR("send"), (PyCFunction) __Pyx_Generator_Send, METH_O, 0},
    {__Pyx_NAMESTR("throw"), (PyCFunction) __Pyx_Generator_Throw, METH_VARARGS, 0},
    {__Pyx_NAMESTR("close"), (PyCFunction) __Pyx_Generator_Close, METH_NOARGS, 0},
    {0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __Pyx_NAMESTR("generator"),         /*tp_name*/
    sizeof(__pyx_GeneratorObject),      /*tp_basicsize*/
    0,                                  /*tp_itemsize*/
    (destructor) __Pyx_Generator_dealloc,/*tp_dealloc*/
    0,                                  /*tp_print*/
    0,                                  /*tp_getattr*/
    0,                                  /*tp_setattr*/
#if PY_MAJOR_VERSION < 3
    0,                                  /*tp_compare*/
#else
    0,                                  /*reserved*/
#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_GC, /* tp_flags*/
    0,                                  /*tp_doc*/
    (traverseproc) __Pyx_Generator_traverse,   /*tp_traverse*/
    0,                                  /*tp_clear*/
    0,                                  /*tp_richcompare*/
    offsetof(__pyx_GeneratorObject, gi_weakreflist), /* tp_weaklistoffse */
    0,                                  /*tp_iter*/
    (iternextfunc) __Pyx_Generator_Next, /*tp_iternext*/
    __pyx_Generator_methods,            /*tp_methods*/
    __pyx_Generator_memberlist,         /*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*/
    0,                                  /*tp_new*/
    0,                                  /*tp_free*/
    0,                                  /*tp_is_gc*/
    0,                                  /*tp_bases*/
    0,                                  /*tp_mro*/
    0,                                  /*tp_cache*/
    0,                                  /*tp_subclasses*/
    0,                                  /*tp_weaklist*/
    __Pyx_Generator_del,                /*tp_del*/
#if PY_VERSION_HEX >= 0x02060000
    0,                                  /*tp_version_tag*/
#endif
#if PY_VERSION_HEX >= 0x030400a1 && defined(Py_TPFLAGS_HAVE_FINALIZE)
    0,                                  /*tp_finalize*/
#endif
};
static __pyx_GeneratorObject *__Pyx_Generator_New(__pyx_generator_body_t body,
                                                  PyObject *closure) {
    __pyx_GeneratorObject *gen =
        PyObject_GC_New(__pyx_GeneratorObject, &__pyx_GeneratorType_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;
    PyObject_GC_Track(gen);
    return gen;
}
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = PyObject_GenericGetAttr;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    if (PyType_Ready(&__pyx_GeneratorType_type)) {
        return -1;
    }
    __pyx_GeneratorType = &__pyx_GeneratorType_type;
    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);
        #if PY_VERSION_HEX < 0x02050000
        return PyErr_Warn(NULL, message);
        #else
        return PyErr_WarnEx(NULL, message, 1);
        #endif
    }
    return 0;
}

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) / 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, 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,            /*int argcount,*/
        0,            /*int kwonlyargcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __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,      /*int firstlineno,*/
        __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;
    PyObject *py_globals = 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_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*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 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  /* Python 3+ has unicode identifiers */
        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(char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, 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 __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 /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
        *length = PyBytes_GET_SIZE(defenc);
        return defenc_c;
#else /* PY_VERSION_HEX < 0x03030000 */
        if (PyUnicode_READY(o) == -1) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
        if (PyUnicode_IS_ASCII(o)) {
            *length = PyUnicode_GET_DATA_SIZE(o);
            return PyUnicode_AsUTF8(o);
        } else {
            PyUnicode_AsASCIIString(o);
            return NULL;
        }
#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
        return PyUnicode_AsUTF8AndSize(o, length);
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
#endif /* PY_VERSION_HEX < 0x03030000 */
    } else
#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII  || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (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 Py_INCREF(x), 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,
                   "__%s__ returned non-%s (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 = 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) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}
static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
           PyErr_SetString(PyExc_OverflowError,
                           "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
#endif /* (EV_USE_SIGNALFD && defined(LIBEV_EMBED)) || (!EV_USE_SIGNALFD) */

#include "callbacks.c"
