Files
swift-nio/Sources/NIOCore
Rick Newton-Rogers c2da95cca3 Remove continuation resumption inside locks (#2558)
Motivation:

Whilst investigating deadlocking code elsewhere we discovered that
resuming a continuation inside a lock can call deadlocks.

The reason is that
- `withTaskCancellationHandler` takes a sequence's
underlying runtime lock then executes the cancellation handler.
- The task cancellation handler then does work which requires taking the
  NIO-level lock
- If a NIO method on a separate thread then takes the NIO-level lock and
  within it resumes a continuation e.g. in `yield` we will deadlock
because the resumption attempts to obtain the underlying runtime lock.

Modifications:

Do not resume continuations within locks.

Result:

Fewer deadlock opportunities
2023-10-17 16:36:52 +01:00
..
2023-04-17 08:40:35 +01:00
2023-04-17 08:40:35 +01:00
2023-04-17 08:40:35 +01:00