ObjFW  History of src/OFKernelEventObserver_kqueue.m of 3c3467423a9cf105

History of the file that is called src/OFKernelEventObserver_kqueue.m at check-in 3c3467423a9cf105

2019-06-17
02:33
Deleted: Remove underscores from class names (check-in: [17d57e01ff] user: js, branch: trunk, size: 0)
2019-03-08
00:35
[48331f17e7] part of check-in [bceb7ed4c9] Use dot syntax (check-in: [bceb7ed4c9] user: js, branch: trunk, size: 5209) [annotate] [blame] [check-ins using] [diff]
2019-01-03
19:13
[3386cd3187] part of check-in [0509d7a844] Update copyright (check-in: [0509d7a844] user: js, branch: trunk, size: 5223) [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
[df3d03a5ce] part of check-in [7e5c81e186] Update copyright notice (check-in: [7e5c81e186] user: js, branch: trunk, size: 5217) [annotate] [blame] [check-ins using] [diff]
2017-10-17
00:33
[a4cb76e207] part of check-in [2f4e0df8be] Do not use implicit method return types

Instead, explicitly declare them, as OF_ASSUME_NONNULL_{BEGIN,END} does
not apply to implicit return types. This means that after this commit,
all init methods have a nonnull return type, as they should have. (check-in: [2f4e0df8be] user: js, branch: trunk, size: 5194) [annotate] [blame] [check-ins using] [diff]

2017-07-22
20:50
[f3719ede63] part of check-in [c8f7b90082] Split OFDataArray into OFData and OFMutableData (check-in: [c8f7b90082] user: js, branch: trunk, size: 5180) [annotate] [blame] [check-ins using] [diff]
2017-05-27
10:33
[5d1e3ad7ed] part of check-in [d31ec806ef] Add unistd.h wrapper to make things less horrible (check-in: [d31ec806ef] user: js, branch: trunk, size: 5204) [annotate] [blame] [check-ins using] [diff]
2017-05-22
23:31
[06b782a930] part of check-in [1287e77e04] Make includes of unistd.h and fcntl.h conditional (check-in: [1287e77e04] user: js, branch: trunk, size: 5225) [annotate] [blame] [check-ins using] [diff]
2017-05-21
21:28
[4a787d392f] part of check-in [6b77a5dd8b] Prefix private methods with of_ instead of OF_

This matches Apple's style. (check-in: [6b77a5dd8b] user: js, branch: trunk, size: 5168) [annotate] [blame] [check-ins using] [diff]

2017-01-09
17:36
[ab8ff7a52e] part of check-in [44f45c2e35] Update copyright

Forgot to add 2017, even though I already did quite some changes in
2017. (check-in: [44f45c2e35] user: js, branch: trunk, size: 5168) [annotate] [blame] [check-ins using] [diff]

2016-05-06
20:39
[ff0c36abc7] part of check-in [2a2e17d8d0] Enable -Wsign-compare (check-in: [2a2e17d8d0] user: js, branch: trunk, size: 5162) [annotate] [blame] [check-ins using] [diff]
2016-03-20
14:19
[6587f7a7e4] part of check-in [85917ea0dd] Use the locked queue for kqueue and epoll as well

_readObjects must only be changed from the thread running the observer
and not from a thread adding or removing objects to observe. This is
already handled by the locked queue used by poll and select, so the best
way to solve this is to use the locked queue for kqueue and epoll as
well. (check-in: [85917ea0dd] user: js, branch: 0.8, size: 5152) [annotate] [blame] [check-ins using] [diff]

14:07
[1f47484a4e] part of check-in [45518ae7b7] Use the locked queue for kqueue and epoll as well

_readObjects must only be changed from the thread running the observer
and not from a thread adding or removing objects to observe. This is
already handled by the locked queue used by poll and select, so the best
way to solve this is to use the locked queue for kqueue and epoll as
well. (check-in: [45518ae7b7] user: js, branch: trunk, size: 5151) [annotate] [blame] [check-ins using] [diff]

12:05
[80c8d89772] part of check-in [b84490ab4f] 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. (check-in: [b84490ab4f] user: js, branch: 0.8, size: 5923) [annotate] [blame] [check-ins using] [diff]

11:57
[240d5f78f9] part of check-in [7ae17af9f0] 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. (check-in: [7ae17af9f0] user: js, branch: trunk, size: 5922) [annotate] [blame] [check-ins using] [diff]

2016-02-21
15:37
[6945083a36] part of check-in [e0b9167693] Make use of C99-style for loops (check-in: [e0b9167693] user: js, branch: trunk, size: 5968) [annotate] [blame] [check-ins using] [diff]
2016-01-03
00:43
[a6eed99dff] part of check-in [cec0f072f8] Update copyright

While at it, also update the mail address. (check-in: [cec0f072f8] user: js, branch: 0.8, size: 5969) [annotate] [blame] [check-ins using] [diff]

00:41
[c7ba665a18] part of check-in [2a27cf3000] Update copyright

While at it, also update the mail address. (check-in: [2a27cf3000] user: js, branch: trunk, size: 5967) [annotate] [blame] [check-ins using] [diff]

00:36
[d2b671d56c] part of check-in [d1c4c46706] Fix a regression from the previous refactorization

kqueue and epoll were not updating _readObjects and _writeObjects
anymore, since this was done by the queue handling code, which they no
longer use after the refactorization. (check-in: [d1c4c46706] user: js, branch: 0.8, size: 5965) [annotate] [blame] [check-ins using] [diff]

00:35
[8f67672c8e] part of check-in [258b8a4944] Fix a regression from the previous refactorization

kqueue and epoll were not updating _readObjects and _writeObjects
anymore, since this was done by the queue handling code, which they no
longer use after the refactorization. (check-in: [258b8a4944] user: js, branch: trunk, size: 5963) [annotate] [blame] [check-ins using] [diff]

2015-12-29
21:42
[9085a7dddc] part of check-in [c5f0c5f9ba] Refactor OFKernelEventObserver

This moves the locked queue for actions to
OFKernelEventObserver_LockedQueue, which is now used for select and
poll, but skipped for kqueue and epoll, as they natively support changes
from another thread.

This fixes the problem that removing an object is delayed until the next
observe call - at which point it might have already been closed, meaning
the fd is no longer available. This was mainly a problem with kqueue, as
closing the fd already removed it from the kqueue, which then resulted
in an error being returned when trying to manually remove the fd from
the kqueue. (check-in: [c5f0c5f9ba] user: js, branch: 0.8, size: 5125) [annotate] [blame] [check-ins using] [diff]

21:33
[3ad5dffb1b] part of check-in [e9b4700cb6] Refactor OFKernelEventObserver

This moves the locked queue for actions to
OFKernelEventObserver_LockedQueue, which is now used for select and
poll, but skipped for kqueue and epoll, as they natively support changes
from another thread.

This fixes the problem that removing an object is delayed until the next
observe call - at which point it might have already been closed, meaning
the fd is no longer available. This was mainly a problem with kqueue, as
closing the fd already removed it from the kqueue, which then resulted
in an error being returned when trying to manually remove the fd from
the kqueue. (check-in: [e9b4700cb6] user: js, branch: trunk, size: 5123) [annotate] [blame] [check-ins using] [diff]

2015-10-19
22:15
[80111af3e0] part of check-in [1ba08eebc5] Add platform.h & make platform defines consistent (check-in: [1ba08eebc5] user: js, branch: trunk, size: 5087) [annotate] [blame] [check-ins using] [diff]
2015-05-09
18:13
[306f8337d7] part of check-in [220513a3f5] More OFKernelEventObserver refactoring

This was necessary because select(), poll() and kevent() on FreeBSD and
OS X would sometimes return 0 events, even if there are some, and
sometimes return the correct number of events that were pending, meaning
the number of events returned is unreliable. To make things worse,
whether it returns 0 or the number of events that were pending is
completely non-deterministic on both FreeBSD and OS X (running the same
tests multiple times in a row would make it sometimes work and sometimes
fail).

In order to prevent code from depending on the return value of
-[observeForTimeInterval:] (which would depend on select(), poll() and
kevent() returning the correct number), OFKernelObserver no longer
returns whether there were pending events. It is expected that
-[observe] or -[observeForTimeInterval:] is just called in a loop as
long as events should be handled.

The tests have been changed as well to reflect this. What they do now is
set a deadline and call -[observeForTimeInterval:] with a small timeout
in a loop until the deadline is reached or all events have been handled.

Note: DragonFlyBSD has not been tested, but will most likely behave like
FreeBSD and OS X. (check-in: [220513a3f5] user: js, branch: trunk, size: 5089) [annotate] [blame] [check-ins using] [diff]

2015-05-08
21:13
[dac9f53f6d] part of check-in [92344de237] OFKernelEventObserver_kqueue: More error checking (check-in: [92344de237] user: js, branch: trunk, size: 5268) [annotate] [blame] [check-ins using] [diff]
2015-05-04
20:34
[cfe0087621] part of check-in [bbe4040126] Refactor OFKernelEventObserver (check-in: [bbe4040126] user: js, branch: trunk, size: 5118) [annotate] [blame] [check-ins using] [diff]
14:30
[f6c09249b4] part of check-in [ed4a6f396b] Add OFKernelEventObserver_epoll (check-in: [ed4a6f396b] user: js, branch: trunk, size: 4570) [annotate] [blame] [check-ins using] [diff]
2015-04-26
10:40
[08d91618ea] part of check-in [bd05eb8de3] OFKernelEventObserver: Rename a private method (check-in: [bd05eb8de3] user: js, branch: trunk, size: 4570) [annotate] [blame] [check-ins using] [diff]
2015-04-14
19:34
[5dab973998] part of check-in [5924cc3a92] OFKernelEventObserver*.m: Minor cleanup (check-in: [5924cc3a92] user: js, branch: trunk, size: 4564) [annotate] [blame] [check-ins using] [diff]
2015-04-12
20:04
[80d98ba3c7] part of check-in [97da88f926] Add OFObserveFailedException (check-in: [97da88f926] user: js, branch: trunk, size: 4568) [annotate] [blame] [check-ins using] [diff]
2015-02-16
08:39
[d49b28d198] part of check-in [62e2de30b9] Explicitly pass errno to exceptions

The old behaviour where the exception would access errno directly on
creation of the exception was very fragile. The two main problems with
it were that sometimes it would pick up an errno even though none had
been set and in other cases that when the exception was created errno
had already been overridden.

This also greatly increases errno handling on Win32, especially in
conjunction with sockets. It can still be improved further, though. (check-in: [62e2de30b9] user: js, branch: trunk, size: 4432) [annotate] [blame] [check-ins using] [diff]

2015-01-03
20:57
[254cd34c13] part of check-in [cfd374b906] Update copyright (check-in: [cfd374b906] user: js, branch: trunk, size: 4433) [annotate] [blame] [check-ins using] [diff]
2014-12-13
17:50
[dab6fa946c] part of check-in [aebd220efc] Use CLOEXEC for kqueue (check-in: [aebd220efc] user: js, branch: trunk, size: 4427) [annotate] [blame] [check-ins using] [diff]
2014-08-22
19:09
[70736e006a] part of check-in [1dbe9a4e4e] Retain sockets until after removal from observer

Not retaining them caused kevent() to be called on an invalid fd. (check-in: [1dbe9a4e4e] user: js, branch: trunk, size: 4137) [annotate] [blame] [check-ins using] [diff]

2014-06-21
21:43
[76859e1d9d] part of check-in [13ee56edf3] Move all macros from OFObject.h to macros.h

This means that OFObject.h imports macros.h now, making it unnecessary
to manually import macros.h in almost every file. And while at it, also
import autorelease.h in OFObject.h, so that this doesn't need to be
manually imported in almost every file as well. (check-in: [13ee56edf3] user: js, branch: trunk, size: 4845) [annotate] [blame] [check-ins using] [diff]

2014-02-04
09:41
[79faaa634a] part of check-in [41ca862453] OFKernelEventObserver_kqueue: Ignore EBADF

Removed file descriptors were returned in the event list with EBADF if
the file descriptor has been closed before removing them. Interpreting
that as a read event caused problems, as the file descriptor could not
be mapped to an object anymore, thus the entry in the event list is
skipped now if there was a EBADF error. (check-in: [41ca862453] user: js, branch: trunk, size: 4888) [annotate] [blame] [check-ins using] [diff]

2014-01-29
15:54
[d4951ca160] part of check-in [c694569d86] Generalize OFKernelEventObserver

It is no longer limited to streams now. (check-in: [c694569d86] user: js, branch: trunk, size: 3880) [annotate] [blame] [check-ins using] [diff]

2014-01-28
22:50
Added: [e09ea174d3] part of check-in [96e20b8093] Rename OFStreamObserver -> OFKernelEventObserver (check-in: [96e20b8093] user: js, branch: trunk, size: 4141) [annotate] [blame] [check-ins using]