Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialization race condition #23

Open
cerupcat opened this issue Mar 25, 2016 · 1 comment
Open

Serialization race condition #23

cerupcat opened this issue Mar 25, 2016 · 1 comment

Comments

@cerupcat
Copy link

From what I can tell removeTask can be called by another task completion prior to the previous one being finished (if they finish at or near the same time) and therefore the NSUserDefaults isn't stored correctly and the task isn't removed from the NSUserDefaults - thus on subsequent launches it will try to complete a task already completed.

Am I doing something wrong or this indeed a race condition? I'm not sure what the best solution is to ensure that removeTask finishes before being called again to ensure the NSUserDefaults is removed correctly.

@cerupcat
Copy link
Author

Adding @synchronized(self) { } to the removeTask method in NSUserDefaultsSerializer seems to fit it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant