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

Rework locks #2197

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

Rework locks #2197

wants to merge 9 commits into from

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Sep 19, 2024

  • Move locks to a new module
  • Deduplicate implementation
  • Reimplement critical_section in terms of Lock
  • Make Lock reentrant by default

This change should prevent multi-core apps spinning in interrupt-free context if the other core is holding the global lock.

It's hardly a stress test, but I've ran the multicore examples on an ESP32 and they worked as expected.

@bugadani bugadani added the skip-changelog No changelog modification needed label Sep 19, 2024
@bugadani bugadani removed the skip-changelog No changelog modification needed label Sep 19, 2024
esp-hal/src/lock.rs Outdated Show resolved Hide resolved
@bugadani
Copy link
Contributor Author

Fun fact: this PR came 2 days before #797 turned one year old :D

@bugadani bugadani marked this pull request as ready for review September 19, 2024 13:37
@MabezDev
Copy link
Member

Fun fact: this PR came 2 days before #797 turned one year old :D

I expect you to mark this occasion in your calendar for next year too :D

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.

3 participants