Skip to content

Better Mutex #52

@Rahix

Description

@Rahix

We're currently relying on the mutex type from bare-metal which is actually being removed upstream so now is a good time to think about adding a similar mechanism here and maybe improving it. For starters, I'd want the mutex to actually hand out &mut _ references because 99% of use-cases need this.

It would be interesting to explore the concept of a critical-section handle a bit more:

  • Maybe ISRs should optionally get a cs-handle as an argument as nothing could interrupt them?
  • Even further, maybe main should get a cs-handle in the beginning? Interrupts are disabled so it would be sound. Then, later an interrupt::enable() function should consume the handle when enabling interrupts for the first time. Is there a problem I'm missing?

Metadata

Metadata

Assignees

No one assigned

    Labels

    runtimeRelated to startup/interrupts/runtime

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions