Skip to content

Thread-safe #3

@johnkil

Description

@johnkil

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions