Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
public final class SpinLock {
private var lock: OSSpinLock = OS_SPINLOCK_INIT
public func locked<A>(@noescape f: () throws -> A) rethrows -> A {
defer { OSSpinLockUnlock(&lock) }
return try f()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.