thread_flags.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: 2015 Kaspar Schleiser <kaspar@schleiser.de>
3  * SPDX-License-Identifier: LGPL-2.1-only
4  */
5 
6 #pragma once
7 
56 #include "sched.h" /* for thread_t typedef */
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
93 #define THREAD_FLAG_MSG_WAITING (1u << 15)
99 #define THREAD_FLAG_TIMEOUT (1u << 14)
100 
112 #define THREAD_FLAG_PREDEFINED_MASK (THREAD_FLAG_MSG_WAITING | THREAD_FLAG_TIMEOUT)
118 typedef uint16_t thread_flags_t;
119 
128 
138 
153 
168 
180 
202 
203 #ifdef __cplusplus
204 }
205 #endif
206 
thread_flags_t thread_flags_clear(thread_flags_t mask)
Clear current thread's flags.
thread_flags_t thread_flags_wait_all(thread_flags_t mask)
Wait for all flags in mask to become set (blocking)
bool thread_flags_set_internal(thread_t *thread, thread_flags_t mask)
Set the flags of the given thread and update its state, but do not yield.
uint16_t thread_flags_t
Type definition of thread_flags_t.
Definition: thread_flags.h:118
thread_flags_t thread_flags_wait_any(thread_flags_t mask)
Wait for any flag in mask to become set (blocking)
void thread_flags_set(thread_t *thread, thread_flags_t mask)
Set thread flags, possibly waking it up.
thread_flags_t thread_flags_wait_one(thread_flags_t mask)
Wait for any flags in mask to become set (blocking), one at a time.
Scheduler API definition.
thread_t holds thread's context data.
Definition: thread.h:167