// How many calls to the core are on their way right now — the "no write in// flight" half of a quiet moment, which the Mac app waits for before it// relaunches itself onto a build installed under it (`SelfRelaunch`). Counted// where every call passes (`CottonCore.callRaw`), so no screen has to report// its own writes and none can forget to.importFoundationpublicfinalclassCallsInFlight: @unchecked Sendable {publicstaticlet shared = CallsInFlight()privatelet lock = NSLock()privatevar calls = 0publicinit() {}publicvar count: Int { lock.withLock { calls } }/// Count `work` as in flight while it runs, however it ends.publicfunc during<T>(_ work: () asyncthrows -> T) asyncrethrows -> T { lock.withLock { calls += 1 }defer { lock.withLock { calls -= 1 } }returntryawait work() }}