这段代码执行起来安全吗?也就是说,同时添加到 NSMutableArray 或 NSMutableDictionary 是否安全?
- (NSArray *)batchProcess:(NSArray *)inputList {
NSMutableArray *outputList = [NSMutableArray arrayWithCapacity:inputList.count];
[inputList enumerateObjectsWithOptions:NSEnumerationConcurrent
usingBlock:^(id thing, NSUInteger index, BOOL *stop){
id processedThing = [self doProcessingOn:thing];
[outputList addObject:processedThing];
}];
return outputList;
}