diff --git a/common/utils/ocp_itti/intertask_interface.cpp b/common/utils/ocp_itti/intertask_interface.cpp
index e896413b688b490b29636d03c28632021c6128f1..3a1fff6e93e83d4236fd36e68ec87e9b3208238f 100644
--- a/common/utils/ocp_itti/intertask_interface.cpp
+++ b/common/utils/ocp_itti/intertask_interface.cpp
@@ -281,7 +281,7 @@ extern "C" {
 
   int itti_create_task(task_id_t task_id, void *(*start_routine)(void *), void *args_p) {
     task_list_t *t=&tasks[task_id];
-    threadCreate (&t->thread, start_routine, args_p, itti_get_task_name(task_id),-1,OAI_PRIORITY_RT);
+    threadCreate (&t->thread, start_routine, args_p, (char*)itti_get_task_name(task_id),-1,OAI_PRIORITY_RT);
     LOG_I(TMR,"Created Posix thread %s\n",  itti_get_task_name(task_id) );
     return 0;
   }
diff --git a/common/utils/system.c b/common/utils/system.c
index 90e5185a67c5b8ab108dd75f20531803d90bcee7..0a116661af0c3c1143ded374d3fc82beefa1fcc6 100644
--- a/common/utils/system.c
+++ b/common/utils/system.c
@@ -239,17 +239,27 @@ void thread_top_init(char *thread_name,
   mlockall(MCL_CURRENT | MCL_FUTURE);
 }
 
-void threadTopInit(const char* name, const int affinity, const int priority){
-struct sched_param sparam={0};
+void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority){
+  pthread_attr_t attr;
+  pthread_attr_init(&attr);
+  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+  pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
+  pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
+  struct sched_param sparam={0};
   sparam.sched_priority = priority;
-  AssertFatal(pthread_setschedparam(pthread_self(),SCHED_FIFO , &sparam) == 0,"Error setting thread priority");
-  pthread_setname_np(pthread_self(), name);
+  pthread_attr_setschedparam(&attr, &sparam);
+
+  pthread_create(t, &attr, func, param);
+
+  pthread_setname_np(*t, name);
   if (affinity != -1 ) {
     cpu_set_t cpuset;
     CPU_ZERO(&cpuset);
     CPU_SET(affinity, &cpuset);
-    AssertFatal( pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset) == 0, "Error setting processor affinity");
+    AssertFatal( pthread_setaffinity_np(*t, sizeof(cpu_set_t), &cpuset) == 0, "Error setting processor affinity");
   }
+
+  pthread_attr_destroy(&attr);
 }
 
 // Block CPU C-states deep sleep
diff --git a/common/utils/system.h b/common/utils/system.h
index b66d4031c9aa7442fb76ac117b976b09eaa2c9c0..a89a6c5b1729f0b968fbfd4baed9cfd3cce85b10 100644
--- a/common/utils/system.h
+++ b/common/utils/system.h
@@ -22,6 +22,7 @@
 #ifndef _SYSTEM_H_OAI_
 #define _SYSTEM_H_OAI_
 #include <stdint.h>
+#include <pthread.h>
 #ifdef __cplusplus
 extern "C" {
 #endif
diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index 8b4822ba56cfdd1c4a78cf5fadd60a9cfc6f71c6..c76fae828eff780157c48f056f5cbf4e7615bde7 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -38,6 +38,8 @@
 #undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
 
 #include "assertions.h"
+#include <common/utils/LOG/log.h>
+#include <common/utils/system.h>
 
 #include "PHY/types.h"
 
@@ -676,8 +678,8 @@ static void* gNB_thread_prach( void* param ) {
 }
 */
 
-extern void init_td_thread(PHY_VARS_gNB *, pthread_attr_t *);
-extern void init_te_thread(PHY_VARS_gNB *, pthread_attr_t *);
+extern void init_td_thread(PHY_VARS_gNB *);
+extern void init_te_thread(PHY_VARS_gNB *);
 
 void init_gNB_proc(int inst) {
   int i=0;
@@ -685,8 +687,6 @@ void init_gNB_proc(int inst) {
   PHY_VARS_gNB *gNB;
   gNB_L1_proc_t *proc;
   gNB_L1_rxtx_proc_t *L1_proc,*L1_proc_tx;
-  pthread_attr_t *attr0=NULL,*attr1=NULL;
-  //*attr_prach=NULL;
   LOG_I(PHY,"%s(inst:%d) RC.nb_nr_CC[inst]:%d \n",__FUNCTION__,inst,RC.nb_nr_CC[inst]);
 
   for (CC_id=0; CC_id<RC.nb_nr_CC[inst]; CC_id++) {
@@ -721,14 +721,6 @@ void init_gNB_proc(int inst) {
     pthread_mutex_init( &proc->mutex_RU_PRACH,NULL);
     pthread_cond_init( &proc->cond_prach, NULL);
     pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
-    pthread_attr_init( &proc->attr_prach);
-    pthread_attr_init( &proc->attr_asynch_rxtx);
-    //    pthread_attr_init( &proc->attr_td);
-    //    pthread_attr_init( &proc->attr_te);
-    pthread_attr_init( &L1_proc->attr);
-    pthread_attr_init( &L1_proc_tx->attr);
-    attr0       = &L1_proc->attr;
-    attr1       = &L1_proc_tx->attr;
     LOG_I(PHY,"gNB->single_thread_flag:%d\n", gNB->single_thread_flag);
 
     if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) {
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index 547f4a7d51f0e734848e9961f4b372e97315ae5e..f76cada501dd31e36e2203146ad682317a964bc7 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -604,7 +604,6 @@ static void *emulatedRF_thread(void *param) {
   struct timespec req = {0};
   req.tv_sec = 0;
   req.tv_nsec = (numerology>0)? ((microsec * 1000L)/numerology):(microsec * 1000L)*2;
-  threadTopInit("emulatedRF",-1,OAI_PRIORITY_RT_LOW);
   wait_sync("emulatedRF_thread");
 
   while(!oai_exit) {
@@ -1592,17 +1591,12 @@ extern void ru_fep_full_2thread(RU_t *ru);
 extern void nr_feptx_ofdm(RU_t *ru);
 extern void nr_feptx_ofdm_2thread(RU_t *ru);
 extern void feptx_prec(RU_t *ru);
-extern void init_fep_thread(RU_t *ru,pthread_attr_t *attr);
-extern void init_nr_feptx_thread(RU_t *ru,pthread_attr_t *attr);
+extern void init_fep_thread(RU_t *ru);
+extern void init_nr_feptx_thread(RU_t *ru);
 
 void init_RU_proc(RU_t *ru) {
   int i=0;
   RU_proc_t *proc;
-  pthread_attr_t *attr_FH=NULL, *attr_FH1=NULL,*attr_prach=NULL,*attr_asynch=NULL, *attr_emulateRF=NULL;// *attr_synch=NULL;
-  //pthread_attr_t *attr_fep=NULL;
-#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
-  //pthread_attr_t *attr_prach_br=NULL;
-#endif
   char name[100];
 #ifndef OCP_FRAMEWORK
   LOG_I(PHY,"Initializing RU proc %d (%s,%s),\n",ru->idx,NB_functions[ru->function],NB_timing[ru->if_timing]);
@@ -1639,21 +1633,6 @@ void init_RU_proc(RU_t *ru) {
   pthread_cond_init( &proc->cond_asynch_rxtx, NULL);
   pthread_cond_init( &proc->cond_synch,NULL);
   pthread_cond_init( &proc->cond_gNBs, NULL);
-  pthread_attr_init( &proc->attr_FH);
-  pthread_attr_init( &proc->attr_FH1);
-  pthread_attr_init( &proc->attr_emulateRF);
-  pthread_attr_init( &proc->attr_prach);
-  pthread_attr_init( &proc->attr_synch);
-  pthread_attr_init( &proc->attr_asynch_rxtx);
-  pthread_attr_init( &proc->attr_fep);
-#ifndef DEADLINE_SCHEDULER
-  attr_FH        = &proc->attr_FH;
-  attr_FH1       = &proc->attr_FH1;
-  attr_emulateRF = &proc->attr_emulateRF;
-  attr_prach     = &proc->attr_prach;
-  //attr_synch     = &proc->attr_synch;
-  attr_asynch    = &proc->attr_asynch_rxtx;
-#endif
   threadCreate( &proc->pthread_FH, ru_thread, (void *)ru, "thread_FH", -1, OAI_PRIORITY_RT );
 
   if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)
@@ -1679,9 +1658,9 @@ void init_RU_proc(RU_t *ru) {
   }
 
   if (get_nprocs()>=2) {
-    if (ru->feprx) init_fep_thread(ru,NULL);
+    if (ru->feprx) init_fep_thread(ru);
 
-    if (ru->feptx_ofdm) nr_init_feptx_thread(ru,NULL);
+    if (ru->feptx_ofdm) nr_init_feptx_thread(ru);
   }
 
   if (opp_enabled == 1) threadCreate(&ru->ru_stats_thread,ru_stats_thread,(void *)ru, "emulateRF", -1, OAI_PRIORITY_RT_LOW);
@@ -1769,11 +1748,6 @@ void kill_RU_proc(int inst) {
   pthread_cond_destroy(&proc->cond_asynch_rxtx);
   pthread_cond_destroy(&proc->cond_synch);
   pthread_cond_destroy(&proc->cond_gNBs);
-  pthread_attr_destroy(&proc->attr_FH);
-  pthread_attr_destroy(&proc->attr_prach);
-  pthread_attr_destroy(&proc->attr_synch);
-  pthread_attr_destroy(&proc->attr_asynch_rxtx);
-  pthread_attr_destroy(&proc->attr_fep);
 }
 
 int check_capabilities(RU_t *ru,RRU_capabilities_t *cap) {
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index c724940fb270dfb005919f5e02e564b520c260bc..00620febd71bf261352bcedb6521568c03b52769 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -394,7 +394,6 @@ void reset_stats(FL_OBJECT *button, long arg) {
 }
 
 static void *scope_thread(void *arg) {
-  threadTopInit("scope",-1,OAI_PRIORITY_RT_LOW);
   int UE_id, CC_id;
   int ue_cnt=0;
 # ifdef ENABLE_XFORMS_WRITE_STATS
@@ -1065,10 +1064,7 @@ int main( int argc, char **argv ) {
       } // CC_id
     } // UE_id
 
-    ret = threadCreate(&forms_thread, scope_thread, NULL, "scope", -1, OAI_PRIORITY_RT_LOW);
-
-    if (ret == 0)
-      pthread_setname_np( forms_thread, "xforms" );
+    threadCreate(&forms_thread, scope_thread, NULL, "scope", -1, OAI_PRIORITY_RT_LOW);
 
     printf("Scope thread created, ret=%d\n",ret);
   }
diff --git a/executables/nr-softmodem.h b/executables/nr-softmodem.h
index 49e079ae13f0f6ec325f4db1638d23116b7e8caf..5dfb3e9b83f01e94679683365d2cef02a663963a 100644
--- a/executables/nr-softmodem.h
+++ b/executables/nr-softmodem.h
@@ -240,7 +240,7 @@ extern void set_function_spec_param(RU_t *ru);
 extern void reset_opp_meas(void);
 extern void print_opp_meas(void);
 
-extern void init_fep_thread(PHY_VARS_gNB *, pthread_attr_t *);
+extern void init_fep_thread(PHY_VARS_gNB *);
 
 void init_gNB_afterRU(void);
 
diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index 21b1edd6172956f6d59fb53f6005befce5e8cca4..6629d5155a8eb48d2af422e0d9319090386d752b 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -538,7 +538,6 @@ int computeSamplesShift(PHY_VARS_NR_UE *UE) {
 
 void *UE_thread(void *arg) {
   //this thread should be over the processing thread to keep in real time
-  threadTopInit("UE_IQ",1,OAI_PRIORITY_RT_MAX);
   PHY_VARS_NR_UE *UE = (PHY_VARS_NR_UE *) arg;
   //  int tx_enabled = 0;
   openair0_timestamp timestamp;
@@ -741,11 +740,6 @@ void init_UE(int nb_inst) {
   int inst;
   NR_UE_MAC_INST_t *mac_inst;
   pthread_t threads[nb_inst];
-  pthread_attr_t attr;
-  pthread_attr_init(&attr);
-  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-  pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
-  pthread_attr_setschedpolicy(&attr, SCHED_FIFO);
 
   for (inst=0; inst < nb_inst; inst++) {
     PHY_VARS_NR_UE *UE = PHY_vars_UE_g[inst][0];
diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h
index 76769ed4db3866767b88eae7226f99eb94ec3fbb..73e75bb99274172ce3dbc13d4c3039ea6ddf416c 100644
--- a/openair1/PHY/defs_RU.h
+++ b/openair1/PHY/defs_RU.h
@@ -191,25 +191,6 @@ typedef struct RU_proc_t_s {
   int first_rx;
   /// flag to indicate first TX transmission
   int first_tx;
-  /// pthread attributes for RU FH processing thread
-  pthread_attr_t attr_FH;
-  pthread_attr_t attr_FH1;
-  /// pthread attributes for RU prach
-  pthread_attr_t attr_prach;
-#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
-  /// pthread attributes for RU prach BL/CE UEs
-  pthread_attr_t attr_prach_br;
-#endif
-  /// pthread attributes for RU synch thread
-  pthread_attr_t attr_synch;
-  /// pthread attributes for asynchronous RX thread
-  pthread_attr_t attr_asynch_rxtx;
-  /// pthread attributes for worker fep thread
-  pthread_attr_t attr_fep;
-  /// pthread attributes for worker feptx thread
-  pthread_attr_t attr_feptx;
-  /// pthread attributes for emulated RF
-  pthread_attr_t attr_emulateRF;
   /// scheduling parameters for RU FH thread
   struct sched_param sched_param_FH;
   struct sched_param sched_param_FH1;
diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index 24be9688dc08039c2df802b1e234b5568288dd29..8a962bb839f0ac74d4214cfa4079ac7ff4d1dcf3 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -373,8 +373,6 @@ typedef struct {
   int instance_cnt;
   /// pthread structure for RXn-TXnp4 processing thread
   pthread_t pthread;
-  /// pthread attributes for RXn-TXnp4 processing thread
-  pthread_attr_t attr;
   /// condition variable for tx processing thread
   pthread_cond_t cond;
   /// mutex for RXn-TXnp4 processing thread
@@ -430,12 +428,6 @@ typedef struct gNB_L1_proc_t_s {
   int first_rx;
   /// flag to indicate first TX transmission
   int first_tx;
-  /// pthread attributes for single gNB processing thread
-  pthread_attr_t attr_single;
-  /// pthread attributes for prach processing thread
-  pthread_attr_t attr_prach;
-  /// pthread attributes for asynchronous RX thread
-  pthread_attr_t attr_asynch_rxtx;
   /// scheduling parameters for parallel turbo-decoder thread
   struct sched_param sched_param_td;
   /// scheduling parameters for parallel turbo-encoder thread
diff --git a/openair1/PHY/thread_NR_UE.h b/openair1/PHY/thread_NR_UE.h
index cba7a5ae41729f04859cb8fc197d64a05c15c6e2..c5db3e14d76089bc0391c38c3457670010fb83bf 100644
--- a/openair1/PHY/thread_NR_UE.h
+++ b/openair1/PHY/thread_NR_UE.h
@@ -32,8 +32,6 @@ typedef struct {
   //pthread_t pthread_slot0_dl_processing;
   pthread_t pthread_slot1_dl_processing;
   /// pthread attributes for fep_slot1 processing thread
-  // pthread_attr_t attr_slot0_dl_processing;
-  pthread_attr_t attr_slot1_dl_processing;
   /// condition variable for UE fep_slot1 thread;
   //pthread_cond_t cond_slot0_dl_processing;
   pthread_cond_t cond_slot1_dl_processing;
@@ -46,8 +44,6 @@ typedef struct {
   //pthread_t pthread_slot0_dl_processing;
   pthread_t pthread_dlsch_td;
   /// pthread attributes for fep_slot1 processing thread
-  // pthread_attr_t attr_slot0_dl_processing;
-  pthread_attr_t attr_dlsch_td;
   /// condition variable for UE fep_slot1 thread;
   //pthread_cond_t cond_slot0_dl_processing;
   pthread_cond_t cond_dlsch_td;
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index 276006ec3be58e40a413856efc288d7d9d2f3a43..9409e650a86ff4ad2ba5f67a3579ab508bf935a2 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -38,6 +38,7 @@
 #include "nfapi_interface.h"
 #include "fapi_l1.h"
 #include "common/utils/LOG/log.h"
+#include <common/utils/system.h>
 #include "common/utils/LOG/vcd_signal_dumper.h"
 
 #include "assertions.h"
@@ -1473,11 +1474,7 @@ void init_td_thread(PHY_VARS_eNB *eNB) {
   proc->tdp.eNB = eNB;
   proc->instance_cnt_td         = -1;
   
-  pthread_attr_init( &proc->attr_td);  
-  pthread_mutex_init( &proc->mutex_td, NULL);
-  pthread_cond_init( &proc->cond_td, NULL);
-  
-  pthread_create(&proc->pthread_td, &proc->attr_td, td_thread, (void*)&proc->tdp);
+  threadCreate(&proc->pthread_td, td_thread, (void*)&proc->tdp, "TD", -1, OAI_PRIORITY_RT);
 
 }
 void kill_td_thread(PHY_VARS_eNB *eNB) {
@@ -1501,12 +1498,10 @@ void init_te_thread(PHY_VARS_eNB *eNB) {
     proc->tep[i].eNB = eNB;
     proc->tep[i].instance_cnt_te         = -1;
       
-    pthread_mutex_init( &proc->tep[i].mutex_te, NULL);
-    pthread_cond_init( &proc->tep[i].cond_te, NULL);
-    pthread_attr_init( &proc->tep[i].attr_te);
-    
     LOG_I(PHY,"Creating te_thread %d\n",i);
-    pthread_create(&proc->tep[i].pthread_te, &proc->tep[i].attr_te, te_thread, (void*)&proc->tep[i]);
+    char txt[128];
+    sprintf(txt,"TE_%d", i); 
+    threadCreate(&proc->tep[i].pthread_te, te_thread, (void*)&proc->tep[i], txt, -1, OAI_PRIORITY_RT);
   }
 }
 void kill_te_thread(PHY_VARS_eNB *eNB) {
diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c
index 8a474d36442241a362838124f79ef3a2d7b40470..a0f12a7287c4498c93527acd9e370e27cfbc56c7 100644
--- a/openair1/SCHED_NR/nr_ru_procedures.c
+++ b/openair1/SCHED_NR/nr_ru_procedures.c
@@ -41,6 +41,7 @@
 #include "LAYER2/MAC/mac_extern.h"
 #include "LAYER2/MAC/mac.h"
 #include "common/utils/LOG/log.h"
+#include "common/utils/system.h"
 #include "common/utils/LOG/vcd_signal_dumper.h"
 
 #include "T.h"
@@ -196,7 +197,7 @@ static void *nr_feptx_thread(void *param) {
   return(NULL);
 }
 
-void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx) {
+void nr_init_feptx_thread(RU_t *ru) {
 
   RU_proc_t *proc = &ru->proc;
 
diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h
index a120b8c1402ff187525fb8328a045c139dbf8b50..3da78305da9ef852421c3689ee1b50bc87478d63 100644
--- a/openair1/SCHED_NR/sched_nr.h
+++ b/openair1/SCHED_NR/sched_nr.h
@@ -38,7 +38,7 @@ nr_slot_t nr_slot_select (nfapi_nr_config_request_t *cfg, unsigned char slot);
 void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp);
 void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, int do_meas);
 void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot);
-void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx);
+void nr_init_feptx_thread(RU_t *ru);
 void nr_feptx_ofdm(RU_t *ru);
 void nr_feptx_ofdm_2thread(RU_t *ru);
 void nr_feptx0(RU_t *ru,int first_symbol, int num_symbols);
diff --git a/openair2/ENB_APP/flexran_agent.c b/openair2/ENB_APP/flexran_agent.c
index 2cf72c40ee70f6c46fb44f30bab54e191c252139..225a60e2851bd952004d3be127ba7cddae73be86 100644
--- a/openair2/ENB_APP/flexran_agent.c
+++ b/openair2/ENB_APP/flexran_agent.c
@@ -102,7 +102,6 @@ void *flexran_agent_task(void *args){
 }
 
 void *receive_thread(void *args) {
-  threadTopInit("flexran",-1,OAI_PRIORITY_RT_LOW);
 
   flexran_agent_info_t  *d = args;
   void                  *data;
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
index 054bb5fac41505cee29c05fd4cec395a3b2da8db..ab00abc0cf1ffdba4a5db43894489a12837f86c4 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp.h
@@ -53,7 +53,6 @@
 
 
 extern pthread_t       pdcp_thread;
-extern pthread_attr_t  pdcp_thread_attr;
 extern pthread_mutex_t pdcp_mutex;
 extern pthread_cond_t  pdcp_cond;
 extern int             pdcp_instance_cnt;
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
index 472c46c94a46d6825eefb7d4ca1ef831a1abdf55..b77151f8a3bce4b552b860f0b82c0c0940f888a9 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_netlink.c
@@ -97,8 +97,6 @@ pdcp_netlink_init(
   int                i;
   int                nb_inst_enb;
   int                nb_inst_ue;
-  pthread_attr_t     attr;
-  struct sched_param sched_param;
 
   reset_meas(&ip_pdcp_stats_tmp);
   nb_inst_enb = 1;
@@ -141,28 +139,12 @@ pdcp_netlink_init(
   }
 
   if ((nb_inst_ue + nb_inst_enb) > 0) {
-    if (pthread_attr_init(&attr) != 0) {
-      LOG_E(PDCP, "[NETLINK]Failed to initialize pthread attribute for Netlink -> PDCP communication (%d:%s)\n",
-            errno, strerror(errno));
-      exit(EXIT_FAILURE);
-    }
-
-    sched_param.sched_priority = 10;
-
-    pthread_attr_setschedpolicy(&attr, SCHED_RR);
-    pthread_attr_setschedparam(&attr, &sched_param);
 
     /* Create one thread that fetchs packets from the netlink.
      * When the netlink fifo is full, packets are silently dropped, this behaviour
      * should be avoided if we want a reliable link.
      */
-    if (pthread_create(&pdcp_netlink_thread, &attr, pdcp_netlink_thread_fct, NULL) != 0) {
-      LOG_E(PDCP, "[NETLINK]Failed to create new thread for Netlink/PDCP communication (%d:%s)\n",
-            errno, strerror(errno));
-      exit(EXIT_FAILURE);
-    }
-
-    pthread_setname_np( pdcp_netlink_thread, "PDCP netlink" );
+    threadCreate(&pdcp_netlink_thread, pdcp_netlink_thread_fct,  "PDCP netlink", -1, OAI_PRIORITY_RT_LOW );
   }
 
   return 0;
diff --git a/openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c b/openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c
index c37d665fcca81d75187556a11b955271405f2d26..f1f6ebb7941502e5ae176ce218f72922ab600b91 100644
--- a/openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c
+++ b/openair2/LAYER2/PDCP_v10.1.0/pdcp_thread.c
@@ -45,7 +45,6 @@ extern int  oai_exit;
 extern char UE_flag;
 
 pthread_t       pdcp_thread;
-pthread_attr_t  pdcp_thread_attr;
 pthread_mutex_t pdcp_mutex;
 pthread_cond_t  pdcp_cond;
 int             pdcp_instance_cnt;
diff --git a/openair2/RRC/LTE/rrc_UE.c b/openair2/RRC/LTE/rrc_UE.c
index bef23a83a1352932bfa9c07bf44740eaac7113f9..ca4a565250f539f6aa774918cca4ad2f1d273cda 100644
--- a/openair2/RRC/LTE/rrc_UE.c
+++ b/openair2/RRC/LTE/rrc_UE.c
@@ -5477,7 +5477,6 @@ rrc_ue_process_sidelink_radioResourceConfig(
 void rrc_control_socket_init(){
 
    struct sockaddr_in rrc_ctrl_socket_addr;
-   pthread_attr_t     attr;
    int optval; // flag value for setsockopt
    //int n; // message byte size
 
@@ -5506,7 +5505,6 @@ void rrc_control_socket_init(){
       exit(1);
    }
 
-   threadTopInit("RRC Control Socket",-1,OAI_PRIORITY_RT);
    pthread_t rrc_control_socket_thread;
 
    threadCreate(&rrc_control_socket_thread, rrc_control_socket_thread_fct, NULL, "RRC/ProSeApp", -1, OAI_PRIORITY_RT);
diff --git a/openair2/UTIL/ASYNC_IF/link_manager.c b/openair2/UTIL/ASYNC_IF/link_manager.c
index c8b7d59f50410ebaea592c2c92054f052382934f..e67b7b0ec889f4d944363d98b611ba6def6c3091 100644
--- a/openair2/UTIL/ASYNC_IF/link_manager.c
+++ b/openair2/UTIL/ASYNC_IF/link_manager.c
@@ -30,6 +30,7 @@
 
 #include "link_manager.h"
 #include "common/utils/LOG/log.h"
+#include <common/utils/assertions.h>
 #include <common/utils/system.h>
 
 #include <stdio.h>
@@ -104,9 +105,7 @@ link_manager_t *create_link_manager(
 
   LOG_D(MAC, "create new link manager\n");
 
-  ret = calloc(1, sizeof(link_manager_t));
-  if (ret == NULL)
-    goto error;
+  AssertFatal( (ret=calloc(1, sizeof(link_manager_t))) != NULL,"");
 
   ret->send_queue = send_queue;
   ret->receive_queue = receive_queue;
diff --git a/openair3/NAS/COMMON/UTIL/nas_timer.c b/openair3/NAS/COMMON/UTIL/nas_timer.c
index d92c48f483c25366334ac4a654aa23890056c7e8..7ddcb61d1dc1cca7f1839ed07883b5dac1ec37d9 100644
--- a/openair3/NAS/COMMON/UTIL/nas_timer.c
+++ b/openair3/NAS/COMMON/UTIL/nas_timer.c
@@ -397,24 +397,14 @@ static void _nas_timer_handler(int signal)
   /* Get the timer entry for which the system timer expired */
   nas_timer_entry_t *te = _nas_timer_db.head->entry;
 
-  /* Execute the callback function */
-  pthread_attr_t attr;
-  pthread_attr_init(&attr);
-  pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
-  pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
-  int rc = pthread_create (&te->pid, &attr, te->cb, te->args);
-  pthread_attr_destroy(&attr);
-
-  /* Wait for the thread to terminate before releasing the timer entry */
-  if (rc == 0) {
+  threadCreate (&te->pid, te->cb, te->args, "nas-timer", -1, OAI_PRIORITY_RT_LOW);
+
     void *result = NULL;
     (void) pthread_join(te->pid, &result);
 
-    /* TODO: Check returned result ??? */
     if (result) {
       free(result);
     }
-  }
 }
 #endif
 
diff --git a/openair3/NAS/UE/UEprocess.c b/openair3/NAS/UE/UEprocess.c
index 2478eaee29ae72f549519a7f59bc49a1a1cc5503..7fe1435960ffe804372171180de6f7640f4960d4 100644
--- a/openair3/NAS/UE/UEprocess.c
+++ b/openair3/NAS/UE/UEprocess.c
@@ -150,11 +150,6 @@ int main(int argc, const char *argv[])
   (void) _nas_set_signal_handler (SIGINT, _nas_signal_handler);
   (void) _nas_set_signal_handler (SIGTERM, _nas_signal_handler);
 
-  pthread_attr_t attr;
-  pthread_attr_init (&attr);
-  pthread_attr_setscope (&attr, PTHREAD_SCOPE_SYSTEM);
-  pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
-
   /*
    * Start thread use to manage the user connection endpoint
    */
@@ -170,8 +165,6 @@ int main(int argc, const char *argv[])
   threadCreate (&network_mngr,  _nas_network_mngr,
                       &network_fd, "UE-nas-mgr", -1, OAI_PRIORITY_RT_LOW) ;
 
-  pthread_attr_destroy (&attr);
-
   /*
    * Suspend execution of the main process until all connection
    * endpoints are still active