Skip to content

clear is not thread-safe wrt memory visibility #6

Description

@jayv
void Timer::stop() {
    this->clear = true;
}

clear as plain bool has no cross-thread synchronization so in theory the interval timer may run indefinitly, consider using atomic_bool and proper memory ordering.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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