Added failure check in system task creation 13/4713/2
authorBalaji Shankaran <balaji.shankaran@radisys.com>
Thu, 17 Sep 2020 12:08:11 +0000 (17:38 +0530)
committerBalaji Shankaran <balaji.shankaran@radisys.com>
Thu, 17 Sep 2020 12:26:18 +0000 (17:56 +0530)
Change-Id: I73b3fb699542985553422a27b1911453001f5113
Signed-off-by: Balaji Shankaran <balaji.shankaran@radisys.com>
container-tag.yaml
src/du_app/du_mgr_main.c
src/mt/mt_ss.c

index 40441f0..e8214d2 100644 (file)
@@ -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
index f4791d2..e09464d 100644 (file)
@@ -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)
index ea4ec29..4a950eb 100644 (file)
@@ -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 <fcntl.h>
 #include <pthread.h>
 /* 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 */