mirror of
https://github.com/apple/swift-nio.git
synced 2026-05-20 20:30:36 +00:00
663ddc80f2
Motivation: The various 'withMumbleContinuation' APIs are supposed to be invoked synchronously with the caller. This assumption allows a lock to be acquired before the call and released from the body of the 'withMumbleContinuation' after e.g. storing the continuation. However this isn't the case and the job may be re-enqueued on the executor meaning that this is pattern is vulnerable to deadlocks. Modifications: - Drop and reacquire the lock in TokenBucket. - Switch to NIOLockedValueBox Result: Lower chance of deadlock