diff options
| author | Oliver Rockstedt <[email protected]> | 2024-05-22 00:54:52 +0200 |
|---|---|---|
| committer | Oliver Rockstedt <[email protected]> | 2024-05-22 00:54:52 +0200 |
| commit | aee9d5902a4feb4a5fbb8d0e719401c96f3f651e (patch) | |
| tree | d40e4bd76bf8616b337579f36488f9a8c1c7656f /embassy-sync/src/once_lock.rs | |
| parent | 68e784ccd6e17a2fa4dc837a6eb46b2ff93504d5 (diff) | |
embassy-sync: fixed some documentation typos
Diffstat (limited to 'embassy-sync/src/once_lock.rs')
| -rw-r--r-- | embassy-sync/src/once_lock.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/embassy-sync/src/once_lock.rs b/embassy-sync/src/once_lock.rs index 9332ecfaf..55608ba32 100644 --- a/embassy-sync/src/once_lock.rs +++ b/embassy-sync/src/once_lock.rs | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | //! Syncronization primitive for initializing a value once, allowing others to await a reference to the value. | 1 | //! Synchronization primitive for initializing a value once, allowing others to await a reference to the value. |
| 2 | 2 | ||
| 3 | use core::cell::Cell; | 3 | use core::cell::Cell; |
| 4 | use core::future::poll_fn; | 4 | use core::future::poll_fn; |
| @@ -78,7 +78,7 @@ impl<T> OnceLock<T> { | |||
| 78 | /// Set the underlying value. If the value is already set, this will return an error with the given value. | 78 | /// Set the underlying value. If the value is already set, this will return an error with the given value. |
| 79 | pub fn init(&self, value: T) -> Result<(), T> { | 79 | pub fn init(&self, value: T) -> Result<(), T> { |
| 80 | // Critical section is required to ensure that the value is | 80 | // Critical section is required to ensure that the value is |
| 81 | // not simultaniously initialized elsewhere at the same time. | 81 | // not simultaneously initialized elsewhere at the same time. |
| 82 | critical_section::with(|_| { | 82 | critical_section::with(|_| { |
| 83 | // If the value is not set, set it and return Ok. | 83 | // If the value is not set, set it and return Ok. |
| 84 | if !self.init.load(Ordering::Relaxed) { | 84 | if !self.init.load(Ordering::Relaxed) { |
| @@ -99,7 +99,7 @@ impl<T> OnceLock<T> { | |||
| 99 | F: FnOnce() -> T, | 99 | F: FnOnce() -> T, |
| 100 | { | 100 | { |
| 101 | // Critical section is required to ensure that the value is | 101 | // Critical section is required to ensure that the value is |
| 102 | // not simultaniously initialized elsewhere at the same time. | 102 | // not simultaneously initialized elsewhere at the same time. |
| 103 | critical_section::with(|_| { | 103 | critical_section::with(|_| { |
| 104 | // If the value is not set, set it. | 104 | // If the value is not set, set it. |
| 105 | if !self.init.load(Ordering::Relaxed) { | 105 | if !self.init.load(Ordering::Relaxed) { |
