Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
greathongtu committed Apr 8, 2024
1 parent a562c56 commit ca3b284
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions content/posts/rust-concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,12 @@ impl AtomicI32 {
}


// std::sync::Once and std::sync::OnceLock

// std::sync::Once and std::sync::OnceLock
// A cell which can be written to only once
pub struct OnceCell<T> { /* private fields */ }
// thread-safe OnceCell, can be used in statics.
// 用get_or_init获取值
pub struct OnceLock<T>

// Fetch-and-Modify Operations
// could overflow compared to CAS
Expand Down

0 comments on commit ca3b284

Please sign in to comment.