Skip to content

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

  1. Any resource can be protected by a mutex
  2. 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
  3. Only one task can access a shared resource at a time
Edited by Stefan Lüthi