 
 protocol ReadWriteLock {
     mutating func read<T>(block: () -> T) -> T
-    mutating func read<T>(block: () throws -> T) rethrows -> T
     mutating func write(block: () -> Void, completion: (() -> Void)?)
 }
 

        var object: T!
        dispatch_sync(queue) {
            object = block()
        }
        return object
    }

    mutating func read<T>(block: () throws -> T) rethrows -> T {
        var object: T!
        try dispatch_sync(queue) {
            object = try block()
        }
        return object
    }

        return lock.read { [unowned self] in block(self.ward) }
    }

    func write(block: (inout T) -> Void) {
        lock.write({ block(&self.ward) })
    }
