You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is saveContext() intended to be called from any thread? The docs say "This function is performed in a block on the context's queue" implying that I can call it from any thread. However, the first line (context.hasChanges) is not thread safe. I discovered this because I have com.apple.CoreData.ConcurrencyDebug enabled.
I know that I can wrap saveContext() inside a performBlock call to avoid this.
The text was updated successfully, but these errors were encountered:
Actually, if you enable com.apple.CoreData.ConcurrencyDebug in the example project, any save of a background context will trigger a concurrency crash, even though the initial call to saveContext() is wrapped in a performBlockAndWait.
saveContext() needs to delay checking hasChanges until inside performBlock.
Is saveContext() intended to be called from any thread? The docs say "This function is performed in a block on the context's queue" implying that I can call it from any thread. However, the first line (context.hasChanges) is not thread safe. I discovered this because I have com.apple.CoreData.ConcurrencyDebug enabled.
I know that I can wrap saveContext() inside a performBlock call to avoid this.
The text was updated successfully, but these errors were encountered: