mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
core/thread: Make thread_get inlineable
This commit is contained in:
parent
dbc128570d
commit
315cdcdb5f
@ -356,7 +356,13 @@ kernel_pid_t thread_create(char *stack,
|
||||
* @param[in] pid Thread to retrieve.
|
||||
* @return `NULL` if the PID is invalid or there is no such thread.
|
||||
*/
|
||||
volatile thread_t *thread_get(kernel_pid_t pid);
|
||||
static inline volatile thread_t *thread_get(kernel_pid_t pid)
|
||||
{
|
||||
if (pid_is_valid(pid)) {
|
||||
return sched_threads[pid];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns the status of a process
|
||||
|
@ -30,14 +30,6 @@
|
||||
#include "bitarithm.h"
|
||||
#include "sched.h"
|
||||
|
||||
volatile thread_t *thread_get(kernel_pid_t pid)
|
||||
{
|
||||
if (pid_is_valid(pid)) {
|
||||
return sched_threads[pid];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
thread_status_t thread_getstatus(kernel_pid_t pid)
|
||||
{
|
||||
volatile thread_t *thread = thread_get(pid);
|
||||
|
Loading…
Reference in New Issue
Block a user