Commit graph

387 commits

Author SHA1 Message Date
Sönke Ludwig 0c62764216
Add Solaris definition for O_CLOEXEC. Fixes #82. 2018-08-16 15:19:12 +02:00
Sönke Ludwig 00ef149c04
Merge pull request #81 from vibe-d/windows_event_poll_fixes
Remove special case for zero-wait processing off events.
2018-06-05 12:12:31 +02:00
Sönke Ludwig 5d317ca9e7 Remove special case for zero-wait processing off events.
This ensures that all kinds of events are processed, including timers and I/O events.
2018-06-05 11:35:57 +02:00
Sönke Ludwig abdbc91c4b
Merge pull request #72 from kubo39/res_init
Call __res_init on linux when getaddrinfo failed, fix #40
2018-05-13 09:45:12 +02:00
The Dlang Bot ca56b31566
Merge pull request #71 from kubo39/somaxconn
Get the listen backlog size from net.core.somaxconn on Linux
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2018-05-13 09:44:42 +02:00
Sönke Ludwig 745e4ea2c6
Merge pull request #79 from vibe-d/nested_initialization
Fix initialization behavior when being loaded as a shared library.
2018-05-05 12:16:57 +02:00
Sönke Ludwig 48b214dd09
Fix initialization behavior when being loaded as a shared library.
When loading a shared library where both, the host and the library, use eventcore, the static constructors/destructors will be called multiple times.
2018-05-04 17:45:10 +02:00
Sönke Ludwig 242432c416 Fix two possible causes for range violations in the WinAPI handle map. 2018-03-30 16:57:45 +02:00
Sönke Ludwig 811ae63698 Fix indentation. 2018-03-30 16:56:42 +02:00
Hiroki Noda e68f1425a9 format 2018-03-22 05:16:36 +09:00
Hiroki Noda d3708c5e66 Fix: leak fd 2018-03-22 05:14:10 +09:00
Hiroki Noda 041d55e584 Get the listen backlog size from net.core.somaxconn on linux 2018-03-22 05:12:37 +09:00
Sönke Ludwig 51527e77f8 Actually close files in the WinAPI driver. 2018-03-20 21:03:43 +01:00
Sönke Ludwig df9e9fce3d
Merge pull request #70 from vibe-d/lazy_dns_event
Create the DNS helper event lazily.
2018-03-18 09:58:14 +01:00
Sönke Ludwig 3cb0891c58 Create the DNS helper event lazily.
Reduces resource usage on threads that don't perform DNS queries.
2018-03-18 01:32:09 +01:00
Sönke Ludwig eaf7ab778b
Merge pull request #69 from vibe-d/fix_file_close
Fix dangling handles resulting from actively closing a file.
2018-03-18 01:31:40 +01:00
Sönke Ludwig b09d15d503 Fix dangling handles resulting from actively closing a file. 2018-03-17 17:11:03 +01:00
Sönke Ludwig 546f8f8445
Merge pull request #68 from vibe-d/file_resource_improvent
Tighten the file descriptor slot checks.
2018-03-17 17:10:33 +01: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 d2cac0cca1
Merge pull request #66 from vibe-d/run_in_owner_thread
Implement runInOwnerThread
2018-03-16 17:51:01 +01:00
Sönke Ludwig 1dfed63ad9 Drop left-over DMD 2.071 test run. 2018-03-16 16:11:47 +01:00
Sönke Ludwig 910451557b Add test for runInOwnerThread. 2018-03-16 16:11:47 +01:00
Sönke Ludwig 16e2d9587d Implement EventDriverCore.runInOwnerThread. 2018-03-16 16:11:46 +01:00
Sönke Ludwig ff4d65a131
Merge pull request #67 from vibe-d/more_userdata
Add userData!T properties for all descriptor based primitives.
2018-03-16 15:52:56 +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 68b8f44957
Merge pull request #63 from vibe-d/fix_connect_socket_callback
Call the callback on connectStream socket creation failure.
2018-03-14 22:19:14 +01:00
Sönke Ludwig 6262c48db3
Merge pull request #65 from vibe-d/fix_eventfd_leak
Fix leaked eventfd in PosixEventDriverCore.
2018-03-14 22:19:00 +01:00
Sönke Ludwig 50f135416c
Merge pull request #64 from vibe-d/lazy_threadedfile_event
Create the event object in ThreadedFileEventDriver lazily.
2018-03-14 22:18:42 +01:00
Sönke Ludwig b6b32f4a49 Fix leaked eventfd in PosixEventDriverCore.
The leak occurred once per thread, which showed up in conjunction with DNS lookups in particular, as a thread is currently created for each lookup.
2018-03-14 21:59:42 +01:00
Sönke Ludwig 4192d31716 Create the event object in ThreadedFileEventDriver lazily.
Avoids creating event objects for every worker thread, even if never used.
2018-03-14 21:39:54 +01:00
Sönke Ludwig 02de8341aa Call the callback on connectStream socket creation failure.
The callback must *always* be called at some point, because the generic async->sync logic in vibe-core otherwise has no way to know whether to expect a callback or not.
2018-03-14 20:43:40 +01:00
Sönke Ludwig 0044946413
Merge pull request #62 from vibe-d/fix_winapi_watcher_shutdown
Fix cleanup code for directory watchers in the WinAPI driver.
2018-03-14 19:11:53 +01:00
Sönke Ludwig 53bb8eeead Fix cleanup code for directory watchers in the WinAPI driver.
- Fixes an assertion triggered by accessing a file field in releaseRef

- Fixed a potential leak of file system watcher handles when calling releaseRef from inside the supplied callback - this was the reason why the fixed assertion error wasn't triggered by the test code
2018-03-14 16:39:57 +01:00
The Dlang Bot 574de0760d
Merge pull request #59 from vibe-d/github_dub_download
Download DUB 1.8.0 from GitHub instead of code.dlang.org.
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
2018-03-12 19:27:17 +01:00
Sönke Ludwig 7a43468bbd Download DUB 1.7.2 from GitHub instead of code.dlang.org. 2018-03-12 12:57:39 +01:00
Sönke Ludwig 3d7cf5744c
Merge pull request #61 from vibe-d/remove_obsolete_events
Fix issues in the WinAPI driver
2018-03-12 00:00:10 +01:00
Sönke Ludwig a681fc988b
Merge pull request #60 from vibe-d/single_file_taskpool
Use a single thread pool for all threaded file driver threads.
2018-03-11 23:36:34 +01:00
Sönke Ludwig f094b3934b Make sure that no obsolete I/O events get processed.
Removes overlapped I/O events when a handle gets closed prematurely (before all events have been processed) to avoid potential range violation errors as a consequence.
2018-03-11 20:32:32 +01:00
Sönke Ludwig 26907c7489 Fix set up of OVERLAPPED struct for files. 2018-03-11 20:31:44 +01:00
Sönke Ludwig 3090bc2c7c Implement filterPending for ConsumableQueue. 2018-03-11 20:31:44 +01:00
Sönke Ludwig bcf178ef98
Merge pull request #58 from vibe-d/nogc_assert
Use a custom nogc_assert in cleanup code.
2018-03-11 20:30:50 +01:00
Sönke Ludwig f5f64ee476 Use a single thread pool for all threaded file driver threads.
This avoids multiplying the number of threads by 5 for each thread that performs file I/O.
2018-03-11 14:46:55 +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 acc35e1107
Merge pull request #57 from vibe-d/fix_windows_completion_routines
Call Windows IO callbacks outside of completion routines.
2018-03-11 12:03:13 +01:00
Sönke Ludwig 9dc8b796e5 Get rid of OVERLAPPED_FILE.
The hEvent member is currently unused for files. Using it for the file handle makes the OVERLAPPED_CORE struct sufficient.
2018-03-11 00:27:14 +01:00
Sönke Ludwig 0e1d74cc41 Call Windows IO callbacks outside of completion routines.
Calling WinSock functions from inside of a completion routine results in undefined behavior, because the completion routine may be triggered within another WinSock function that enters an alertable wait state. For this reason, none of the callbacks that are triggered by overlapped I/O may be invoked directly from a completion routine.

To solve this, a ConsumableQueue is filled with all completion events that occur and is processed after each MsgWaitForMultipleObjectsEx call.
2018-03-10 22:59:21 +01:00
Sönke Ludwig cdbd8b58e8
Merge pull request #55 from vibe-d/issue_54_accept_state
Fix connection state after accept in the WinAPI driver
2018-03-07 11:43:58 +01:00
Sönke Ludwig 0b02c84b2b Set ConnectionState.connected when accepting a connection. Fixes #54. 2018-03-07 11:00:03 +01:00
Sönke Ludwig d15e78a517 Test for proper connection state after a successful accept/connect.
Test for #54.
2018-03-07 10:59:31 +01:00
Sönke Ludwig 008163e913 Fix setTCPNoDelay/setKeepAlive and add assertions.
Assertions make sure that socket query functions are not called with an invalid handle (resulting in strange out-of-memory errors).
2018-03-07 10:52:01 +01:00