File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,12 @@ public final class Signal<Value, Error: Swift.Error> {
100100 /// Nevertheless, this should not cause the termination event being
101101 /// sent multiple times, since `tryTerminate` would not respond to false
102102 /// positives.
103- private var state : State
103+ private var state : State {
104+ get { return _state. value }
105+ set { _state. value = newValue }
106+ }
107+
108+ private let _state : Atomic < State >
104109
105110 /// Used to ensure that state updates are serialized.
106111 private let updateLock : Lock
@@ -112,7 +117,7 @@ public final class Signal<Value, Error: Swift.Error> {
112117 private var hasDeinitialized : Bool
113118
114119 fileprivate init ( _ generator: ( Observer ) -> Disposable ? ) {
115- state = . alive( AliveState ( observers: Bag ( ) ) )
120+ _state = Atomic ( . alive( AliveState ( observers: Bag ( ) ) ) )
116121
117122 updateLock = Lock . make ( )
118123 sendLock = Lock . make ( )
You can’t perform that action at this time.
0 commit comments