ObjFW  History of src/OFKernelEventObserver.h of ddb7ebcf5b0f8401

History of the file that is called src/OFKernelEventObserver.h at check-in ddb7ebcf5b0f8401

2024-04-28
08:36
[15425300f6] part of check-in [ff3a60cc12] Use @synchronized over OFMutex in a few places

These places are not super performance critical and the code becomes a
lot more readable.

Actually using @synchronized in ObjFW itself is also a good motivation
to optimize it further. (check-in: [ff3a60cc12] user: js, branch: trunk, size: 7913) [annotate] [blame] [check-ins using] [diff]

2024-04-03
02:16
[d4eaadb46a] part of check-in [7413a728a7] Change license to LGPLv3 only (check-in: [7413a728a7] user: js, branch: trunk, size: 7959) [annotate] [blame] [check-ins using] [diff]
2024-02-03
09:17
[66b0f1cbbb] part of check-in [83686d667e] Minor documentation style fix (check-in: [83686d667e] user: js, branch: 1.0, size: 7751) [annotate] [blame] [check-ins using] [diff]
09:17
[d85dfacfc9] part of check-in [6fb87c3bbc] Minor documentation improvement (check-in: [6fb87c3bbc] user: js, branch: trunk, size: 7751) [annotate] [blame] [check-ins using] [diff]
2024-01-02
17:17
[eb3d0cf38f] part of check-in [26ddd2e4e4] Update copyright (check-in: [26ddd2e4e4] user: js, branch: trunk, size: 7753) [annotate] [blame] [check-ins using] [diff]
2023-08-05
10:12
[c6ff38a2d3] part of check-in [de6dbcf928] Make platform-specific methods show up in Doxygen (check-in: [de6dbcf928] user: js, branch: trunk, size: 7753) [annotate] [blame] [check-ins using] [diff]
2023-01-06
09:04
[3a6c883edd] part of check-in [8939cbdb52] Update copyright (check-in: [8939cbdb52] user: js, branch: trunk, size: 7693) [annotate] [blame] [check-ins using] [diff]
2022-09-25
20:14
[81efdafa0c] part of check-in [5a4e00df9a] Document more exceptions (check-in: [5a4e00df9a] user: js, branch: trunk, size: 7693) [annotate] [blame] [check-ins using] [diff]
2022-09-24
17:03
[c766a415b3] part of check-in [5202319334] Document more exceptions (check-in: [5202319334] user: js, branch: trunk, size: 7651) [annotate] [blame] [check-ins using] [diff]
2022-09-19
19:41
[06324c47be] part of check-in [97f3f7b648] Fix a few documentation issues (check-in: [97f3f7b648] user: js, branch: trunk, size: 6998) [annotate] [blame] [check-ins using] [diff]
2022-02-12
07:46
[21aebcf8a0] part of check-in [1a86b8175b] Update copyright (check-in: [1a86b8175b] user: js, branch: trunk, size: 6997) [annotate] [blame] [check-ins using] [diff]
2021-04-18
20:51
[76fb579d1c] part of check-in [35de667566] Rename everything in several smaller files (check-in: [35de667566] user: js, branch: new-naming-convention, size: 6997) [annotate] [blame] [check-ins using] [diff]
2021-04-17
12:30
[96edbc82e4] part of check-in [c4ae62dd34] of_socket_t -> OFSocketHandle (check-in: [c4ae62dd34] user: js, branch: new-naming-convention, size: 6996) [annotate] [blame] [check-ins using] [diff]
00:51
[3c8cfabf76] part of check-in [8c0d76f782] of_time_interval_t -> OFTimeInterval (check-in: [8c0d76f782] user: js, branch: new-naming-convention, size: 6993) [annotate] [blame] [check-ins using] [diff]
2021-01-02
22:04
[9a570d3d9f] part of check-in [374e1a1bfa] Update copyright (check-in: [374e1a1bfa] user: js, branch: trunk, size: 6997) [annotate] [blame] [check-ins using] [diff]
2020-11-29
02:44
[e557d74842] part of check-in [d76213374e] OFKernelEventObserver: Reorder #ifdefs

Check for AmigaOS first, as we have a special implementation for it that
uses WaitSelect() instead. This way, we no longer need to match $host_os
to manually disable the pipe() check, which would break if one of the
AmigaOS variants adds pipe() later on. (check-in: [d76213374e] user: js, branch: trunk, size: 7086) [annotate] [blame] [check-ins using] [diff]

2020-10-03
11:35
[74da8f3153] part of check-in [163a4a5a2e] Use /** */ instead of /*! */ for documentation (check-in: [163a4a5a2e] user: js, branch: trunk, size: 7086) [annotate] [blame] [check-ins using] [diff]
2020-09-26
21:58
[2919da30f1] part of check-in [ef614a225d] Don't require __COUNTER__ for OF_RESERVE_IVARS

__COUNTER__ does not exist in GCC 4.2, and Apple GCC 4.2 is still the
newest compiler available for macOS 10.5. (check-in: [ef614a225d] user: js, branch: trunk, size: 7086) [annotate] [blame] [check-ins using] [diff]

2020-01-07
20:28
[f3b368ad12] part of check-in [24eff635db] OFKernelEventObserver: Remove queueing of actions

This removes the ability to let a thread add or remove objects for
another thread. This features wasn't used at all, but caused significant
problems with kqueue and epoll, as this often resulted in removing a
file descriptor after it had already been closed. (check-in: [24eff635db] user: js, branch: trunk, size: 7063) [annotate] [blame] [check-ins using] [diff]

2020-01-02
01:51
[587b828b7b] part of check-in [c7f0229795] Update copyright (check-in: [c7f0229795] user: js, branch: trunk, size: 7066) [annotate] [blame] [check-ins using] [diff]
2019-09-29
20:53
[1f89c2433c] part of check-in [e0a330b377] Reduce ivar scopes (check-in: [e0a330b377] user: js, branch: trunk, size: 7063) [annotate] [blame] [check-ins using] [diff]
19:35
[b2d4e300e7] part of check-in [496695d778] Either restrict subclassing or reserve ivar space

This allows ABI stability with the fragile ABI. (check-in: [496695d778] user: js, branch: trunk, size: 7054) [annotate] [blame] [check-ins using] [diff]

2019-08-31
17:13
[97255f4a8b] part of check-in [8941b1d974] Make -[OFKernelEventObserver cancel] work on Amiga (check-in: [8941b1d974] user: js, branch: trunk, size: 7033) [annotate] [blame] [check-ins using] [diff]
12:40
[860be5ffa7] part of check-in [e9eb87694a] OFKernelEventObserver: Support for Exec Signals (check-in: [e9eb87694a] user: js, branch: trunk, size: 6875) [annotate] [blame] [check-ins using] [diff]
2019-01-03
19:13
[79a475a756] part of check-in [0509d7a844] Update copyright (check-in: [0509d7a844] user: js, branch: trunk, size: 6456) [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
[3b1a6de32c] part of check-in [7e5c81e186] Update copyright notice (check-in: [7e5c81e186] user: js, branch: trunk, size: 6450) [annotate] [blame] [check-ins using] [diff]
2017-11-19
11:04
[ee35836078] part of check-in [69749b6a5b] Do not conform to OFReadyFor*Observing by default

Instead of letting OFStream conform to it, which itself does not really
conform to it, let all the subclasses that actually do conform to it. (check-in: [69749b6a5b] user: js, branch: trunk, size: 6427) [annotate] [blame] [check-ins using] [diff]

2017-11-18
18:50
[cad56e81b9] part of check-in [cc3ad3ddd3] Documentation: Use @brief for all properties (check-in: [cc3ad3ddd3] user: js, branch: trunk, size: 6366) [annotate] [blame] [check-ins using] [diff]
2017-10-29
21:58
[81ef5bf556] part of check-in [f3ccf14461] Convert methods to properties where appropriate

This improves Swift compatibility. (check-in: [f3ccf14461] user: js, branch: trunk, size: 6341) [annotate] [blame] [check-ins using] [diff]

2017-09-26
22:01
[25392c4526] part of check-in [319709fff1] Many nullability fixes (check-in: [319709fff1] user: js, branch: 0.90, size: 6525) [annotate] [blame] [check-ins using] [diff]
21:53
[aeb3ba4046] part of check-in [52011fbfd6] Many nullability fixes (check-in: [52011fbfd6] user: js, branch: trunk, size: 6525) [annotate] [blame] [check-ins using] [diff]
2017-08-14
13:33
[4236181f3e] part of check-in [4eab54022e] Always have assign before nonatomic (check-in: [4eab54022e] user: js, branch: trunk, size: 6515) [annotate] [blame] [check-ins using] [diff]
2017-07-22
20:50
[46bd90f11e] part of check-in [c8f7b90082] Split OFDataArray into OFData and OFMutableData (check-in: [c8f7b90082] user: js, branch: trunk, size: 6515) [annotate] [blame] [check-ins using] [diff]
2017-05-13
16:29
[d08ae9a87d] part of check-in [f663d40cbd] Also use nonatomic for non-object properties (check-in: [f663d40cbd] user: js, branch: trunk, size: 6511) [annotate] [blame] [check-ins using] [diff]
2017-05-07
20:10
[e653f3b4a2] part of check-in [4af49a13c3] Small code style change

Casts are now written like types in variable declarations. (check-in: [4af49a13c3] user: js, branch: trunk, size: 6500) [annotate] [blame] [check-ins using] [diff]

2017-01-09
17:36
[316e90db78] 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: 6499) [annotate] [blame] [check-ins using] [diff]

2016-03-20
14:19
[705ced3614] 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: 7000) [annotate] [blame] [check-ins using] [diff]

14:07
[dd46f03e3d] 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: 6493) [annotate] [blame] [check-ins using] [diff]

2016-01-03
00:43
[b2db698d51] part of check-in [cec0f072f8] Update copyright

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

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

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

00:36
[f92733e89e] 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: 6915) [annotate] [blame] [check-ins using] [diff]

00:35
[72e7bbbce5] 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: 6408) [annotate] [blame] [check-ins using] [diff]

2015-12-29
21:42
[b0b3935794] 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: 6821) [annotate] [blame] [check-ins using] [diff]

21:33
[4fe6de3289] 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: 6314) [annotate] [blame] [check-ins using] [diff]

2015-11-29
14:20
[44498ce7a3] part of check-in [ba62f00fac] Clean up optional protocols

Now that we can require GCC >= 4.6, we no longer need to have a category
on OFObject that adds the optional protocol to it. (check-in: [ba62f00fac] user: js, branch: trunk, size: 6542) [annotate] [blame] [check-ins using] [diff]

11:43
[9901acfc70] part of check-in [48980f2297] Make properties a requirement and clean up code

This increases the required GCC version from 4.0 to 4.6 (exception:
Apple GCC, which already supports this with >= 4.0 starting with OS X
10.5). Since even GCC 4.6 is really old by now, there is no point in
still supporting something even older and making the code ugly because
of that. While some hardware and OS support was dropped from GCC 4.6
compared to GCC 4.0, there is nothing in there that would be an
interesting target with the exception of BeOS maybe - but a port to BeOS
can also be achieved using the Haiku support. The other dropped OSes are
mostly old versions of OSes while newer ones are still being supported
(and those newer versions of those OSes still support the same
hardware). (check-in: [48980f2297] user: js, branch: trunk, size: 6677) [annotate] [blame] [check-ins using] [diff]

2015-06-17
22:11
[dd8f6e2345] part of check-in [80e1a9655b] Add OF_NULLABLE_PROPERTY

This is necessary to make GCC (>= 4.6 and Apple GCC) happy as they don't
like the list of property attributes ending in a comma. (check-in: [80e1a9655b] user: js, branch: trunk, size: 7049) [annotate] [blame] [check-ins using] [diff]

2015-06-13
22:26
[134a6fc2ce] part of check-in [9e76144ef8] Add support for and use the new nullability (check-in: [9e76144ef8] user: js, branch: trunk, size: 7034) [annotate] [blame] [check-ins using] [diff]
2015-06-12
23:59
[5f1691d0b1] part of check-in [5329fe7c1a] Add support for and use the new ObjC generics (check-in: [5329fe7c1a] user: js, branch: trunk, size: 6958) [annotate] [blame] [check-ins using] [diff]
2015-05-09
18:13
[c48f1a2944] 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: 6805) [annotate] [blame] [check-ins using] [diff]

2015-05-04
20:34
[7a17ea14b6] part of check-in [bbe4040126] Refactor OFKernelEventObserver (check-in: [bbe4040126] user: js, branch: trunk, size: 6929) [annotate] [blame] [check-ins using] [diff]
2015-03-22
11:42
[2064104d5a] part of check-in [099e939079] Abstract int vs SOCKET as of_socket_t (check-in: [099e939079] user: js, branch: trunk, size: 6992) [annotate] [blame] [check-ins using] [diff]
2015-01-03
20:57
[5fd1c2f371] part of check-in [cfd374b906] Update copyright (check-in: [cfd374b906] user: js, branch: trunk, size: 7010) [annotate] [blame] [check-ins using] [diff]
2014-04-26
00:40
[001fd5d024] part of check-in [4e59d2692f] 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. (check-in: [4e59d2692f] user: js, branch: trunk, size: 7004) [annotate] [blame] [check-ins using] [diff]

2014-02-18
18:50
[e0eb637de6] part of check-in [246cfe0807] Documentation: Show correct imports (check-in: [246cfe0807] user: js, branch: trunk, size: 6954) [annotate] [blame] [check-ins using] [diff]
2014-02-04
09:41
[5b1f9ce35e] 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: 6542) [annotate] [blame] [check-ins using] [diff]

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

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

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