From b923fec95270f9138525803882bfb0b65752b55b Mon Sep 17 00:00:00 2001 From: chrysn Date: Wed, 5 Jan 2022 19:40:49 +0100 Subject: [PATCH] core/thread: Add constant value to check custom flags against Co-authored-by: benpicco --- core/include/thread_flags.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/core/include/thread_flags.h b/core/include/thread_flags.h index e5c378b28f..846fcb64e4 100644 --- a/core/include/thread_flags.h +++ b/core/include/thread_flags.h @@ -101,6 +101,19 @@ extern "C" { * @see xtimer_set_timeout_flag */ #define THREAD_FLAG_TIMEOUT (1u << 14) + +/** + * @brief Comprehensive set of all predefined flags + * + * This bit mask is set for all thread flag bits that are predefined in RIOT. + * Flags within this set may be set on a thread by the operating system without + * the thread soliciting them (though not all are; for example, @ref + * THREAD_FLAG_TIMEOUT is not). + * + * When using custom flags, asserting that they are not in this set can help + * avoid conflict with future additions to the predefined flags. + */ +#define THREAD_FLAG_PREDEFINED_MASK (THREAD_FLAG_MSG_WAITING | THREAD_FLAG_TIMEOUT) /** @} */ /**