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

feat(runtime): improve queue management APIs #153

Merged
merged 2 commits into from
Aug 9, 2023

Conversation

finger563
Copy link
Owner

Description

  • Update wait/sleep event factory APIs to return immediately if the queue already has events in it
  • Update event factory clear_events API to copy then empty the queue under lock, then free the memory associated with the pointers in the copy outside of lock to prevent multiple locks/unlocks while clearing the queue which could result in race conditions.

Motivation and Context

How has this been tested?

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Update wait/sleep event factory APIs to return immediately if the queue already has events in it
* Update event factory clear_events API to copy then empty the queue under lock, then free the memory associated with the pointers in the copy outside of lock to prevent multiple locks/unlocks while clearing the queue which could result in race conditions.
@finger563 finger563 merged commit 7e272b2 into master Aug 9, 2023
@finger563 finger563 deleted the feature/hfsm-runtime-improve-blocking-behavior branch August 9, 2023 14:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant