File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
stdlib/public/Concurrency Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,13 @@ import Swift
2424/// operation is running code that never checks for cancellation, a cancellation
2525/// handler still runs and provides a chance to run some cleanup code.
2626///
27+ /// Cancellation handlers which acquire locks must take care to avoid deadlock.
28+ /// The cancellation handler may be invoked while holding internal locks
29+ /// associated with the task or other tasks. Other operations on the task, such
30+ /// as resuming a continuation, may acquire these same internal locks.
31+ /// Therefore, if a cancellation handler must acquire a lock, other code should
32+ /// not cancel tasks or resume continuations while holding that lock.
33+ ///
2734/// Doesn't check for cancellation, and always executes the passed `operation`.
2835///
2936/// The `operation` executes on the calling execution context and does not suspend by itself,
You can’t perform that action at this time.
0 commit comments