1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

core/thread: add thread_is_active()

This commit is contained in:
Kaspar Schleiser 2020-11-25 14:46:43 +01:00
parent 848a5a4e7a
commit ceea0ba949

View File

@ -598,6 +598,16 @@ static inline thread_status_t thread_get_status(const thread_t *thread) {
return thread->status;
}
/**
* Returns if a thread is active (currently running or waiting to be scheduled)
*
* @param thread thread to work on
* @returns true if thread is active, false otherwise
*/
static inline bool thread_is_active(const thread_t *thread) {
return thread->status >= STATUS_ON_RUNQUEUE;
}
/**
* Convert a thread state code to a human readable string.
*