Since the signal handler can be called in any thread of the application, it may happen so in a non-D thread where Thread.getThis() returns null. This change works around this and also removes the need to call SpinLock.setup on thread startup.
- terminate() would hang if called from a worker thread because it would attempt to self-join
- the handleWorkerTasks could miss signal emits, resulting in a hanging task queue or a missed termination signal
Fixes a discrepancy in TaskFiberQueue between empty and length, which causes process() to never return, thus processing events without timeout indefinitely.
The status of the task was erroneously reported as not running until the task was actually executed for the first time (which only happens after the yield lock has been lifted).
MonoTime is more robust and does not involve sophisticated timezone
shenanigans, making it better suited for networking operations.
Fixes#39.
This commit also distinguishes read timeout exception as Exception child
ReadTimeoutException, wich is thrown from loopWithTimeout function.
Optimistic read branch for tcp socket improves performance on
granular reads.
Certain errors will result in an invalid handle to be returned from eventDriver.sockets.connectStream. In that case it is invalid to call cancelConnect.
Also adds an additional debug log message including a stack trace in case of exceptions thrown from connection handlers.
This change modifies destructors to anticipate that they can be called form a foreign thread if the GC is involved. The actual release of the reference will then happen deferred in the original thread.
ConnectionPool!TCPConnection used to work with the old vibe-d:core implementation, but now failed, because TCPConnection is a struct. All assumptions about `Connection` being a class have been remove in this commit.
If the lambda is a concrete function, two different versions will end up for it in the final binary on macOS when compiled with LDC. Using argument inference works around that issue.
Idle processing needs to check whether there are still tasks scheduled to be resumed before setting the exit flag when there are no more waiters (I/O etc.).
Previously the task was only removed if switchTo was called from another task. Now it also gets removed when switchTo (e.g. due to a runTask() call) gets called form outside of a task.