 
 	private let lock = NSRecursiveLock()
 	private var observers: Bag<Observer>? = Bag()
-	private let disposable = CompositeDisposable()
 
 	/// Initializes a Signal that will immediately invoke the given generator,
 	/// then forward events sent to the given observer.
 	///
-	/// The Signal will remain alive until an `Error` or `Completed` event is
-	/// sent, or until the signal's `disposable` has been disposed, at which
-	/// point the disposable returned from the closure will be disposed as well.
+	/// The Signal will remain alive until a terminating event is sent to the
+	/// observer, at which point the disposable returned from the closure will
+	/// be disposed as well.
 	public init(_ generator: Observer -> Disposable?) {
 		lock.name = "org.reactivecocoa.ReactiveCocoa.Signal"
 
+		let generatorDisposable = SerialDisposable()
 		let sink = Observer { event in
 			self.lock.lock()
 

				}

				if event.isTerminating {
					self.disposable.dispose()
				}
			}

			self.lock.unlock()
		}

		disposable.addDisposable {
			self.lock.lock()
			self.observers = nil
			self.lock.unlock()
		}

		if let d = generator(sink) {
			disposable.addDisposable(d)
		}
	}

	/// A Signal that never sends any events.
	public class var never: Signal {
		return self { _ in nil }
	}

	/// Creates a Signal that will be controlled by sending events to the given
	/// observer (sink).
	///
	/// The Signal will remain alive until an `Error` or `Completed` event is
	/// sent to the observer.
	public class func pipe() -> (Signal, Observer) {
		var sink: Observer!
		let signal = self { innerSink in

		return (signal, sink)
	}

	/// Observes the Signal by sending any future events to the given sink. If
	/// the Signal has already terminated, the sink will immediately receive a
	/// `Cancelled` event.
	///
	/// Returns a Disposable which can be used to disconnect the sink. Disposing
	/// of the Disposable will have no effect on the Signal itself.
	public func observe<S: SinkType where S.Element == Event<T, E>>(observer: S) -> Disposable? {
		let sink = Observer(observer)

		lock.lock()
		let token = self.observers?.insert(sink)
		lock.unlock()

		if token == nil {
			sink.put(.Cancelled)
			return nil
		} else {
			return ActionDisposable {
				self.lock.lock()
				self.observers?.removeValueForToken(token!)
				self.lock.unlock()
			}
		}
	}

	/// Observes the Signal by invoking the given callbacks when events are
	/// received. If the Signal has already terminated, the `cancelled` callback
	/// will be invoked immediately.
	///
	/// Returns a Disposable which can be used to stop the invocation of the
	/// callbacks. Disposing of the Disposable will have no effect on the Signal
	/// itself.
	public func observe(next: T -> () = doNothing, error: E -> () = doNothing, completed: () -> () = doNothing, cancelled: () -> () = doNothing) -> Disposable? {
		return observe(Event.sink(next: next, error: error, completed: completed, cancelled: cancelled))
	}
}

