objective c - NSManagedObjectContext performBlockAndWait causing deadlock when called from two threads -


i have osx app i'm using parent/child nsmanagedobjectcontext setup. child moc has nsprivatequeueconcurrencytype , 1 i'm using. parent set nsmainqueueconcurrencytype

when call performblockandwait on child context background thread @ same time called main thread deadlock – semaphore_wait_trap. pausing debugger shows both threads stuck @ performblockandwait

how can around this? thought method designed situation , queue blocks on context's private queue return appropriately?

i worked around creating serial queue , doing performblock calls through make sure wouldn't mess each-other up. honestly, i'm not sure if practice did solve problem particular situation.


Comments

Popular posts from this blog

c++ - Function signature as a function template parameter -

algorithm - What are some ways to combine a number of (potentially incompatible) sorted sub-sets of a total set into a (partial) ordering of the total set? -

How to call a javascript function after the page loads with a chrome extension? -