Skip to content

clear is not thread-safe wrt memory visibility #6

@jayv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions