We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 498d19c + 3ad2191 commit 82b6bfeCopy full SHA for 82b6bfe
Sources/Transactions.swift
@@ -167,7 +167,8 @@ internal final class TLog {
167
168
static func atomically<T>(_ p : (TLog) throws -> T) throws -> T {
169
let trans = TLog()
170
- assert(STMCurrentTransaction.tryPut(trans), "Transaction already running on current thread")
+ let transactionEnterSucceed = STMCurrentTransaction.tryPut(trans)
171
+ precondition(transactionEnterSucceed, "Transaction already running on current thread")
172
defer {
173
_ = STMCurrentTransaction.take()
174
}
0 commit comments