Skip to content

event/timeout: event_timeout_set() enqueues immediately if timeout is zero#20870

Merged
benpicco merged 1 commit intoRIOT-OS:masterfrom
derMihai:mir/event_timeout_zero
Sep 25, 2024
Merged

event/timeout: event_timeout_set() enqueues immediately if timeout is zero#20870
benpicco merged 1 commit intoRIOT-OS:masterfrom
derMihai:mir/event_timeout_zero

Conversation

@derMihai
Copy link
Copy Markdown
Contributor

Contribution description

Currently, the following can result in event_B being executed before event_A:

event_timeout_set(event_A, 0);
event_post(event_queue, event_B);

I think this is unexpected behavior. Queuing an event with timeout zero should schedule the event for immediate execution. I therefore added a check in event_timeout_set() to immediately queue if the timeout is zero.

Testing procedure

I briefly tested this on native in the application I'm currently working on.

@derMihai derMihai requested a review from kaspar030 as a code owner September 25, 2024 08:09
@github-actions github-actions bot added the Area: sys Area: System label Sep 25, 2024
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Sep 25, 2024
@riot-ci
Copy link
Copy Markdown

riot-ci commented Sep 25, 2024

Murdock results

✔️ PASSED

b7eee2c event/timeout: event_timeout_set() enqueues immediately if timeout is zero

Success Failures Total Runtime
10197 0 10197 18m:12s

Artifacts

@benpicco benpicco added this pull request to the merge queue Sep 25, 2024
Merged via the queue into RIOT-OS:master with commit 7f959f8 Sep 25, 2024
@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 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.

3 participants