Commit graph

16 commits

Author SHA1 Message Date
Sönke Ludwig
48d083b20f Fix possible race condition in PosixEventDriverEvents.trigger.
Accessing the event slot should only be done from the owner thread, since the chunk index of the ChoppedVector could be updated at any time. Instead of a triggerAll field, this flag is now propagated through the underlying eventfd/socket pair.
2019-04-13 18:27:23 +02:00
Radu Racariu
07b09e8692
fix @safe 2019-02-12 19:55:32 +02:00
Radu Racariu
6286c7980d
[PosixEventDriverEvents] Use Linux definitions from druntime
This doesn't duplicate the definitions form `core.sys.linux.sys.eventfd` and will pickup any platform specifics for better portability.
Fixes https://github.com/vibe-d/eventcore/issues/102
2019-02-12 19:47:37 +02:00
Sönke Ludwig
e7e4a0f5f5 Make the Posix driver initialization nogc. 2018-10-24 11:38:14 +02:00
Sönke Ludwig
7da41301af Tighten the file descriptor slot checks.
Gives the chance to detect possible dangling file descriptors earlier.
2018-03-17 13:11:44 +01:00
Sönke Ludwig
7bfbb64899 Add userData!T properties for all descriptor based primitives. 2018-03-16 13:39:03 +01:00
Sönke Ludwig
df78af96bb Use a custom nogc_assert in cleanup code.
Unfortunately the built-in assert GC allocates an exception, which means that if called directly or indirectly form a finalizer, the assertion will not become visible and instead an InvalidMemoryOperationError is thrown.

This implements a custom nogc_assert() function that directly prints the assertion message and uses abort() to end the process.
2018-03-11 13:56:10 +01:00
Sönke Ludwig
6e2938297b Set O_CLOEXEC on the remaining FDs that are created by eventcore. 2017-12-19 22:10:14 +01:00
Hiroki Noda
214382dcb5 Set EFD_CLOEXEC
Add missing one.
2017-12-19 13:38:47 +09:00
Sönke Ludwig
07d2bafcac Fix threading issues in the generic Posix event implementation.
Uses socketpair non-Linux systems and two separate UDP sockets on Windows for the cross-thread communication.
2017-11-25 11:42:19 +01:00
Sönke Ludwig
4d00376873 Ensure proper reference count for created Posix events. 2017-11-23 23:12:35 +01:00
Sönke Ludwig
c8fd340240 Fix destruction of PosixEventDriverEvents event.
The reference count was one too high and the waiter count was not properly decremented when an event got destroyed.
2017-11-23 23:11:16 +01:00
Sönke Ludwig
d99eb1be34
Fix waiter count tracking in the Posix driver. Fixes #8. 2017-06-10 10:27:55 +02:00
Sönke Ludwig
1ff3d00020
Check return value of eventfd for errors. 2017-06-10 00:06:45 +02:00
Sönke Ludwig
b52747247b
Fix Linux compilation. 2017-01-25 12:33:00 +01:00
Sönke Ludwig
d1829669ec Split up Posix event driver into separate files. 2017-01-25 00:11:57 +01:00