ObjFW  History of src/OFKernelEventObserver_select.m of 462cb8a1087c2d69

History of file src/OFKernelEventObserver_select.m at check-in 462cb8a1087c2d69

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
Use dot syntax file: [02729f3714] check-in: [bceb7ed4c9] user: js, branch: trunk, size: 5142 [annotate] [blame] [check-ins using] [diff]
2019-01-03
19:13
Update copyright file: [30b2a6d54f] check-in: [0509d7a844] user: js, branch: trunk, size: 5160 [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
Update copyright notice file: [771782b86c] check-in: [7e5c81e186] user: js, branch: trunk, size: 5154 [annotate] [blame] [check-ins using] [diff]
2017-10-17
00:33
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. file: [e0ca96b99e] check-in: [2f4e0df8be] user: js, branch: trunk, size: 5131 [annotate] [blame] [check-ins using] [diff]

2017-05-21
21:28
Prefix private methods with of_ instead of OF_

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

20:03
Cast several socket-related arguments to void *

This is required to make it work on MorphOS with -noixemul, as socket
functions take UBYTE * arguments instead then, resulting in a warning
about signedness because char is signed. file: [ca3998cc6e] check-in: [c658e97994] user: js, branch: trunk, size: 5117 [annotate] [blame] [check-ins using] [diff]

2017-05-02
21:10
exceptions: Add nullability specifiers file: [e55d2ae955] check-in: [cc4cb0d824] user: js, branch: trunk, size: 5109 [annotate] [blame] [check-ins using] [diff]
2017-02-04
17:45
Fix typos in comments and strings found by aspell file: [2e0aa307e5] check-in: [5a31a537a1] user: js, branch: trunk, size: 5080 [annotate] [blame] [check-ins using] [diff]
2017-01-09
17:36
Update copyright

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

2016-05-29
18:36
OFKernelEventObserver: Cast FD_SETSIZE to int

FreeBSD stupidly defines this as 1024U, which breaks -Wsign-compare. file: [8eb037b6d9] check-in: [d9398f2439] user: js, branch: trunk, size: 5070 [annotate] [blame] [check-ins using] [diff]

2016-05-28
14:56
OFKernelEventObserver_select: Cast to of_socket_t

This makes sure the correct type is used for FD_*. file: [851bfffddf] check-in: [e74fc30f5b] user: js, branch: trunk, size: 5045 [annotate] [blame] [check-ins using] [diff]

2016-03-20
14:19
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. file: [bb7655fa57] check-in: [85917ea0dd] user: js, branch: 0.8, size: 4893 [annotate] [blame] [check-ins using] [diff]

14:07
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. file: [e66acd4ec0] check-in: [45518ae7b7] user: js, branch: trunk, size: 4955 [annotate] [blame] [check-ins using] [diff]

12:05
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. file: [fe3f6e4f8e] check-in: [b84490ab4f] user: js, branch: 0.8, size: 4703 [annotate] [blame] [check-ins using] [diff]

11:57
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. file: [c7ee699c53] check-in: [7ae17af9f0] user: js, branch: trunk, size: 4765 [annotate] [blame] [check-ins using] [diff]

2016-02-21
15:37
Make use of C99-style for loops file: [1968f741af] check-in: [e0b9167693] user: js, branch: trunk, size: 4827 [annotate] [blame] [check-ins using] [diff]
2016-01-03
00:43
Update copyright

While at it, also update the mail address. file: [8f5e338344] check-in: [cec0f072f8] user: js, branch: 0.8, size: 4765 [annotate] [blame] [check-ins using] [diff]

00:41
Update copyright

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

2015-12-29
21:42
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. file: [6e6cb25888] check-in: [c5f0c5f9ba] user: js, branch: 0.8, size: 4761 [annotate] [blame] [check-ins using] [diff]

21:33
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. file: [8f0b3058db] check-in: [e9b4700cb6] user: js, branch: trunk, size: 4812 [annotate] [blame] [check-ins using] [diff]

2015-10-19
22:15
Add platform.h & make platform defines consistent file: [46057c9c67] check-in: [1ba08eebc5] user: js, branch: trunk, size: 4908 [annotate] [blame] [check-ins using] [diff]
2015-10-17
12:17
Fix two forgotten instances of FD_SETSIZE on Win32 file: [a00b377b97] check-in: [3a9dbf5fee] user: js, branch: trunk, size: 4857 [annotate] [blame] [check-ins using] [diff]
2015-10-04
11:11
Special cases for the Wii's weird network stack

This fixes the tests on Wii. file: [a5041a4d1e] check-in: [4cecf82254] user: js, branch: trunk, size: 4717 [annotate] [blame] [check-ins using] [diff]

2015-06-01
18:27
OFKernelEventObserver_select: Small Win64 fix file: [3a4bb0d8ec] check-in: [734fbbb144] user: js, branch: trunk, size: 4712 [annotate] [blame] [check-ins using] [diff]
2015-05-16
15:16
OFKernelEventObserver_select: Ensure fd >= 0 file: [69ccd8df63] check-in: [a54a47a4c3] user: js, branch: trunk, size: 4633 [annotate] [blame] [check-ins using] [diff]
2015-05-09
18:13
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. file: [331bf675cd] check-in: [220513a3f5] user: js, branch: trunk, size: 4581 [annotate] [blame] [check-ins using] [diff]

2015-05-04
20:34
Refactor OFKernelEventObserver file: [9c1fba606a] check-in: [bbe4040126] user: js, branch: trunk, size: 4806 [annotate] [blame] [check-ins using] [diff]
2015-05-02
21:46
FD_SETSIZE is not (maximum FD number + 1) on Win32

Instead, FD_SETSIZE is the number of file descriptors supported by
select(), independent of the actual file descriptor number.

The default value is 64, even though it seems that Win32 supports much
more than that. Thus, this is defined to 1024 on Win32 now. file: [6084d13774] check-in: [a2738e1a3d] user: js, branch: trunk, size: 4209 [annotate] [blame] [check-ins using] [diff]

2015-04-26
10:40
OFKernelEventObserver: Rename a private method file: [094238e437] check-in: [bd05eb8de3] user: js, branch: trunk, size: 4039 [annotate] [blame] [check-ins using] [diff]
2015-04-14
19:34
OFKernelEventObserver*.m: Minor cleanup file: [ea8324b0c4] check-in: [5924cc3a92] user: js, branch: trunk, size: 4033 [annotate] [blame] [check-ins using] [diff]
2015-04-12
20:04
Add OFObserveFailedException file: [9e96dde949] check-in: [97da88f926] user: js, branch: trunk, size: 4030 [annotate] [blame] [check-ins using] [diff]
2015-01-19
22:44
OFKernelEventObserver_select: Check range of fd file: [905345cfde] check-in: [3cd42fa72d] user: js, branch: trunk, size: 3836 [annotate] [blame] [check-ins using] [diff]
2015-01-03
20:57
Update copyright file: [61b8cbcd77] check-in: [cfd374b906] user: js, branch: trunk, size: 3529 [annotate] [blame] [check-ins using] [diff]
2014-08-22
19:09
Retain sockets until after removal from observer

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

2014-06-21
21:43
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. file: [b091506593] check-in: [13ee56edf3] user: js, branch: trunk, size: 3501 [annotate] [blame] [check-ins using] [diff]

2014-06-16
15:06
Make return type of -[OFArray objects] const

After all, this might (and does for OFArray_adjacent!) return an
internal representation that must not be changed, so changes should be
prevented at compile-time. file: [71a3935230] check-in: [68d32a92c1] user: js, branch: trunk, size: 3544 [annotate] [blame] [check-ins using] [diff]

2014-04-26
00:40
Fix a few issues on LLP64 and Win64

LLP64 was mostly fast enumeration using an unsigned long for the state,
which can't store a pointer or a size_t on LLP64. This is now solved by
either throwing an OFOutOfRangeException if the value of the size_t is
bigger than ULONG_MAX or storing the pointer in the extra field (copied
using memcpy, as it's an array of unsigned long, which again would be
too small to store a pointer).

Win64 was mostly Microsoft not being able to decide whether a length is
a size_t, a DWORD, an int or an unsigned int (thus the different types
in places that seem to be almost the same). But since that would not be
confusing enough, a file descriptor is an int if it's for a file, but a
long long if it is for a socket. But of course, for ReadFile and friends
it's a DWORD instead of an int then. file: [434ba010aa] check-in: [4e59d2692f] user: js, branch: trunk, size: 3538 [annotate] [blame] [check-ins using] [diff]

2014-02-18
00:22
Move around a few defines to be more consistent file: [caa1fbb7ea] check-in: [f9d12201f8] user: js, branch: trunk, size: 3472 [annotate] [blame] [check-ins using] [diff]
2014-01-29
15:54
Generalize OFKernelEventObserver

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

2014-01-28
22:50
Added: Rename OFStreamObserver -> OFKernelEventObserver file: [d472e2c55c] check-in: [96e20b8093] user: js, branch: trunk, size: 4276 [annotate] [blame] [check-ins using]