std::sync — blocking synchronization. tokio::sync — async synchronization.
std::sync:
tokio::sync:
1// std::sync2use std::sync::Mutex;3let m = Mutex::new(5);4let val = m.lock().unwrap();56// tokio::sync7use tokio::sync::Mutex;8let m = Mutex::new(5);9let val = m.lock().await;
Key: std for blocking, tokio for async.