From 491617994f06dd93a682010a6a101b9ceec61e6e Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 18 Sep 2021 15:50:04 +0100 Subject: [PATCH] Start threads in detached state instead of calling detach Signed-off-by: falkTX --- source/utils/CarlaThread.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/utils/CarlaThread.hpp b/source/utils/CarlaThread.hpp index 8cdc0404e..cae36ad3b 100644 --- a/source/utils/CarlaThread.hpp +++ b/source/utils/CarlaThread.hpp @@ -1,6 +1,6 @@ /* * Carla Thread - * Copyright (C) 2013-2019 Filipe Coelho + * Copyright (C) 2013-2021 Filipe Coelho * * This program is free software; you can redistribute it and/or * 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); fShouldExit = false; @@ -145,7 +147,6 @@ public: #else CARLA_SAFE_ASSERT_RETURN(handle != 0, false); #endif - pthread_detach(handle); _copyFrom(handle); // wait for thread to start