Differences From Artifact [85d67fd51b]:
- File
src/OFKernelEventObserver_poll.m
— part of check-in
[4cecf82254]
at
2015-10-04 11:11:28
on branch trunk
— Special cases for the Wii's weird network stack
This fixes the tests on Wii. (user: js, size: 4596) [annotate] [blame] [check-ins using] [more...]
To Artifact [b1a6d909cb]:
- File
src/OFKernelEventObserver_poll.m
— part of check-in
[c5f0c5f9ba]
at
2015-12-29 21:42:38
on branch 0.8
— Refactor OFKernelEventObserver
This moves the locked queue for actions to
OFKernelEventObserver_LockedQueue, which is now used for select and
poll, but skipped for kqueue and epoll, as they natively support changes
from another thread.This fixes the problem that removing an object is delayed until the next
observe call - at which point it might have already been closed, meaning
the fd is no longer available. This was mainly a problem with kqueue, as
closing the fd already removed it from the kqueue, which then resulted
in an error being returned when trying to manually remove the fd from
the kqueue. (user: js, size: 4560) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
122 123 124 125 126 127 128 129 130 | break; } } } - (void)OF_addObjectForReading: (id)object { [self OF_addObject: object | > | > | > | > | | | 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | break; } } } - (void)OF_addObjectForReading: (id)object fileDescriptor: (int)fd { [self OF_addObject: object fileDescriptor: fd events: POLLIN]; } - (void)OF_addObjectForWriting: (id)object fileDescriptor: (int)fd { [self OF_addObject: object fileDescriptor: fd events: POLLOUT]; } - (void)OF_removeObjectForReading: (id)object fileDescriptor: (int)fd { [self OF_removeObject: object fileDescriptor: fd events: POLLIN]; } - (void)OF_removeObjectForWriting: (id)object fileDescriptor: (int)fd { [self OF_removeObject: object fileDescriptor: fd events: POLLOUT]; } - (void)observeForTimeInterval: (of_time_interval_t)timeInterval { void *pool = objc_autoreleasePoolPush(); struct pollfd *FDs; int events; size_t i, nFDs; [self OF_processQueue]; [self OF_processReadBuffers]; objc_autoreleasePoolPop(pool); FDs = [_FDs items]; nFDs = [_FDs count]; |
︙ | ︙ |