     /// A Future<T> that has already succeeded
     init(eventLoop: EventLoop, checkForPossibleDeadlock: Bool, result: T) {
         self.value = .success(result)
-        self.futureLock = ConditionLock(value: 1)
         self.eventLoop = eventLoop
         self.checkForPossibleDeadlock = checkForPossibleDeadlock
     }

    // Each instance gets a random hash value
    public lazy var hashValue = NSUUID().hashValue
    
    /// Becomes 1 when we have a value or an error
    fileprivate let futureLock: ConditionLock<Int>
    
    public var fulfilled: Bool {
        return futureLock.value == 1
    }
    
    fileprivate init(eventLoop: EventLoop, checkForPossibleDeadlock: Bool) {
        self.futureLock = ConditionLock(value: 0)
        self.eventLoop = eventLoop
        self.checkForPossibleDeadlock = checkForPossibleDeadlock
    }

        })
    }
}

extension Future {
    public func wait() throws -> T {
        if self.checkForPossibleDeadlock {
            precondition(!eventLoop.inEventLoop, "wait() must not be called when on the EventLoop")
        }
        
        var v: FutureValue <T> = .incomplete
        let lock = ConditionLock(value: 0)
        _whenComplete { () -> CallbackList in
            lock.lock()
            v = self.value
            lock.unlock(withValue: 1)
            return CallbackList()
        }
        lock.lock(whenValue: 1)
        lock.unlock()
        
        switch(v) {
        case .success(let result):
            return result
        case .failure(let error):
            throw error
        case .incomplete:
            fatalError()
        }
    }
}
