mirror of
https://github.com/apple/swift-nio
synced 2026-11-24 04:37:54 +00:00
* Call `NIOAsyncWriterSinkDelegate` outside of the lock # Motivation The current `NIOAsyncWriter` implementation expects that the delegate is called while holding the lock to avoid reentrancy issues. However, this prevents us from executing the delegate calls directly on the `EventLoop` if we are on it already. # Modification This moves all of the delegate calls outside of the locks and adds protection against reentrancy into the state machine. # Result Less allocations. Clarify the reentrancy problems in docs and protect against them in the writer * Code review