Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

Enoch247
Copy link
Contributor

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 error

Issues/PRs references

See issue #20867

@Enoch247 Enoch247 requested a review from kaspar030 as a code owner September 20, 2024 01:36
@github-actions github-actions bot added Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: sys Area: System labels Sep 20, 2024
@Enoch247 Enoch247 changed the title Mv event thread flag Move event thread flag Sep 20, 2024
Copy link
Contributor

@mguetschow mguetschow left a 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)
Copy link
Contributor

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.

Copy link
Contributor Author

@Enoch247 Enoch247 Sep 26, 2024

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?

@Teufelchen1 Teufelchen1 added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 24, 2024
@riot-ci
Copy link

riot-ci commented Sep 24, 2024

Murdock results

✔️ PASSED

d958512 sys/event: add event thread flag to THREAD_FLAG_PREDEFINED_MASK

Success Failures Total Runtime
10196 0 10197 17m:51s

Artifacts

@mguetschow
Copy link
Contributor

I'm gonna mark this one as a draft for now according to our discussion in #20867

@mguetschow mguetschow marked this pull request as draft October 29, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: core Area: RIOT kernel. Handle PRs marked with this with care! Area: sys Area: System CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants