Crates.io | critical-section-lock-mut |
lib.rs | critical-section-lock-mut |
version | 0.1.2 |
source | src |
created_at | 2024-10-26 21:48:02.640475 |
updated_at | 2024-10-26 21:48:02.640475 |
description | Provide locks for mutable data using `critical-section` crate. |
homepage | |
repository | https://github.com/pdx-cs-rust-embedded/critical-section-lock-mut |
max_upload_size | |
id | 1424176 |
size | 8,791 |
Copyright © Bart Massey 2024 (Version 0.1.2)
Lock data with mutable access on a single-core
processor. The locking is provided by a
critical-section::Mutex
.
use critical_section_lock_mut::LockMut;
static SHARED: LockMut<u8> = LockMut::new();
fn main() {
SHARED.init(3);
SHARED.with_lock(|u| *u += 1);
This work is licensed under the "MIT License". Please
see the file LICENSE
in the source distribution of this
software for license terms.
Thanks to the cargo-readme
crate for generation of this README
.
This work is licensed under the "MIT License". Please see the file
LICENSE.txt
in this distribution for license terms.