Differences From Artifact [ab1097e618]:
- File src/OFStreamObserver_select.m — part of check-in [c279948fb8] at 2011-09-19 12:44:09 on branch trunk — Nicer OFStreamObserver API. (user: js, size: 3417) [annotate] [blame] [check-ins using]
To Artifact [2694d5248b]:
- File
src/OFStreamObserver_select.m
— part of check-in
[47caef4f8a]
at
2011-09-20 18:40:54
on branch trunk
— OFStreamObserver improvements.
* Make it possible to close a stream before the add/remove queue has
been processed.
* The actual implementations don't need to handle OFStreams now, but
get the file descriptor instead.
* Use an OFMutex instead of @synchronized. (user: js, size: 3265) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
37 38 39 40 41 42 43 | FD_ZERO(&writeFDs); FD_SET(cancelFD[0], &readFDs); return self; } | < < | | < < | | | < < | < < | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | FD_ZERO(&writeFDs); FD_SET(cancelFD[0], &readFDs); return self; } - (void)_addFileDescriptorForReading: (int)fd { FD_SET(fd, &readFDs); FD_SET(fd, &exceptFDs); } - (void)_addFileDescriptorForWriting: (int)fd { FD_SET(fd, &writeFDs); FD_SET(fd, &exceptFDs); } - (void)_removeFileDescriptorForReading: (int)fd { FD_CLR(fd, &readFDs); if (!FD_ISSET(fd, &writeFDs)) FD_CLR(fd, &exceptFDs); } - (void)_removeFileDescriptorForWriting: (int)fd { FD_CLR(fd, &writeFDs); if (!FD_ISSET(fd, &readFDs)) FD_CLR(fd, &exceptFDs); } - (BOOL)observeWithTimeout: (int)timeout |
︙ | ︙ |