Skip to content

About

Rust Mutex based on the RP2040 hardware spinlock

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

rp-spinlockmutex

version license

A mutex implementation based on the rp2040 hardware spinlock.

Example

Fully working code can be found in examples/.

use rp_spinlockmutex::SpinlockMutex;
static MUTEX: SpinlockMutex<7, i32> = SpinlockMutex::new(0);

run_on_core1(|| {
    for _ in 0..10 {
        *MUTEX.lock() += 1;
    }
});

for _ in 0..10 {
    *MUTEX.lock() += 1;
}

assert_eq!(*mutex.lock(), 20);

License

Licensed under either of:

at your option.

About

Rust Mutex based on the RP2040 hardware spinlock

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Contributors

Languages