1
0
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:
Marian Buschsieweke 2020-08-05 10:51:16 +02:00
parent dbc128570d
commit 315cdcdb5f
No known key found for this signature in database
GPG Key ID: 61F64C6599B1539F
2 changed files with 7 additions and 9 deletions

View File

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

View File

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