From db20a057ae48e1e30cfabfdfcbc5dd7c79837087 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Sat, 11 May 2019 12:25:07 +0200 Subject: [PATCH] core: rename thread_state_t to thread_status_t This way it can't come to name collisions on `native` with Mac OSX' threading library [1]. [1]: https://opensource.apple.com/source/xnu/xnu-792/osfmk/mach/thread_status.h.auto.html --- core/include/sched.h | 6 +++--- core/include/thread.h | 2 +- core/sched.c | 2 +- sys/ps/ps.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/core/include/sched.h b/core/include/sched.h index f9d37a2803..906f3c46bd 100644 --- a/core/include/sched.h +++ b/core/include/sched.h @@ -114,7 +114,7 @@ typedef enum { STATUS_RUNNING, /**< currently running */ STATUS_PENDING, /**< waiting to be scheduled to run */ STATUS_NUMOF /**< number of supported thread states */ -} thread_state_t; +} thread_status_t; /** @} */ /** @@ -123,7 +123,7 @@ typedef enum { */ #define STATUS_ON_RUNQUEUE STATUS_RUNNING /**< to check if on run queue: `st >= STATUS_ON_RUNQUEUE` */ -#define STATUS_NOT_FOUND ((thread_state_t)-1) /**< Describes an illegal thread status */ +#define STATUS_NOT_FOUND ((thread_status_t)-1) /**< Describes an illegal thread status */ /** @} */ /** * @def SCHED_PRIO_LEVELS @@ -146,7 +146,7 @@ int sched_run(void); * targeted process * @param[in] status The new status of this thread */ -void sched_set_status(thread_t *process, thread_state_t status); +void sched_set_status(thread_t *process, thread_status_t status); /** * @brief Yield if approriate. diff --git a/core/include/thread.h b/core/include/thread.h index 69521e070b..b2a2ce2e5c 100644 --- a/core/include/thread.h +++ b/core/include/thread.h @@ -143,7 +143,7 @@ typedef void *(*thread_task_func_t)(void *arg); */ struct _thread { char *sp; /**< thread's stack pointer */ - thread_state_t status; /**< thread's status */ + thread_status_t status; /**< thread's status */ uint8_t priority; /**< thread's priority */ kernel_pid_t pid; /**< thread's process id */ diff --git a/core/sched.c b/core/sched.c index 3d69cde424..65553c9833 100644 --- a/core/sched.c +++ b/core/sched.c @@ -158,7 +158,7 @@ void sched_register_cb(void (*callback)(uint32_t, uint32_t)) } #endif -void sched_set_status(thread_t *process, thread_state_t status) +void sched_set_status(thread_t *process, thread_status_t status) { if (status >= STATUS_ON_RUNQUEUE) { if (!(process->status >= STATUS_ON_RUNQUEUE)) { diff --git a/sys/ps/ps.c b/sys/ps/ps.c index 0fd47be49c..0542637188 100644 --- a/sys/ps/ps.c +++ b/sys/ps/ps.c @@ -96,7 +96,7 @@ void ps(void) thread_t *p = (thread_t *)sched_threads[i]; if (p != NULL) { - thread_state_t state = p->status; /* copy state */ + thread_status_t state = p->status; /* copy state */ const char *sname = state_names[state]; /* get state name */ const char *queued = &queued_name[(int)(state >= STATUS_ON_RUNQUEUE)]; /* get queued flag */ #ifdef DEVELHELP