Is this the correct method to prevent more than one thread to access the function MyTaskF?
.h file:
@interface MyInterface : NSObject {
//... some other stuff here
}
.m file:
static NSLock *mytaskMutex;
static MyInterface *MyInterfaceSingleton;
int MyTaskF(int iVar)
{
[mytaskMutex lock];
//do stuff in here
[mytaskMutex unlock];
return 0;
}