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.
1 parent 209d6c4 commit 7a73f82Copy full SHA for 7a73f82
Sources/Signal.swift
@@ -134,6 +134,10 @@ public final class Signal<Value, Error: Swift.Error> {
134
if !shouldDispose && !terminated && !isTerminating, let state = interruptedState {
135
sendLock.lock()
136
137
+ // `terminated` before acquring the lock could be a false negative,
138
+ // since it might race against other concurrent senders until the
139
+ // lock acquisition above succeeds. So we have to check again if the
140
+ // signal is really still alive.
141
if !terminated {
142
interrupt(state.observers)
143
shouldDispose = true
0 commit comments