 
 */
 import Foundation
+#if os(Linux)
+    import Glibc
+#else
+    import Darwin
+#endif
 
 public final class Signal<T> {
     
     private var value: Result<T>?
     private var callbacks: [Result<T> -> Void] = []
+    private let lock = Lock()
     
     /// Automatically infer the type of the signal from the argument.
     public convenience init(_ value: T){

    }
    
    public init() {
        
    }
    
    /**

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