@interfaceThreadSafetyArray:NSObject
{@privateNSMutableArray*_array;}-(void)addObject:(NSObject*)obj;-(void)walk:(void(^)(NSObject*))walk-in;
@end
@implementationThreadSafetyArray-(id)init{self=[superinit];if(self){_array=[[NSMutableArrayalloc]init];}returnself;}-(void)addObject:(NSObject*)obj{@synchronized(self){[_arrayaddObject:obj];}}-(void)walk:(void(^)(NSObject*))walkfun{@synchronized(self){for(NSObject*objin_array){walkfun(obj);}}}
@end