mirror of https://github.com/PentHertz/srsLTE.git
threads: fix race in stopping periodic thread
This commit is contained in:
parent
312b5a241c
commit
1ef3cb7e5d
|
@ -35,6 +35,7 @@ void threads_print_self();
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <atomic>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace srsran {
|
namespace srsran {
|
||||||
|
@ -129,10 +130,10 @@ protected:
|
||||||
virtual void run_period() = 0;
|
virtual void run_period() = 0;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int wakeups_missed;
|
int wakeups_missed = 0;
|
||||||
int timer_fd;
|
int timer_fd = 0;
|
||||||
int period_us;
|
int period_us = 0;
|
||||||
bool run_enable;
|
std::atomic<bool> run_enable = {false};
|
||||||
|
|
||||||
void run_thread()
|
void run_thread()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue