Differences From Artifact [ac3c9446ae]:
- File
src/OFStreamObserver_kqueue.m
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 4040) [annotate] [blame] [check-ins using]
To Artifact [0df0a2e4f0]:
- File src/OFStreamObserver_kqueue.m — part of check-in [ab9ad6e515] at 2013-04-30 22:47:28 on branch trunk — observeWithTimeout: -> observeForTimeInterval:. (user: js, size: 4076) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <unistd.h> #include <errno.h> #include <assert.h> #include <sys/types.h> #include <sys/event.h> | > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ #include "config.h" #include <math.h> #include <unistd.h> #include <errno.h> #include <assert.h> #include <sys/types.h> #include <sys/event.h> |
︙ | ︙ | |||
101 102 103 104 105 106 107 | { struct kevent event; EV_SET(&event, fd, EVFILT_WRITE, EV_DELETE, 0, 0, 0); [_changeList addItem: &event]; } | | | | | | | 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | { struct kevent event; EV_SET(&event, fd, EVFILT_WRITE, EV_DELETE, 0, 0, 0); [_changeList addItem: &event]; } - (bool)observeForTimeInterval: (double)timeInterval { void *pool = objc_autoreleasePoolPush(); struct timespec timeout; struct kevent eventList[EVENTLIST_SIZE]; int i, events, realEvents = 0; timeout.tv_sec = (time_t)timeInterval; timeout.tv_nsec = lrint((timeInterval - timeout.tv_sec) * 1000000000); [self OF_processQueue]; if ([self OF_processCache]) { objc_autoreleasePoolPop(pool); return true; } objc_autoreleasePoolPop(pool); events = kevent(_kernelQueue, [_changeList items], (int)[_changeList count], eventList, EVENTLIST_SIZE, (timeInterval == -1 ? NULL : &timeout)); if (events < 0) return false; [_changeList removeAllItems]; if (events == 0) |
︙ | ︙ |