~launchpad-pqm/twisted/trunk

« back to all changes in this revision

Viewing changes to twisted/internet/kqreactor.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-06-30 11:00:56 UTC
  • mfrom: (5.2.4 devel)
  • Revision ID: pqm@pqm.ubuntu.com-20060630110056-42595ecbf0d33ade
[trivial] Update our Twisted snapshot to SVN r17186.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
 
21
21
 
22
 
You're going to need to patch PyKqueue:
 
22
You're going to need to patch PyKqueue::
23
23
 
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
27
 
@@ -137,7 +137,7 @@
28
 
 }
29
 
 
30
 
 statichere PyTypeObject KQEvent_Type = {
31
 
-  PyObject_HEAD_INIT(NULL)
32
 
+  PyObject_HEAD_INIT(&PyType_Type)
33
 
   0,                             // ob_size
34
 
   "KQEvent",                     // tp_name
35
 
   sizeof(KQEventObject),         // tp_basicsize
36
 
@@ -291,13 +291,14 @@
37
 
 
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;
42
 
 
43
 
   // printf("timespec: sec=%d nsec=%d\n", totimespec.tv_sec, totimespec.tv_nsec);
44
 
 
45
 
   /* Make the call */
46
 
-
47
 
+  Py_BEGIN_ALLOW_THREADS
48
 
   gotNumEvents = kevent (self->fd, changelist, haveNumEvents, triggered, wantNumEvents, &totimespec);
49
 
+  Py_END_ALLOW_THREADS
50
 
 
51
 
   /* Don't need the input event list anymore, so get rid of it */
52
 
   free (changelist);
53
 
@@ -361,7 +362,7 @@
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)
59
 
        0,                      /*ob_size*/
60
 
        "KQueue",                       /*tp_name*/
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
 
27
    @@ -137,7 +137,7 @@
 
28
     }
 
29
     
 
30
     statichere PyTypeObject KQEvent_Type = {
 
31
    -  PyObject_HEAD_INIT(NULL)
 
32
    +  PyObject_HEAD_INIT(&PyType_Type)
 
33
       0,                             // ob_size
 
34
       "KQEvent",                     // tp_name
 
35
       sizeof(KQEventObject),         // tp_basicsize
 
36
    @@ -291,13 +291,14 @@
 
37
     
 
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;
 
42
     
 
43
       // printf("timespec: sec=%d nsec=%d\\n", totimespec.tv_sec, totimespec.tv_nsec);
 
44
     
 
45
       /* Make the call */
 
46
    -
 
47
    +  Py_BEGIN_ALLOW_THREADS
 
48
       gotNumEvents = kevent (self->fd, changelist, haveNumEvents, triggered, wantNumEvents, &totimespec);
 
49
    +  Py_END_ALLOW_THREADS
 
50
     
 
51
       /* Don't need the input event list anymore, so get rid of it */
 
52
       free (changelist);
 
53
    @@ -361,7 +362,7 @@
 
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)
 
59
            0,                  /*ob_size*/
 
60
            "KQueue",                   /*tp_name*/
 
61
            sizeof(KQueueObject),       /*tp_basicsize*/
62
62
 
63
63
"""
64
64