/// Guards the execution of the provided closure with a recursive static mutex.
Guards the execution of the provided closure with a recursive static mutex.
Guards the execution of the provided closure with a recursive static mutex .
pub fn sync<T, F>(func: F) -> T
where
    F: FnOnce() -> T,
{
    lazy_static! {
        static ref LOCK: ReentrantMutex<()> = ReentrantMutex::new(());
    }
    let _guard = LOCK.lock();
    func()
}
pub fn sync < T , F > ( func : F ) -> T where F : FnOnce ( ) -> T , { lazy_static ! { static ref LOCK ReentrantMutex ( ) ReentrantMutex new ( ( ) ) } let _guard = LOCK . lock ( ) ; func ( ) }
Guards the execution of the provided closure with a recursive static mutex.
Guards the execution of the provided closure with a recursive static mutex .
func
F