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 507e5c8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Tests/ReactiveSwiftTests/ActionSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ 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 triggers the propagation of
// terminal event of the Action, which eventually hits the mapped
// signal.
action1.values
.flatMap(.latest) { viewModel in viewModel.action2.values.map { _ in viewModel } }
.observeValues { _ in }
Expand Down

0 comments on commit 507e5c8

Please sign in to comment.