Differences From Artifact [e20baf20e3]:
- File src/OFEpollKernelEventObserver.m — part of check-in [c7f0229795] at 2020-01-02 01:51:34 on branch trunk — Update copyright (user: js, size: 5811) [annotate] [blame] [check-ins using]
To Artifact [3f87d51ce3]:
- File
src/OFEpollKernelEventObserver.m
— part of check-in
[24eff635db]
at
2020-01-07 20:28:41
on branch trunk
— OFKernelEventObserver: Remove queueing of actions
This removes the ability to let a thread add or remove objects for
another thread. This features wasn't used at all, but caused significant
problems with kqueue and epoll, as this often resulted in removing a
file descriptor after it had already been closed. (user: js, size: 5646) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
25 26 27 28 29 30 31 | #endif #include "unistd_wrapper.h" #include <sys/epoll.h> #import "OFEpollKernelEventObserver.h" #import "OFArray.h" | < < < < < | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | #endif #include "unistd_wrapper.h" #include <sys/epoll.h> #import "OFEpollKernelEventObserver.h" #import "OFArray.h" #import "OFMapTable.h" #import "OFNull.h" #import "OFInitializationFailedException.h" #import "OFObserveFailedException.h" #define EVENTLIST_SIZE 64 |
︙ | ︙ | |||
154 155 156 157 158 159 160 | errNo: errno]; [_FDToEvents setObject: (void *)events forKey: (void *)((intptr_t)fd + 1)]; } } | | | | | < < | 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 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | errNo: errno]; [_FDToEvents setObject: (void *)events forKey: (void *)((intptr_t)fd + 1)]; } } - (void)addObjectForReading: (id <OFReadyForReadingObserving>)object { [self of_addObject: object fileDescriptor: object.fileDescriptorForReading events: EPOLLIN]; } - (void)addObjectForWriting: (id <OFReadyForWritingObserving>)object { [self of_addObject: object fileDescriptor: object.fileDescriptorForWriting events: EPOLLOUT]; } - (void)removeObjectForReading: (id <OFReadyForReadingObserving>)object { [self of_removeObject: object fileDescriptor: object.fileDescriptorForReading events: EPOLLIN]; } - (void)removeObjectForWriting: (id <OFReadyForWritingObserving>)object { [self of_removeObject: object fileDescriptor: object.fileDescriptorForWriting events: EPOLLOUT]; } - (void)observeForTimeInterval: (of_time_interval_t)timeInterval { OFNull *nullObject = [OFNull null]; struct epoll_event eventList[EVENTLIST_SIZE]; int events; if ([self of_processReadBuffers]) return; events = epoll_wait(_epfd, eventList, EVENTLIST_SIZE, (timeInterval != -1 ? timeInterval * 1000 : -1)); if (events < 0) |
︙ | ︙ |