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 
54 #ifndef THREAD_FLAGS_H
55 #define THREAD_FLAGS_H
56 
57 #include "kernel_types.h"
58 #include "sched.h" /* for thread_t typedef */
59 
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 
95 #define THREAD_FLAG_MSG_WAITING (1u << 15)
96 
101 #define THREAD_FLAG_TIMEOUT (1u << 14)
102 
107 typedef uint16_t thread_flags_t;
108 
116 void thread_flags_set(thread_t *thread, thread_flags_t mask);
117 
126 thread_flags_t thread_flags_clear(thread_flags_t mask);
127 
141 thread_flags_t thread_flags_wait_any(thread_flags_t mask);
142 
156 thread_flags_t thread_flags_wait_all(thread_flags_t mask);
157 
168 thread_flags_t thread_flags_wait_one(thread_flags_t mask);
169 
183 int thread_flags_wake(thread_t *thread);
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 #endif /* THREAD_FLAGS_H */
190 
Types used by the kernel.
thread_flags_t thread_flags_clear(thread_flags_t mask)
Clear current thread&#39;s flags.
thread_flags_t thread_flags_wait_all(thread_flags_t mask)
Wait for all flags in mask to become set (blocking)
thread_flags_t thread_flags_wait_any(thread_flags_t mask)
Wait for any flag in mask to become set (blocking)
thread_t holds thread&#39;s context data.
Definition: thread.h:154
void thread_flags_set(thread_t *thread, thread_flags_t mask)
Set thread flags, possibly waking it up.
uint16_t thread_flags_t
Type definition of thread_flags_t.
Definition: thread_flags.h:107
int thread_flags_wake(thread_t *thread)
Possibly Wake up thread waiting for flags.
Scheduler API definition.
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.