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 #ifndef MODULE_CORE_THREAD_FLAGS
58 #error Missing USEMODULE += core_thread_flags
59 #endif
60 
61 #include "kernel_types.h"
62 #include "sched.h" /* for thread_t typedef */
63 
64 #ifdef __cplusplus
65  extern "C" {
66 #endif
67 
99 #define THREAD_FLAG_MSG_WAITING (0x1<<15)
100 
105 #define THREAD_FLAG_TIMEOUT (0x1<<14)
106 
111 typedef uint16_t thread_flags_t;
112 
120 void thread_flags_set(thread_t *thread, thread_flags_t mask);
121 
130 thread_flags_t thread_flags_clear(thread_flags_t mask);
131 
145 thread_flags_t thread_flags_wait_any(thread_flags_t mask);
146 
160 thread_flags_t thread_flags_wait_all(thread_flags_t mask);
161 
172 thread_flags_t thread_flags_wait_one(thread_flags_t mask);
173 
187 int thread_flags_wake(thread_t *thread);
188 
189 #ifdef __cplusplus
190 }
191 #endif
192 
193 #endif /* THREAD_FLAGS_H */
194 
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:178
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:111
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.