Mutex
Requirement ID: F002-1
User Story
As a developer, I want that a single resource can only access from one task at a time, so that I can share resources between tasks without data hazards.
Acceptance Criteria
- Any resource can be protected by a mutex
- Common Rust Syntax is used (N005-1):
- Type:
Mutex<Resource>
- Create:
let data = Mutex::new(42u32);
- Access resource:
let value = data.lock();
- Modify value:
*value += 12;
- Unlock automatically
- Type:
- Only one task can access a shared resource at a time
Edited by Stefan Lüthi