Differences From Artifact [0607878a6c]:
- File
src/OFPollKernelEventObserver.m
— part of check-in
[7e9f70c477]
at
2020-01-13 00:18:40
on branch trunk
— OFPollKernelEventObserver: Copy FDs
This allows them to be modified while they are still being processed. (user: js, size: 4909) [annotate] [blame] [check-ins using]
To Artifact [49ee878680]:
- File src/OFPollKernelEventObserver.m — part of check-in [94479b861b] at 2020-01-14 22:53:24 on branch trunk — OF{Poll,Select}KernelEventObserver: Throw EBADF (user: js, size: 5148) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
69 70 71 72 73 74 75 | [super dealloc]; } - (void)of_addObject: (id)object fileDescriptor: (int)fd events: (short)events { | | | > > > > > > > > | | 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | [super dealloc]; } - (void)of_addObject: (id)object fileDescriptor: (int)fd events: (short)events { struct pollfd *FDs; size_t count; bool found; if (fd < 0) @throw [OFObserveFailedException exceptionWithObserver: self errNo: EBADF]; FDs = _FDs.mutableItems; count = _FDs.count; found = false; for (size_t i = 0; i < count; i++) { if (FDs[i].fd == fd) { FDs[i].events |= events; found = true; break; } |
︙ | ︙ | |||
100 101 102 103 104 105 106 | } } - (void)of_removeObject: (id)object fileDescriptor: (int)fd events: (short)events { | | | > > > > > > > | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | } } - (void)of_removeObject: (id)object fileDescriptor: (int)fd events: (short)events { struct pollfd *FDs; size_t nFDs; if (fd < 0) @throw [OFObserveFailedException exceptionWithObserver: self errNo: EBADF]; FDs = _FDs.mutableItems; nFDs = _FDs.count; for (size_t i = 0; i < nFDs; i++) { if (FDs[i].fd == fd) { FDs[i].events &= ~events; if (FDs[i].events == 0) { /* |
︙ | ︙ |