Skip to content

Commit 82b6bfe

Browse files
authored
Merge pull request #45 from EugenePogrebnoy/master
Fixed hang when compiled with Release configuration
2 parents 498d19c + 3ad2191 commit 82b6bfe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/Transactions.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ internal final class TLog {
167167

168168
static func atomically<T>(_ p : (TLog) throws -> T) throws -> T {
169169
let trans = TLog()
170-
assert(STMCurrentTransaction.tryPut(trans), "Transaction already running on current thread")
170+
let transactionEnterSucceed = STMCurrentTransaction.tryPut(trans)
171+
precondition(transactionEnterSucceed, "Transaction already running on current thread")
171172
defer {
172173
_ = STMCurrentTransaction.take()
173174
}

0 commit comments

Comments
 (0)