Skip to content

Rust Mutex based on the RP2040 hardware spinlock

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

Sematre/rp-spinlockmutex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Languages