sched/: Replace explict references to g_readytorun with indirect references via the this_task() macro

This commit is contained in:
Gregory Nutt
2016-02-06 17:44:41 -06:00
parent 12f95c6f6b
commit 74db48202e
79 changed files with 114 additions and 606 deletions

View File

@@ -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-