         return value?.value
     }
 }
+
+
+private class Lock {
+    private var mutex = pthread_mutex_t()
+
+    init() {
+        pthread_mutex_init(&mutex, nil)
+    }
+
+    deinit {
+        pthread_mutex_destroy(&mutex)
+    }
+
+    func sync(@noescape closure: () -> Void) {
+        let status = pthread_mutex_lock(&mutex)
+        assert(status == 0, "pthread_mutex_lock: \(strerror(status))")
+        defer { pthread_mutex_unlock(&mutex) }
+        closure()
+    }
+}

    }
    
    public init() {
        
    }
    
    /**

        about the new value.
    */
    public func update(result: Result<T>) {
        lock.sync {
            value = result
            callbacks.forEach{$0(result)}
        }
    }
    
    /**
