| Comment: | Never block when the read buffer is non-empty
This was broken by 88f2f03. The problem only existed when something was |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
7ae17af9f0478cf6402b5e1406e212ec |
| User & Date: | js on 2016-03-20 11:57:06 |
| Other Links: | manifest | tags |
|
2016-03-20
| ||
| 14:07 | Use the locked queue for kqueue and epoll as well (check-in: 45518ae7b7 user: js tags: trunk) | |
| 11:57 | Never block when the read buffer is non-empty (check-in: 7ae17af9f0 user: js tags: trunk) | |
| 10:53 | macros.h: Adjust a comment (check-in: 826c9570d3 user: js tags: trunk) | |
Modified src/OFKernelEventObserver+Private.h from [b8cff57a1b] to [eb360b3361].
| ︙ | |||
15 16 17 18 19 20 21 | 15 16 17 18 19 20 21 22 23 24 25 | - + | */ #import "OFKernelEventObserver.h" OF_ASSUME_NONNULL_BEGIN @interface OFKernelEventObserver () |
Modified src/OFKernelEventObserver.m from [5d44afb3d5] to [1613a72d1b].
| ︙ | |||
211 212 213 214 215 216 217 | 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | - + + + - - + + + + + - + + + + + + + | # else OF_ENSURE(sendto(_cancelFD[1], "", 1, 0, (struct sockaddr*)&_cancelAddr, 8) > 0); # endif #endif } |
Modified src/OFKernelEventObserver_LockedQueue.m from [06cbc8baae] to [1dd69e1924].
| ︙ | |||
166 167 168 169 170 171 172 173 174 175 176 177 178 179 | 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | + + |
fileDescriptor: (int)fd
{
OF_UNRECOGNIZED_SELECTOR
}
- (void)OF_processQueue
{
void *pool = objc_autoreleasePoolPush();
#ifdef OF_HAVE_THREADS
[_mutex lock];
@try {
#endif
int *queueActions = [_queueActions items];
int *queueFDs = [_queueFDs items];
id const *queueObjects = [_queueObjects objects];
|
| ︙ | |||
225 226 227 228 229 230 231 | 227 228 229 230 231 232 233 234 235 236 237 | - + + + |
[_queueFDs removeAllItems];
[_queueObjects removeAllObjects];
#ifdef OF_HAVE_THREADS
} @finally {
[_mutex unlock];
}
#endif
|
Modified src/OFKernelEventObserver_epoll.m from [dd16d51752] to [ccbb902e19].
| ︙ | |||
205 206 207 208 209 210 211 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | - - - + + - |
events: EPOLLOUT
objectsArray: _writeObjects];
}
- (void)observeForTimeInterval: (of_time_interval_t)timeInterval
{
OFNull *nullObject = [OFNull null];
|
| ︙ |
Modified src/OFKernelEventObserver_kqueue.m from [6945083a36] to [240d5f78f9].
| ︙ | |||
201 202 203 204 205 206 207 | 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 | - + + + - - - - + + |
[_mutex unlock];
}
#endif
}
- (void)observeForTimeInterval: (of_time_interval_t)timeInterval
{
|
| ︙ |
Modified src/OFKernelEventObserver_poll.m from [bb3d801549] to [365c8917fd].
| ︙ | |||
155 156 157 158 159 160 161 | 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 197 198 | - + - - + + - + + |
[self OF_removeObject: object
fileDescriptor: fd
events: POLLOUT];
}
- (void)observeForTimeInterval: (of_time_interval_t)timeInterval
{
|
| ︙ | |||
209 210 211 212 213 214 215 | 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | - + |
[_delegate objectIsReadyForReading:
_FDToObject[FDs[i].fd]];
objc_autoreleasePoolPop(pool);
}
if (FDs[i].revents & POLLOUT) {
|
Modified src/OFKernelEventObserver_select.m from [1968f741af] to [c7ee699c53].
| ︙ | |||
128 129 130 131 132 133 134 | 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 | - + - - + + - |
#endif
FD_CLR(fd, &_writeFDs);
}
- (void)observeForTimeInterval: (of_time_interval_t)timeInterval
{
|
| ︙ | |||
184 185 186 187 188 189 190 | 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | - - - - + + - - - - + + |
#endif
}
objects = [_readObjects objects];
count = [_readObjects count];
for (size_t i = 0; i < count; i++) {
|