Utils: Use atomic in VolumeMeter manager

This commit is contained in:
tt2468 2021-12-28 22:50:11 -08:00
parent e1cb858d2d
commit bb2c125601
2 changed files with 1 additions and 3 deletions

View File

@ -278,9 +278,7 @@ Utils::Obs::VolumeMeter::Handler::~Handler()
signal_handler_disconnect(sh, "source_deactivate", Handler::InputDeactivateCallback, this);
if (_running) {
_mutex.lock();
_running = false;
_mutex.unlock();
_cond.notify_all();
}

View File

@ -87,7 +87,7 @@ namespace Utils {
std::mutex _mutex;
std::condition_variable _cond;
bool _running;
std::atomic<bool> _running;
std::thread _updateThread;
void UpdateThread();