Simple @syncronized for Swift.
Lock
has sync
method. (both instance method and class method)
let lock = Lock()
lock.sync {
// some code
}
let result = lock.sync {
return "result"
}
Lock.sync(self) {
// some code
}
let result = Lock.sync(self) {
return 1
}
Synco is released under the MIT license. See LICENSE for details.