Differences From Artifact [927bd4e34c]:
- File src/OFStreamObserver_poll.m — part of check-in [3c99aa51da] at 2012-09-12 06:00:25 on branch trunk — OFStreamObserver: Take a double as timeout. (user: js, size: 3545) [annotate] [blame] [check-ins using]
To Artifact [26ca60eaf1]:
- File
src/OFStreamObserver_poll.m
— part of check-in
[3de549d6a5]
at
2012-09-12 06:00:29
on branch trunk
— OFStreamObserver: Cancel is no event anymore.
As cancel internally was an event, -[observeWithTimeout:] returned YES
before when an observe call was canceled. Now, the number of real events
is counted and NO returned if this is 0. (user: js, size: 3648) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
120 121 122 123 124 125 126 | withEvents: POLLOUT]; } - (BOOL)observeWithTimeout: (double)timeout { void *pool = objc_autoreleasePoolPush(); struct pollfd *FDsCArray; | | | 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | withEvents: POLLOUT]; } - (BOOL)observeWithTimeout: (double)timeout { void *pool = objc_autoreleasePoolPush(); struct pollfd *FDsCArray; size_t i, nFDs, realEvents = 0; [self _processQueue]; if ([self _processCache]) { objc_autoreleasePoolPop(pool); return YES; } |
︙ | ︙ | |||
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 | OF_ENSURE(read(cancelFD[0], &buffer, 1) > 0); FDsCArray[i].revents = 0; objc_autoreleasePoolPop(pool); continue; } [delegate streamIsReadyForReading: FDToStream[FDsCArray[i].fd]]; } if (FDsCArray[i].revents & POLLOUT) { [delegate streamIsReadyForWriting: FDToStream[FDsCArray[i].fd]]; } if (FDsCArray[i].revents & POLLERR) { [delegate streamDidReceiveException: FDToStream[FDsCArray[i].fd]]; } FDsCArray[i].revents = 0; objc_autoreleasePoolPop(pool); } return YES; } @end | > > > > > > | 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 | OF_ENSURE(read(cancelFD[0], &buffer, 1) > 0); FDsCArray[i].revents = 0; objc_autoreleasePoolPop(pool); continue; } realEvents++; [delegate streamIsReadyForReading: FDToStream[FDsCArray[i].fd]]; } if (FDsCArray[i].revents & POLLOUT) { realEvents++; [delegate streamIsReadyForWriting: FDToStream[FDsCArray[i].fd]]; } if (FDsCArray[i].revents & POLLERR) { realEvents++; [delegate streamDidReceiveException: FDToStream[FDsCArray[i].fd]]; } FDsCArray[i].revents = 0; objc_autoreleasePoolPop(pool); } if (realEvents == 0) return NO; return YES; } @end |