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

Thread-safe #3

Open
johnkil opened this issue Jan 9, 2017 · 0 comments
Open

Thread-safe #3

johnkil opened this issue Jan 9, 2017 · 0 comments

Comments

@johnkil
Copy link
Contributor

johnkil commented Jan 9, 2017

The code is not thread-safe. There are two threads accessing the snowflake objects at the same time, the main thread in onDraw() and a background thread. This can cause the snowflakes to be drawn at incorrect positions.

You should really do everything on the main thread if possible, if not then you need to copy the array before passing it to the background thread then post it back to the main thread when the work is done so they don't interfere with each other.

[source]

@johnkil johnkil mentioned this issue Feb 4, 2017
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