threads: fix race in stopping periodic thread

master
Andre Puschmann 4 years ago
parent 312b5a241c
commit 1ef3cb7e5d

@ -35,6 +35,7 @@ void threads_print_self();
#ifdef __cplusplus
}
#include <atomic>
#include <string>
namespace srsran {
@ -129,10 +130,10 @@ protected:
virtual void run_period() = 0;
private:
int wakeups_missed;
int timer_fd;
int period_us;
bool run_enable;
int wakeups_missed = 0;
int timer_fd = 0;
int period_us = 0;
std::atomic<bool> run_enable = {false};
void run_thread()
{

Loading…
Cancel
Save