99x / 99x/timercpp

`clear` is not thread-safe wrt memory visibility

Open
#6 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
266
Forks
74
PR merge metrics
No merged PRs in 30d

Description

```cpp
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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at Timer::stop and the plain clear flag shown in the issue, then trace where the interval timer reads it. No file or test is named, so inspect the repository for the timer implementation and existing concurrency coverage. Done means the stop signal is reliably visible across threads and the interval timer cannot continue indefinitely after stopping.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.