Skip to content

Commit

Permalink
Added information regarding the fixed deadlock to the test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
andersio committed Feb 17, 2017
1 parent 34e3e5e commit 403e4c7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/ReactiveSwiftTests/ActionSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ class ActionSpec: QuickSpec {

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

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

0 comments on commit 403e4c7

Please sign in to comment.