home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.os.development      Operating system development chatter      4,255 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,846 of 4,255   
   Branimir Maksimovic to All   
   Harmony OS source released   
   11 Oct 21 11:11:32   
   
   From: branimir.maksimovic@icloud.com   
      
   https://github.com/Awesome-HarmonyOS/HarmonyOS   
      
   interresting piece :   
      
   /*****************************************************************************   
    Function : LOS_TaskResume   
    Description : Resume suspend task   
    Input       : uwTaskID --- Task ID   
    Output      : None   
    Return      : LOS_OK on success or error code on failure   
    *****************************************************************************/   
   LITE_OS_SEC_TEXT_INIT UINT32 LOS_TaskResume(UINT32 uwTaskID)   
   {   
       UINTPTR uvIntSave;   
       LOS_TASK_CB *pstTaskCB;   
       UINT16 usTempStatus;   
       UINT32 uwErrRet = OS_ERROR;   
      
       if (uwTaskID > LOSCFG_BASE_CORE_TSK_LIMIT)   
       {   
           return LOS_ERRNO_TSK_ID_INVALID;   
       }   
      
       pstTaskCB = OS_TCB_FROM_TID(uwTaskID);   
       uvIntSave = LOS_IntLock();   
       usTempStatus = pstTaskCB->usTaskStatus;   
      
       if (OS_TASK_STATUS_UNUSED & usTempStatus)   
       {   
           uwErrRet = LOS_ERRNO_TSK_NOT_CREATED;   
           OS_GOTO_ERREND();   
       }   
       else if (!(OS_TASK_STATUS_SUSPEND & usTempStatus))   
       {   
           uwErrRet = LOS_ERRNO_TSK_NOT_SUSPENDED;   
           OS_GOTO_ERREND();   
       }   
      
       pstTaskCB->usTaskStatus &= (~OS_TASK_STATUS_SUSPEND);   
       if (!(OS_CHECK_TASK_BLOCK & pstTaskCB->usTaskStatus) )   
       {   
           pstTaskCB->usTaskStatus |= OS_TASK_STATUS_READY;   
           LOS_PriqueueEnqueue(&pstTaskCB->stPendList, pstTaskCB->usPriority);   
           if (g_bTaskScheduled)   
           {   
               (VOID)LOS_IntRestore(uvIntSave);   
               LOS_Schedule();   
               return LOS_OK;   
           }   
           g_stLosTask.pstNewTask = LOS_DL_LIST_ENTRY(LOS_PriqueueTop(),   
   LOS_TASK_CB, stPendList); /*lint !e413*/   
       }   
      
       (VOID)LOS_IntRestore(uvIntSave);   
       return LOS_OK;   
      
   LOS_ERREND:   
       (VOID)LOS_IntRestore(uvIntSave);   
       return uwErrRet;   
   }   
      
      
      
   --   
      
   7-77-777   
   Evil Sinner!   
   with software, you repeat same experiment, expecting different results...   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca