 	/// observers.
 	fileprivate let retaining: Signal<Value, Error>?
 
-	fileprivate let associated: U
-
-	/// Create a snapshot.
+	/// Create an alive state.
 	///
 	/// - parameters:
 	///   - observers: The latest bag of observers.
 	///   - retaining: The self-retaining reference of the `Signal`, if necessary.
-	///   - associated: An associated value.
-	init(observers: Bag<Signal<Value, Error>.Observer> = Bag(), retaining: Signal<Value, Error>? = nil, associated: U) {
+	init(observers: Bag<Signal<Value, Error>.Observer> = Bag(), retaining: Signal<Value, Error>? = nil) {
 		self.observers = observers
 		self.retaining = retaining
-		self.associated = associated
-	}
-}
-
-extension SignalStateSnapshot where U: ExpressibleByNilLiteral {
-	/// Create a snapshot.
+	}
+}
+
+/// The state of a terminating `Signal`. It contains a bag of observers and the
+/// termination event.
+private final class TerminatingState<Value, Error: Swift.Error> {
+	/// The observers of the `Signal`.
+	fileprivate let observers: Bag<Signal<Value, Error>.Observer>
+
+	///  The termination event.
+	fileprivate let event: Event<Value, Error>
+
+	/// Create a terminating state.
 	///
 	/// - parameters:
 	///   - observers: The latest bag of observers.
-	///   - retaining: The self-retaining reference of the `Signal`, if necessary.
-	convenience init(observers: Bag<Signal<Value, Error>.Observer> = Bag(), retaining: Signal<Value, Error>? = nil) {
-		self.init(observers: observers, retaining: retaining, associated: nil)
+	///   - event: The termination event.
+	init(observers: Bag<Signal<Value, Error>.Observer>, event: Event<Value, Error>) {
+		self.observers = observers
+		self.event = event
 	}
 }
 

			//
			//   `updateLock` must be acquired.
			//
			// - Transit from `alive` to `terminating`.
			//
			//   `updateLock` must be acquired.
			//
			// - Extract the snapshot of a terminating signal to deliver the
			//   termination event, and transit from `terminating` to `terminated`.
			//
			//   Both `sendLock` and `updateLock` must be acquired. The state must
			//   also be checked again after the locks are acquired. Fail gracefully

/// The Swift compiler has also an optimization for enums with payloads that are
/// all reference counted, and at most one no-payload case.
private enum SignalState<Value, Error: Swift.Error> {
	/// The `Signal` is alive.
	case alive(AliveState<Value, Error>)

	/// The `Signal` has received a termination event, and is about to be
	/// terminated.
	case terminating(TerminatingState<Value, Error>)

	/// The `Signal` has terminated.
	case terminated
}

// As the amount of state would definitely span over a cache line,
// `AliveState` and `TerminatingState` is set to be a reference type so
// that we can atomically update the reference instead.
//
// Note that in-place mutation should not be introduced to `AliveState` and
// `TerminatingState`. Copy the states and create a new instance.

/// The state of a `Signal` that is alive. It contains a bag of observers and
/// an optional self-retaining reference.
private final class AliveState<Value, Error: Swift.Error> {
	/// The observers of the `Signal`.
	fileprivate let observers: Bag<Signal<Value, Error>.Observer>

