Implement session cache upgrade phase 1 foundation

This commit is contained in:
2026-03-20 08:35:37 +01:00
parent 41199cb9bc
commit e98e5fd88b
14 changed files with 552 additions and 34 deletions

View File

@@ -0,0 +1,14 @@
import os
/// Thread-safe cancellation flag for cooperative stream shutdown.
final class CancellationToken: @unchecked Sendable {
private let lock = OSAllocatedUnfairLock(initialState: false)
var isCancelled: Bool {
lock.withLock { $0 }
}
func cancel() {
lock.withLock { $0 = true }
}
}