thread_flags.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
57 #ifndef THREAD_FLAGS_H
58 #define THREAD_FLAGS_H
59 
60 #include "sched.h" /* for thread_t typedef */
61 
62 #ifdef __cplusplus
63 extern "C" {
64 #endif
65 
97 #define THREAD_FLAG_MSG_WAITING (1u << 15)
103 #define THREAD_FLAG_TIMEOUT (1u << 14)
104 
116 #define THREAD_FLAG_PREDEFINED_MASK (THREAD_FLAG_MSG_WAITING | THREAD_FLAG_TIMEOUT)
122 typedef uint16_t thread_flags_t;
123 
132 
142 
157 
172 
184 
199 
200 #ifdef __cplusplus
201 }
202 #endif
203 
204 #endif /* THREAD_FLAGS_H */
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)
int thread_flags_wake(thread_t *thread)
Possibly Wake up thread waiting for flags.
uint16_t thread_flags_t
Type definition of thread_flags_t.
Definition: thread_flags.h:122
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:168