timercpp
timercpp copied to clipboard
`clear` is not thread-safe wrt memory visibility
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.