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
Post a Comment