     
     private var value: Result<T>?
     private var callbacks: [Result<T> -> Void] = []
-    private let lock = Lock()
+    private let mutex = Mutex()
     
     /// Automatically infer the type of the signal from the argument.
     public convenience init(_ value: T){

}


private class Lock {
    private var mutex = pthread_mutex_t()

    init() {

        pthread_mutex_destroy(&mutex)
    }

    func lock() -> Int32 {
        return pthread_mutex_lock(&mutex)
    }

    func unlock() -> Int32 {
        return pthread_mutex_unlock(&mutex)
    }

    func lock(@noescape closure: () -> Void) {
        let status = lock()
        assert(status == 0, "pthread_mutex_lock: \(strerror(status))")
        defer { unlock() }
        closure()
    }
}
