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

Initialize static variables atomically #18

Merged
merged 1 commit into from Mar 10, 2013
Merged

Initialize static variables atomically #18

merged 1 commit into from Mar 10, 2013

Conversation

jlnr
Copy link
Contributor

@jlnr jlnr commented Jan 7, 2013

Hello Jake,

Thanks for the useful library. I've noticed that some global variables are not initialized atomically. I haven't run into any problems but I think it would be safer to initialize them using dispatch_once, to prevent potential race conditions between the very first two calls to setImageURL.... If you place breakpoints in both places and remove the call to removeAllImages from the demo program, you can see that they are indeed being called from different threads.

jakemarsh added a commit that referenced this pull request Mar 10, 2013
Initialize static variables atomically
@jakemarsh jakemarsh merged commit 36c6c69 into jakemarsh:master Mar 10, 2013
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

Successfully merging this pull request may close these issues.

None yet

2 participants