Skip to main content

rumtk_lock_read

Macro rumtk_lock_read 

Source
macro_rules! rumtk_lock_read {
    ( $lock:expr ) => { ... };
}
Expand description

Framework interface to obtain a read 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_read if you need to avoid time of check time of use security bugs.

ยงExample

use rumtk_core::{rumtk_new_lock, rumtk_lock_read};

let data = 5;
let lock = rumtk_new_lock!(data.clone());
let result = *rumtk_lock_read!(lock);

assert_eq!(result, data, "Failed to access locked data.");