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
Even and Odd numbers by Erick Benites
bookinheritence
geomatric operations in objective c
HAL is IBM
Etudiant.h
arary
main.m
NSMutableset(add/remove,Etraction,Intersect)
Author1
string compare