From 01301f31a3e88e3597f11999a8228e0407f2c04b Mon Sep 17 00:00:00 2001 From: Brian De Wolf Date: Sun, 8 Nov 2015 21:29:29 -0800 Subject: [PATCH] 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. --- src/mpd.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mpd.cc b/src/mpd.cc index 4962ec89..fecebf7b 100644 --- a/src/mpd.cc +++ b/src/mpd.cc @@ -298,6 +298,7 @@ if (b) a=b; else a=""; conn = 0; } */ } while (0); + std::lock_guard lock(Base::result_mutex); result = mpd_info; // don't forget to save results! }