Browse Source

Set names of RtMidi threads.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
a6ad500f97
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      src/rtmidi.cpp

+ 6
- 1
src/rtmidi.cpp View File

@@ -74,6 +74,8 @@ struct RtMidiInputDevice : midi::InputDevice {
if (!userData)
return;

system::setThreadName("RtMidi input");

RtMidiInputDevice* midiInputDevice = (RtMidiInputDevice*) userData;
if (!midiInputDevice)
return;
@@ -170,6 +172,8 @@ struct RtMidiOutputDevice : midi::OutputDevice {
}

void runThread() {
system::setThreadName("RtMidi output");

std::unique_lock<decltype(mutex)> lock(mutex);
while (!stopped) {
if (messageQueue.empty()) {
@@ -210,7 +214,8 @@ struct RtMidiOutputDevice : midi::OutputDevice {
stopped = true;
cv.notify_one();
}
thread.join();
if (thread.joinable())
thread.join();
}
};



Loading…
Cancel
Save