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
This commit is contained in:
Martine Lenders 2019-05-11 12:25:07 +02:00
parent 6a78746471
commit db20a057ae
4 changed files with 6 additions and 6 deletions

View File

@ -114,7 +114,7 @@ typedef enum {
STATUS_RUNNING, /**< currently running */ STATUS_RUNNING, /**< currently running */
STATUS_PENDING, /**< waiting to be scheduled to run */ STATUS_PENDING, /**< waiting to be scheduled to run */
STATUS_NUMOF /**< number of supported thread states */ 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: #define STATUS_ON_RUNQUEUE STATUS_RUNNING /**< to check if on run queue:
`st >= STATUS_ON_RUNQUEUE` */ `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 * @def SCHED_PRIO_LEVELS
@ -146,7 +146,7 @@ int sched_run(void);
* targeted process * targeted process
* @param[in] status The new status of this thread * @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. * @brief Yield if approriate.

View File

@ -143,7 +143,7 @@ typedef void *(*thread_task_func_t)(void *arg);
*/ */
struct _thread { struct _thread {
char *sp; /**< thread's stack pointer */ 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 */ uint8_t priority; /**< thread's priority */
kernel_pid_t pid; /**< thread's process id */ kernel_pid_t pid; /**< thread's process id */

View File

@ -158,7 +158,7 @@ void sched_register_cb(void (*callback)(uint32_t, uint32_t))
} }
#endif #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 (status >= STATUS_ON_RUNQUEUE) {
if (!(process->status >= STATUS_ON_RUNQUEUE)) { if (!(process->status >= STATUS_ON_RUNQUEUE)) {

View File

@ -96,7 +96,7 @@ void ps(void)
thread_t *p = (thread_t *)sched_threads[i]; thread_t *p = (thread_t *)sched_threads[i];
if (p != NULL) { 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 *sname = state_names[state]; /* get state name */
const char *queued = &queued_name[(int)(state >= STATUS_ON_RUNQUEUE)]; /* get queued flag */ const char *queued = &queued_name[(int)(state >= STATUS_ON_RUNQUEUE)]; /* get queued flag */
#ifdef DEVELHELP #ifdef DEVELHELP