From 078d6fa15bc34551a79b5ad74d2a50af80a5fdb7 Mon Sep 17 00:00:00 2001
From: Robert Schmidt <robert.schmidt@openairinterface.org>
Date: Wed, 19 Jan 2022 14:42:01 +0100
Subject: [PATCH] threadCreate(): don't create detached threads

A detached thread cannot be joined with pthread_join(). However, this
is crucial for correct resetting of the nr-softmodem. Therefore, do not
create threads in detached state.
---
 common/utils/system.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/common/utils/system.c b/common/utils/system.c
index 00839b485ca..f13fd842892 100644
--- a/common/utils/system.c
+++ b/common/utils/system.c
@@ -231,8 +231,6 @@ void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name,
   int settingPriority = 1;
   ret=pthread_attr_init(&attr);
   AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
-  ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-  AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
   
   if (checkIfFedoraDistribution())
     if (checkIfGenericKernelOnFedora())
-- 
GitLab