         _state.dealloc(1)
     }
 
-    public func withWriteLock<T>(block: () -> T) -> T {
+    public func withWriteLock<T>(@noescape body: () -> T) -> T {
         // spin until we acquire write lock
         do {
             let state = _state.memory

        } while true

        // read lock acquired - run block
        let result = block()

        // decrement reader count
        do {

        lock.dealloc(1)
    }

    private func withLock<T>(@noescape body: () -> T) -> T {
        let result: T
        OSSpinLockLock(lock)
        result = body()
        OSSpinLockUnlock(lock)
        return result
    }

    public func withReadLock<T>(@noescape body: () -> T) -> T {
        return withLock(body)
    }

    public func withWriteLock<T>(@noescape body: () -> T) -> T {
        return withLock(body)
    }
}

