Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
acquire-lock
//gcc 5.0.4 #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) { NSString * filename = @"/tmp/hello3.lock"; NSDistributedLock *myLock = [[NSDistributedLock alloc] initWithPath:filename]; BOOL success = [myLock tryLock]; NSLog(success ? @"Got Lock" : @"Didn't get Lock"); [myLock unlock]; success = [myLock tryLock]; NSLog(success ? @"Got Lock" : @"Didn't get Lock"); return 0; }
run
|
edit
|
history
|
help
0
Class implementation
basic arithmatic Opreation in objective C
floating in objective c
Goldbach Conjecture
abc
find simple Interest in objective c
NSSet Program in objectice-c
Sum Example
Class implementation using get method
inheritenace-test