Skip to content

question atomic #9

@Amathnet

Description

@Amathnet

std::atomic<bool> active{true};

Hey,
why is this initialized to true this does not make any sense to me. Like this there is no way to check if its already running.
I use it in a loop and need to check if the timer is already running.

And why is there no function to check if its already running? I use function like this.
bool Timer::state() { return active; }

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