In Java if I have the keyword synchronized in a method, it will prevent being executed by more than one thread at same time, no matter what thread is:
public synchronized void doSomething() {
//synchronous code here
}
In objective-c if do this, will I have the same result?
-(void)doSomething{
@synchronized (self) {
//synchonous code here
}
}