This is how I implement mine. Sometihng just doesn't fill right
-(void)setCurrentAnchor:(CLLocation *)currentAnchor
{
//CM(@"set current anchor");
/*@synchronized (self)
{
}*/
if (_currentAnchor==currentAnchor)
{
return;
}
//[Tools DoSomethingWithSynchronize:^{
@synchronized(self){
_currentAnchor=currentAnchor;
[Timer searchCriteriaChanged];
[cachedProperties setDistanceForAllBiz];
}
//}];
}
-(CLLocation *)currentAnchor
{
//[Tools DoSomethingWithSynchronize:^{
//}];
@synchronized(self){
} //Empty @synchronized section just to block every other thread
[self setCurrentLocationasAnchorifNil];
return _currentAnchor;
}
The objective is of course to ensure that currentAnchor is never accessed when it's changing. Am I doing this right?