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 
9 #pragma once
10 
59 #include "sched.h" /* for thread_t typedef */
60 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
96 #define THREAD_FLAG_MSG_WAITING (1u << 15)
102 #define THREAD_FLAG_TIMEOUT (1u << 14)
103 
115 #define THREAD_FLAG_PREDEFINED_MASK (THREAD_FLAG_MSG_WAITING | THREAD_FLAG_TIMEOUT)
121 typedef uint16_t thread_flags_t;
122 
131 
141 
156 
171 
183 
198 
199 #ifdef __cplusplus
200 }
201 #endif
202 
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:121
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