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

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -