Skip to content

Commit 66636b3

Browse files
committed
Aligning with Mutex signature
1 parent 4feaadf commit 66636b3

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

FlyingSocks/Sources/AllocatedLock.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ package struct AllocatedLock<State>: @unchecked Sendable {
4242
}
4343

4444
@inlinable
45-
package func withLock<R, E>(_ body: @Sendable (inout State) throws(E) -> sending R) throws(E) -> sending R where E: Error {
45+
package func withLock<R, E>(_ body: (inout sending State) throws(E) -> sending R) throws(E) -> sending R where E: Error {
4646
storage.lock()
4747
defer { storage.unlock() }
4848
return try body(&storage.state)

FlyingSocks/Sources/ConsumingAsyncSequence.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ extension ConsumingAsyncSequence {
106106
}
107107

108108
func setState(_ state: State) {
109-
let t = Transferring(state)
110-
self.state.withLock { $0 = t.value }
109+
self.state.withLock { $0 = state }
111110
}
112111
}
113112
}

0 commit comments

Comments
 (0)