-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move event thread flag #20868
base: master
Are you sure you want to change the base?
Move event thread flag #20868
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also see my comment in the linked issue: #20867 (comment)
* | ||
* This flag is used by the `event` module. | ||
*/ | ||
#define THREAD_FLAG_EVENT (1u << 13) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the value from 0x1
to 1 << 13
might break applications that relied on the fact that the latter was unused before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that, but figured that it boiled down to too cases; applications that rely on the flag 1 << 13
being free, and applications that rely on THREAD_FLAG_EVENT
being equal to 0x1
.
In the first case, applications should rely in the macro THREAD_FLAG_PREDEFINED_MASK
to tell them if a flag is free and should be prepared to deal with once free flags becoming no longer free in later versions of RIOT.
In the second case, applications should use THREAD_FLAG_EVENT
rather than the value of 0x1
directly, and should not be affected.
One artifact of changing the value is that thread_flags_wait_one()
does state that the flags are serviced in a specific order according to their value. However, again the thread flag's value was re-definable. This means that no part of RIOT itself should have ever relied on this ordering. I suppose you could make an argument that an application could have relied on this, but seems unlikely.
I am fine with it being set to either value. What's you preference?
I'm gonna mark this one as a draft for now according to our discussion in #20867 |
Contribution description
Move event flag to common area and mark its value as in-use by the OS.
Testing procedure
make -C tests/unittests/ test
runs without errorIssues/PRs references
See issue #20867