Browse Source

Set RtAudio thread name. Limit thread on Linux to 15 characters.

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
bf21e1574c
2 changed files with 3 additions and 1 deletions
  1. +2
    -0
      src/rtaudio.cpp
  2. +1
    -1
      src/system.cpp

+ 2
- 0
src/rtaudio.cpp View File

@@ -191,6 +191,8 @@ struct RtAudioDevice : audio::Device {
RtAudioDevice* device = (RtAudioDevice*) userData;
assert(device);

system::setThreadName("RtAudio");

int inputStride = device->getNumInputs();
int outputStride = device->getNumOutputs();
device->processBuffer((const float*) inputBuffer, inputStride, (float*) outputBuffer, outputStride, nFrames);


+ 1
- 1
src/system.cpp View File

@@ -560,7 +560,7 @@ int getLogicalCoreCount() {

void setThreadName(const std::string& name) {
#if defined ARCH_LIN
pthread_setname_np(pthread_self(), name.c_str());
pthread_setname_np(pthread_self(), name.substr(0, 15).c_str());
#elif defined ARCH_MAC
// Not supported (yet) on Mac
#elif defined ARCH_WIN


Loading…
Cancel
Save