macro_rules! rumtk_lock_write {
( $lock:expr ) => { ... };
}Expand description
Framework interface to obtain a write guard to the locked data.
To access the internal data, you will need to dereference the guard (*guard).
It is preferred to use rumtk_critical_section_write if you need to avoid time of check time of use security bugs.
ยงExample
use rumtk_core::{rumtk_new_lock, rumtk_lock_read, rumtk_lock_write};
let data = 5;
let lock = rumtk_new_lock!(data.clone());
let new_data = 10;
*rumtk_lock_write!(lock) = new_data;
let result = *rumtk_lock_read!(lock);
assert_eq!(result, new_data, "Failed to modify locked data.");