tokio::sync::Mutex 与 std::sync::Mutex
代码 use anyhow::{Ok, Result};
use std::{ptr::read, sync::Arc, time::Duration};
use tokio::sync::Mutex;
struct DB;
impl DB {// 假装在 commit 数据async fn commit (&mut self) -> Result<usize> {Ok(42)}
}
#[tokio::main]
async fn main() -> Resul…
2026/7/24 21:55:05