As far as I know, identical NSStrings are optimized in such a way that they are actually one and the same object in most(all?) circumstances.
If yes, does that mean that I can use an NSString pointer as a semaphore for the @synchronized directive and have it block whenever the code block is being executed with an identical string as semaphore?
- (void)doSomethingWithAString:(NSString *)myString
{
@synchronized(myString) {
//Something time intensive that never happens in parallel for the exact same myString
}
}