Skip to content

Commit 403e4c7

Browse files
committed
Added information regarding the fixed deadlock to the test case.
1 parent 34e3e5e commit 403e4c7

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/ReactiveSwiftTests/ActionSpec.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,14 @@ class ActionSpec: QuickSpec {
121121

122122
let action1 = Action<(), ViewModel, NoError> { SignalProducer(value: ViewModel()) }
123123

124+
// Fixed in #267. (https://github.com/ReactiveCocoa/ReactiveSwift/pull/267)
125+
//
126+
// The deadlock happened as the observer disposable releases the closure
127+
// `{ _ in viewModel }` here without releasing the mapped signal's
128+
// `updateLock` first. The deinitialization of the closure triggered the
129+
// propagation of terminal event of the `Action`, which eventually hit
130+
// the mapped signal and attempted to acquire `updateLock` to transition
131+
// the signal's state.
124132
action1.values
125133
.flatMap(.latest) { viewModel in viewModel.action2.values.map { _ in viewModel } }
126134
.observeValues { _ in }

0 commit comments

Comments
 (0)