Skip to main content

tg_sync/
lib.rs

1//! 同步互斥模块
2//!
3//! 教程阅读建议:
4//!
5//! - `up.rs`:先理解“单核下通过关中断保护临界区”;
6//! - `mutex/semaphore/condvar`:再看经典同步原语如何基于等待队列实现。
7
8#![no_std]
9#![deny(warnings, missing_docs)]
10
11mod condvar;
12mod mutex;
13mod semaphore;
14mod up;
15
16extern crate alloc;
17
18pub use condvar::Condvar;
19pub use mutex::{Mutex, MutexBlocking};
20pub use semaphore::Semaphore;
21pub use up::{UPIntrFreeCell, UPIntrRefMut};