소스 검색

spin: add doc for `Spin`

greatbridf 10 달 전
부모
커밋
25266c1a21
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      crates/eonix_sync/src/spin.rs

+ 3 - 0
crates/eonix_sync/src/spin.rs

@@ -11,6 +11,9 @@ use core::{
 pub use guard::{SpinGuard, SpinIrqGuard};
 pub use relax::{LoopRelax, Relax, SpinRelax};
 
+//// A spinlock is a lock that uses busy-waiting to acquire the lock.
+/// It is useful for short critical sections where the overhead of a context switch
+/// is too high.
 #[derive(Debug, Default)]
 pub struct Spin<T, R = SpinRelax>
 where