rf_imp: fix race when stopping gain thread

detected with TSAN using benchmark_radio test
master
Andre Puschmann 4 years ago
parent 716caafd6c
commit f823340a95

@ -175,7 +175,9 @@ int srsran_rf_close(srsran_rf_t* rf)
{
// Stop gain thread
if (rf->thread_gain_run) {
pthread_mutex_lock(&rf->mutex);
rf->thread_gain_run = false;
pthread_mutex_unlock(&rf->mutex);
pthread_cond_signal(&rf->cond);
pthread_join(rf->thread_gain, NULL);
}

@ -25,6 +25,7 @@ extern "C" {
//#undef I // Fix complex.h #define I nastiness when using C++
#endif
#include "srsran/common/tsan_options.h"
#include "srsran/phy/utils/debug.h"
#include "srsran/radio/radio.h"

Loading…
Cancel
Save