mirror of
https://github.com/apache/nuttx.git
synced 2025-12-13 06:14:40 +08:00
sched/: Replace explict references to g_readytorun with indirect references via the this_task() macro
This commit is contained in:
@@ -48,30 +48,6 @@
|
||||
#endif
|
||||
#include "task/task.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Type Declarations
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Variables
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -106,7 +82,7 @@
|
||||
|
||||
int task_exit(void)
|
||||
{
|
||||
FAR struct tcb_s *dtcb = (FAR struct tcb_s *)g_readytorun.head;
|
||||
FAR struct tcb_s *dtcb = this_task();
|
||||
FAR struct tcb_s *rtcb;
|
||||
int ret;
|
||||
|
||||
@@ -119,7 +95,7 @@ int task_exit(void)
|
||||
*/
|
||||
|
||||
(void)sched_removereadytorun(dtcb);
|
||||
rtcb = (FAR struct tcb_s *)g_readytorun.head;
|
||||
rtcb = this_task();
|
||||
|
||||
/* We are now in a bad state -- the head of the ready to run task list
|
||||
* does not correspond to the thread that is running. Disabling pre-
|
||||
|
||||
Reference in New Issue
Block a user