1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-15 17:47:09 +00:00

lock mpd result before modifying it

Add a lock to the mpd work callback to prevent another thread from reading the
struct while we're writing to it.
This commit is contained in:
Brian De Wolf 2015-11-08 21:29:29 -08:00
parent 7ae6b00f30
commit 01301f31a3

View File

@ -298,6 +298,7 @@ if (b) a=b; else a="";
conn = 0;
} */
} while (0);
std::lock_guard<std::mutex> lock(Base::result_mutex);
result = mpd_info; // don't forget to save results!
}