changed to atomic and called mutex lock

This commit is contained in:
Jared Bruni
2021-10-19 23:16:10 -07:00
parent c1a3cd70ff
commit 9aebbf85fa
2 changed files with 3 additions and 1 deletions

View File

@@ -152,8 +152,10 @@ void Playback::setVector(std::vector<FilterValue> v) {
} }
void Playback::setFilterMapEx(std::unordered_map<std::string, FilterValue> f) { void Playback::setFilterMapEx(std::unordered_map<std::string, FilterValue> f) {
mutex.lock();
filter_map_ex_set = f; filter_map_ex_set = f;
setFilterMap = true; setFilterMap = true;
mutex.unlock();
} }
unsigned long Playback::calcMem() { unsigned long Playback::calcMem() {

View File

@@ -57,7 +57,7 @@ private:
std::atomic<int> fps_delay; std::atomic<int> fps_delay;
std::vector<std::string> draw_strings; std::vector<std::string> draw_strings;
std::unordered_map<std::string, FilterValue> filter_map_ex; std::unordered_map<std::string, FilterValue> filter_map_ex;
bool setFilterMap = false; std::atmoic<bool> setFilterMap;
std::unordered_map<std::string, FilterValue> filter_map_ex_set; std::unordered_map<std::string, FilterValue> filter_map_ex_set;
public: public:
Playback(QObject *parent = 0); Playback(QObject *parent = 0);