X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=shared%2Fmidi_device.h;h=ec6bf9b5a160b5ededf14600744435a96ef0e951;hb=0a981d13d1c4dd006ac3a6a2e45691d095990ccc;hp=a9f33d65c6516d835d909f3fa2407fa200b115c6;hpb=f1a8ab7eb34a89a104093c3931b1d51fcb2684e6;p=nageru diff --git a/shared/midi_device.h b/shared/midi_device.h index a9f33d6..ec6bf9b 100644 --- a/shared/midi_device.h +++ b/shared/midi_device.h @@ -47,7 +47,7 @@ public: void update_lights(const std::map &active_lights) { - std::lock_guard lock(mu); + std::lock_guard lock(mu); update_lights_lock_held(active_lights); } @@ -60,7 +60,7 @@ private: std::atomic should_quit{false}; int should_quit_fd; - mutable std::mutex mu; + mutable std::recursive_mutex mu; // Recursive because the MIDI receiver may update_lights() back while we are sending it stuff. MIDIReceiver *receiver; // Under . std::thread midi_thread;