ObjFW  History of src/OFKernelEventObserver.h of bd2d723910df5ff3

History of file src/OFKernelEventObserver.h at check-in bd2d723910df5ff3

2024-06-17
21:08
Always use <ObjFW/ObjFW.h> in documentation file: [4a3d1a5b32] check-in: [164f2fb4bf] user: js, branch: trunk, size: 7820 [annotate] [blame] [check-ins using] [diff]
2024-04-28
08:36
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. file: [15425300f6] check-in: [ff3a60cc12] user: js, branch: trunk, size: 7913 [annotate] [blame] [check-ins using] [diff]

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

2020-10-03
11:35
Use /** */ instead of /*! */ for documentation file: [74da8f3153] check-in: [163a4a5a2e] user: js, branch: trunk, size: 7086 [annotate] [blame] [check-ins using] [diff]
2020-09-26
21:58
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. file: [2919da30f1] check-in: [ef614a225d] user: js, branch: trunk, size: 7086 [annotate] [blame] [check-ins using] [diff]

2020-01-07
20:28
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. file: [f3b368ad12] check-in: [24eff635db] user: js, branch: trunk, size: 7063 [annotate] [blame] [check-ins using] [diff]

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

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

2019-08-31
17:13
Make -[OFKernelEventObserver cancel] work on Amiga file: [97255f4a8b] check-in: [8941b1d974] user: js, branch: trunk, size: 7033 [annotate] [blame] [check-ins using] [diff]
12:40
OFKernelEventObserver: Support for Exec Signals file: [860be5ffa7] check-in: [e9eb87694a] user: js, branch: trunk, size: 6875 [annotate] [blame] [check-ins using] [diff]
2019-01-03
19:13
Update copyright file: [79a475a756] check-in: [0509d7a844] user: js, branch: trunk, size: 6456 [annotate] [blame] [check-ins using] [diff]
2018-01-03
19:49
Update copyright notice file: [3b1a6de32c] check-in: [7e5c81e186] user: js, branch: trunk, size: 6450 [annotate] [blame] [check-ins using] [diff]
2017-11-19
11:04
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. file: [ee35836078] check-in: [69749b6a5b] user: js, branch: trunk, size: 6427 [annotate] [blame] [check-ins using] [diff]

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

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

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

Casts are now written like types in variable declarations. file: [e653f3b4a2] check-in: [4af49a13c3] user: js, branch: trunk, size: 6500 [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: [316e90db78] check-in: [44f45c2e35] user: js, branch: trunk, size: 6499 [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: [705ced3614] check-in: [85917ea0dd] user: js, branch: 0.8, size: 7000 [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: [dd46f03e3d] check-in: [45518ae7b7] user: js, branch: trunk, size: 6493 [annotate] [blame] [check-ins using] [diff]

2016-01-03
00:43
Update copyright

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

00:41
Update copyright

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

00:36
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. file: [f92733e89e] check-in: [d1c4c46706] user: js, branch: 0.8, size: 6915 [annotate] [blame] [check-ins using] [diff]

00:35
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. file: [72e7bbbce5] check-in: [258b8a4944] user: js, branch: trunk, size: 6408 [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: [b0b3935794] check-in: [c5f0c5f9ba] user: js, branch: 0.8, size: 6821 [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: [4fe6de3289] check-in: [e9b4700cb6] user: js, branch: trunk, size: 6314 [annotate] [blame] [check-ins using] [diff]

2015-11-29
14:20
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. file: [44498ce7a3] check-in: [ba62f00fac] user: js, branch: trunk, size: 6542 [annotate] [blame] [check-ins using] [diff]

11:43
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). file: [9901acfc70] check-in: [48980f2297] user: js, branch: trunk, size: 6677 [annotate] [blame] [check-ins using] [diff]

2015-06-17
22:11
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. file: [dd8f6e2345] check-in: [80e1a9655b] user: js, branch: trunk, size: 7049 [annotate] [blame] [check-ins using] [diff]

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

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

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

2014-01-29
15:54
Generalize OFKernelEventObserver

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

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