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

sys/event: add event_sync() #20916

Merged
merged 1 commit into from
Oct 21, 2024
Merged

Conversation

derMihai
Copy link
Contributor

Contribution description

In some cases it's useful to ensure forward progress in the event queue before continuing. This PR adds event_sync(), which blocks until the last event on the queue at the moment of calling this (if any) will have been processed, e.g.

event_post(queue, my_event);
// When event_sync() returns, my_event will have been processed.
event_sync();

Testing procedure

The unit test was updated accordingly.

@github-actions github-actions bot added Area: tests Area: tests and testing framework Area: sys Area: System labels Oct 17, 2024
@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 Oct 17, 2024
@derMihai derMihai force-pushed the mir/event_sync_mainline branch from 48aabd2 to bd5f09c Compare October 17, 2024 13:26
@benpicco benpicco requested a review from fabian18 October 17, 2024 13:47
sys/event/event.c Outdated Show resolved Hide resolved
@riot-ci
Copy link

riot-ci commented Oct 17, 2024

Murdock results

✔️ PASSED

9996909 sys/event: add event_sync()

Success Failures Total Runtime
10212 0 10214 18m:02s

Artifacts

@derMihai derMihai force-pushed the mir/event_sync_mainline branch 2 times, most recently from 8222b89 to a2e282a Compare October 18, 2024 08:56
sys/event/event.c Outdated Show resolved Hide resolved
@derMihai derMihai force-pushed the mir/event_sync_mainline branch from a2e282a to 9996909 Compare October 18, 2024 11:14
@kaspar030
Copy link
Contributor

kaspar030 commented Oct 18, 2024

Simple but useful. I like. 👍

@benpicco benpicco added this pull request to the merge queue Oct 21, 2024
Merged via the queue into RIOT-OS:master with commit c48247f Oct 21, 2024
27 checks passed
@benpicco benpicco added this to the Release 2024.10 milestone Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: sys Area: System Area: tests Area: tests and testing framework 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.

5 participants