Browse Source

Start threads in detached state instead of calling detach

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.4.1
falkTX 3 years ago
parent
commit
491617994f
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      source/utils/CarlaThread.hpp

+ 3
- 2
source/utils/CarlaThread.hpp View File

@@ -1,6 +1,6 @@
/* /*
* Carla Thread * Carla Thread
* Copyright (C) 2013-2019 Filipe Coelho <falktx@falktx.com>
* Copyright (C) 2013-2021 Filipe Coelho <falktx@falktx.com>
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
@@ -124,6 +124,8 @@ public:
} }
} }


pthread_attr_setdetachstate(&attr, 1);

const CarlaMutexLocker cml(fLock); const CarlaMutexLocker cml(fLock);


fShouldExit = false; fShouldExit = false;
@@ -145,7 +147,6 @@ public:
#else #else
CARLA_SAFE_ASSERT_RETURN(handle != 0, false); CARLA_SAFE_ASSERT_RETURN(handle != 0, false);
#endif #endif
pthread_detach(handle);
_copyFrom(handle); _copyFrom(handle);


// wait for thread to start // wait for thread to start


Loading…
Cancel
Save