Skip to content

Commit

Permalink
core/thread: Add constant value to check custom flags against
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Feb 26, 2022
1 parent 4bbe0ec commit faba8e1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions core/include/thread_flags.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 (THREAD_FLAG_MSG_WAITING | THREAD_FLAG_TIMEOUT)
/** @} */

/**
Expand Down

0 comments on commit faba8e1

Please sign in to comment.