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
+1 -1
View File
@@ -74,7 +74,7 @@
int clearenv(void)
{
FAR struct tcb_s *tcb = (FAR struct tcb_s *)g_readytorun.head;
FAR struct tcb_s *tcb = this_task();
DEBUGASSERT(tcb->group);
env_release(tcb->group);
+1 -1
View File
@@ -81,7 +81,7 @@
int env_dup(FAR struct task_group_s *group)
{
FAR struct tcb_s *ptcb = (FAR struct tcb_s *)g_readytorun.head;
FAR struct tcb_s *ptcb = this_task();
FAR char *envp = NULL;
size_t envlen;
int ret = OK;
+1 -1
View File
@@ -94,7 +94,7 @@ FAR char *getenv(const char *name)
/* Get a reference to the thread-private environ in the TCB. */
sched_lock();
rtcb = (FAR struct tcb_s *)g_readytorun.head;
rtcb = this_task();
group = rtcb->group;
/* Check if the variable exists */
+1 -1
View File
@@ -85,7 +85,7 @@ FAR char **get_environ_ptr(void)
/* Return a reference to the thread-private environ in the TCB. */
FAR struct tcb_s *ptcb = (FAR struct tcb_s *)g_readytorun.head;
FAR struct tcb_s *ptcb = this_task();
if (ptcb->envp)
{
return &ptcb->envp->ev_env;
+1 -1
View File
@@ -124,7 +124,7 @@ int setenv(FAR const char *name, FAR const char *value, int overwrite)
/* Get a reference to the thread-private environ in the TCB. */
sched_lock();
rtcb = (FAR struct tcb_s *)g_readytorun.head;
rtcb = this_task();
group = rtcb->group;
DEBUGASSERT(group);
+1 -1
View File
@@ -77,7 +77,7 @@
int unsetenv(FAR const char *name)
{
FAR struct tcb_s *rtcb = (FAR struct tcb_s *)g_readytorun.head;
FAR struct tcb_s *rtcb = this_task();
FAR struct task_group_s *group = rtcb->group;
FAR char *pvar;
FAR char *newenvp;