ObjFW  Diff

Differences From Artifact [365c8917fd]:

  • File src/OFKernelEventObserver_poll.m — part of check-in [7ae17af9f0] at 2016-03-20 11:57:06 on branch trunk — Never block when the read buffer is non-empty

    This was broken by 88f2f03. The problem only existed when something was
    in the read buffer, but not processed completely, as after processing
    the read buffer, it would go on to wait for data - but since not the
    entire read buffer had been processed, it meant there was still data
    left there that needed to be handled first. (user: js, size: 4537) [annotate] [blame] [check-ins using]

To Artifact [faa844312a]:


121
122
123
124
125
126
127
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
153
154
155
156
157
158
159
160
161
162
163
			}

			break;
		}
	}
}

- (void)OF_addObjectForReading: (id)object
		fileDescriptor: (int)fd
{
	[self OF_addObject: object
	    fileDescriptor: fd
		    events: POLLIN];
}

- (void)OF_addObjectForWriting: (id)object
		fileDescriptor: (int)fd
{
	[self OF_addObject: object
	    fileDescriptor: fd
		    events: POLLOUT];
}

- (void)OF_removeObjectForReading: (id)object
		   fileDescriptor: (int)fd
{
	[self OF_removeObject: object
	       fileDescriptor: fd
		       events: POLLIN];
}

- (void)OF_removeObjectForWriting: (id)object
		   fileDescriptor: (int)fd
{
	[self OF_removeObject: object
	       fileDescriptor: fd
		       events: POLLOUT];
}

- (void)observeForTimeInterval: (of_time_interval_t)timeInterval
{
	struct pollfd *FDs;
	int events;







|
<


|



|
<


|



|
<


|



|
<


|







121
122
123
124
125
126
127
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
153
154
155
156
157
158
159
			}

			break;
		}
	}
}

- (void)OF_addObjectForReading: (id <OFReadyForReadingObserving>)object

{
	[self OF_addObject: object
	    fileDescriptor: [object fileDescriptorForReading]
		    events: POLLIN];
}

- (void)OF_addObjectForWriting: (id <OFReadyForWritingObserving>)object

{
	[self OF_addObject: object
	    fileDescriptor: [object fileDescriptorForWriting]
		    events: POLLOUT];
}

- (void)OF_removeObjectForReading: (id <OFReadyForReadingObserving>)object

{
	[self OF_removeObject: object
	       fileDescriptor: [object fileDescriptorForReading]
		       events: POLLIN];
}

- (void)OF_removeObjectForWriting: (id <OFReadyForWritingObserving>)object

{
	[self OF_removeObject: object
	       fileDescriptor: [object fileDescriptorForWriting]
		       events: POLLOUT];
}

- (void)observeForTimeInterval: (of_time_interval_t)timeInterval
{
	struct pollfd *FDs;
	int events;