Differences From Artifact [71bb648f05]:
- File
src/OFKernelEventObserver.m
— part of check-in
[c694569d86]
at
2014-01-29 15:54:59
on branch trunk
— Generalize OFKernelEventObserver
It is no longer limited to streams now. (user: js, size: 9111) [annotate] [blame] [check-ins using]
To Artifact [e92efb6b43]:
- File src/OFKernelEventObserver.m — part of check-in [414c87ec13] at 2014-02-03 14:43:51 on branch trunk — Move socket initialization to a single place (user: js, size: 9216) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
58 59 60 61 62 63 64 65 66 67 68 69 70 71 | QUEUE_REMOVE = 1, QUEUE_READ = 0, QUEUE_WRITE = 2 }; #define QUEUE_ACTION (QUEUE_ADD | QUEUE_REMOVE) @implementation OFKernelEventObserver + (instancetype)observer { return [[[self alloc] init] autorelease]; } #if defined(HAVE_KQUEUE) + alloc | > > > > > > > > > > | 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | QUEUE_REMOVE = 1, QUEUE_READ = 0, QUEUE_WRITE = 2 }; #define QUEUE_ACTION (QUEUE_ADD | QUEUE_REMOVE) @implementation OFKernelEventObserver + (void)initialize { if (self != [OFKernelEventObserver class]) return; if (!of_init_sockets()) @throw [OFInitializationFailedException exceptionWithClass: self]; } + (instancetype)observer { return [[[self alloc] init] autorelease]; } #if defined(HAVE_KQUEUE) + alloc |
︙ | ︙ | |||
113 114 115 116 117 118 119 | _queueFDs = [[OFDataArray alloc] initWithItemSize: sizeof(int)]; #ifdef OF_HAVE_PIPE if (pipe(_cancelFD)) @throw [OFInitializationFailedException exceptionWithClass: [self class]]; #else | < < < | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | _queueFDs = [[OFDataArray alloc] initWithItemSize: sizeof(int)]; #ifdef OF_HAVE_PIPE if (pipe(_cancelFD)) @throw [OFInitializationFailedException exceptionWithClass: [self class]]; #else _cancelFD[0] = socket(AF_INET, SOCK_DGRAM, 0); _cancelFD[1] = socket(AF_INET, SOCK_DGRAM, 0); if (_cancelFD[0] == INVALID_SOCKET || _cancelFD[1] == INVALID_SOCKET) @throw [OFInitializationFailedException exceptionWithClass: [self class]]; |
︙ | ︙ |