ios - How to lock/unlock cross thread -
for code snippets, want execute 1 one, like:
self.coredatalock = [[nsrecursivelock alloc] init]; // snippet 1 [self.coredatalock lock]; [childcontext performblock:^{ // [self.coredatalock unlock]; }]; // snippet 2 [self.coredatalock lock]; dispatch_group_notify(group, dispatch_get_main_queue(), ^{ // [self.coredatalock unlock]; });
but can't lock/unlock nsrecursivelock cross thread, how figure out?
Comments
Post a Comment