22
You're going to need to patch PyKqueue:
22
You're going to need to patch PyKqueue::
24
=====================================================
25
--- PyKQueue-1.3/kqsyscallmodule.c Sun Jan 28 21:59:50 2001
26
+++ PyKQueue-1.3/kqsyscallmodule.c.new Tue Jul 30 18:06:08 2002
30
statichere PyTypeObject KQEvent_Type = {
31
- PyObject_HEAD_INIT(NULL)
32
+ PyObject_HEAD_INIT(&PyType_Type)
35
sizeof(KQEventObject), // tp_basicsize
38
/* Build timespec for timeout */
39
totimespec.tv_sec = timeout / 1000;
40
- totimespec.tv_nsec = (timeout % 1000) * 100000;
41
+ totimespec.tv_nsec = (timeout % 1000) * 1000000;
43
// printf("timespec: sec=%d nsec=%d\n", totimespec.tv_sec, totimespec.tv_nsec);
47
+ Py_BEGIN_ALLOW_THREADS
48
gotNumEvents = kevent (self->fd, changelist, haveNumEvents, triggered, wantNumEvents, &totimespec);
49
+ Py_END_ALLOW_THREADS
51
/* Don't need the input event list anymore, so get rid of it */
54
statichere PyTypeObject KQueue_Type = {
55
/* The ob_type field must be initialized in the module init function
56
* to be portable to Windows without using C++. */
57
- PyObject_HEAD_INIT(NULL)
58
+ PyObject_HEAD_INIT(&PyType_Type)
61
sizeof(KQueueObject), /*tp_basicsize*/
24
=====================================================
25
--- PyKQueue-1.3/kqsyscallmodule.c Sun Jan 28 21:59:50 2001
26
+++ PyKQueue-1.3/kqsyscallmodule.c.new Tue Jul 30 18:06:08 2002
30
statichere PyTypeObject KQEvent_Type = {
31
- PyObject_HEAD_INIT(NULL)
32
+ PyObject_HEAD_INIT(&PyType_Type)
35
sizeof(KQEventObject), // tp_basicsize
38
/* Build timespec for timeout */
39
totimespec.tv_sec = timeout / 1000;
40
- totimespec.tv_nsec = (timeout % 1000) * 100000;
41
+ totimespec.tv_nsec = (timeout % 1000) * 1000000;
43
// printf("timespec: sec=%d nsec=%d\\n", totimespec.tv_sec, totimespec.tv_nsec);
47
+ Py_BEGIN_ALLOW_THREADS
48
gotNumEvents = kevent (self->fd, changelist, haveNumEvents, triggered, wantNumEvents, &totimespec);
49
+ Py_END_ALLOW_THREADS
51
/* Don't need the input event list anymore, so get rid of it */
54
statichere PyTypeObject KQueue_Type = {
55
/* The ob_type field must be initialized in the module init function
56
* to be portable to Windows without using C++. */
57
- PyObject_HEAD_INIT(NULL)
58
+ PyObject_HEAD_INIT(&PyType_Type)
61
sizeof(KQueueObject), /*tp_basicsize*/