From 51e17cba646f833c1af8b1945248de43e0fdd50f Mon Sep 17 00:00:00 2001 From: Balaji Shankaran Date: Thu, 17 Sep 2020 17:38:11 +0530 Subject: [PATCH] Added failure check in system task creation Change-Id: I73b3fb699542985553422a27b1911453001f5113 Signed-off-by: Balaji Shankaran --- container-tag.yaml | 2 +- src/du_app/du_mgr_main.c | 24 ++++++++++++++++++++---- src/mt/mt_ss.c | 19 +++++++------------ 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/container-tag.yaml b/container-tag.yaml index 40441f0d9..e8214d22b 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -1,4 +1,4 @@ # The Jenkins job requires a tag to build the Docker image. # Global-JJB script assumes this file is in the repo root. --- -tag: 2.0.1 +tag: 2.0.2 diff --git a/src/du_app/du_mgr_main.c b/src/du_app/du_mgr_main.c index f4791d29e..e09464d9e 100644 --- a/src/du_app/du_mgr_main.c +++ b/src/du_app/du_mgr_main.c @@ -254,18 +254,34 @@ uint8_t commonInit() ODU_SET_PROC_ID(DU_PROC); /* system task for DU APP */ - SCreateSTsk(PRIOR0, &du_app_stsk); + if(SCreateSTsk(PRIOR0, &du_app_stsk) != ROK) + { + DU_LOG("\nDU_APP : System Task creation for DU APP failed"); + return RFAILED; + } /* system task for RLC_DL and MAC */ - SCreateSTsk(PRIOR0, &rlc_mac_cl_stsk); + if(SCreateSTsk(PRIOR0, &rlc_mac_cl_stsk) != ROK) + { + DU_LOG("\nDU_APP : System Task creation for RLC DL/MAC failed"); + return RFAILED; + } pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); /* system task for RLC UL */ - SCreateSTsk(PRIOR1, &rlc_ul_stsk); + if(SCreateSTsk(PRIOR1, &rlc_ul_stsk) != ROK) + { + DU_LOG("\nDU_APP : System Task creation for RLC UL failed"); + return RFAILED; + } /* system task for SCTP receiver thread */ - SCreateSTsk(PRIOR0, &sctp_stsk); + if(SCreateSTsk(PRIOR0, &sctp_stsk) != ROK) + { + DU_LOG("\nDU_APP : System Task creation for SCTP failed"); + return RFAILED; + } /* Create TAPA tasks */ if(duAppInit(du_app_stsk) != ROK) diff --git a/src/mt/mt_ss.c b/src/mt/mt_ss.c index ea4ec29e1..4a950eb2b 100644 --- a/src/mt/mt_ss.c +++ b/src/mt/mt_ss.c @@ -36,9 +36,6 @@ #define _POSIX_C_SOURCE 199309L #endif /* mt003.301 moved env files to use the __USE_UNIX98 flag in sys includes */ -#include "envopt.h" /* environment options */ -#include "envdep.h" /* environment dependent */ -#include "envind.h" /* environment independent */ #include #include @@ -62,11 +59,7 @@ /* header include files (.h) */ -#include "gen.h" /* general layer */ -#include "ssi.h" /* system services */ - -#include "cm5.h" /* common timers */ - +#include "common_def.h" #include "mt_ss.h" /* MTSS specific */ #include "mt_err.h" /* MTSS error defines */ @@ -78,7 +71,6 @@ /* mt003.301 Additions - Task deregistration */ #include "ss_err.h" /* error */ #include "cm_mem.h" /* common memory manager */ -#include "cm_lte.h" /* common lte param */ /* mt001.301 : Additions */ #ifdef SS_THREAD_PROFILE #include "ss_err.h" @@ -3623,6 +3615,7 @@ PUBLIC S16 ssdCreateSTsk(sTsk) SsSTskEntry *sTsk; /* pointer to system task entry */ #endif { + S16 ret; pthread_attr_t attr; /* struct sched_param param_sched;*/ @@ -3680,9 +3673,10 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ while(threadCreated == FALSE) { #endif - if ((pthread_create(&sTsk->dep.tId, &attr, mtTskHdlrT2kL2, (Ptr)sTsk)) != 0) + ret = pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk); + if (ret != 0) { - + DU_LOG("\nDU APP : Failed to create thread. Cause[%d]",ret); pthread_attr_destroy(&attr); #if (ERRCLASS & ERRCLS_DEBUG) @@ -3710,7 +3704,8 @@ SsSTskEntry *sTsk; /* pointer to system task entry */ while(threadCreated == FALSE) { #endif - if ((pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk)) != 0) + ret = pthread_create(&sTsk->dep.tId, &attr, mtTskHdlr, (Ptr)sTsk); + if (ret != 0) { /* mt020.201 - Addition for destroying thread attribute object attr */ -- 2.16.6