From 7bc1c8e87d874b99e17205c44ccfc1499f2c86e3 Mon Sep 17 00:00:00 2001 From: InventiveCoder <163831412+InventiveCoder@users.noreply.github.com> Date: Tue, 19 Mar 2024 00:52:51 +0800 Subject: [PATCH] Fix some comments (#1095) Signed-off-by: InventiveCoder --- crossbeam-channel/src/flavors/array.rs | 2 +- crossbeam-channel/src/flavors/list.rs | 2 +- crossbeam-epoch/src/guard.rs | 2 +- crossbeam-queue/src/array_queue.rs | 2 +- crossbeam-utils/src/thread.rs | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crossbeam-channel/src/flavors/array.rs b/crossbeam-channel/src/flavors/array.rs index f08bf5863..4087c054a 100644 --- a/crossbeam-channel/src/flavors/array.rs +++ b/crossbeam-channel/src/flavors/array.rs @@ -243,7 +243,7 @@ impl Channel { let slot = unsafe { self.buffer.get_unchecked(index) }; let stamp = slot.stamp.load(Ordering::Acquire); - // If the the stamp is ahead of the head by 1, we may attempt to pop. + // If the stamp is ahead of the head by 1, we may attempt to pop. if head + 1 == stamp { let new = if index + 1 < self.cap { // Same lap, incremented index. diff --git a/crossbeam-channel/src/flavors/list.rs b/crossbeam-channel/src/flavors/list.rs index 80f18273a..e7fb6150f 100644 --- a/crossbeam-channel/src/flavors/list.rs +++ b/crossbeam-channel/src/flavors/list.rs @@ -584,7 +584,7 @@ impl Channel { let mut head = self.head.index.load(Ordering::Acquire); // The channel may be uninitialized, so we have to swap to avoid overwriting any sender's attempts - // to initalize the first block before noticing that the receivers disconnected. Late allocations + // to initialize the first block before noticing that the receivers disconnected. Late allocations // will be deallocated by the sender in Drop let mut block = self.head.block.swap(ptr::null_mut(), Ordering::AcqRel); diff --git a/crossbeam-epoch/src/guard.rs b/crossbeam-epoch/src/guard.rs index 5fe33807c..3d7982fe3 100644 --- a/crossbeam-epoch/src/guard.rs +++ b/crossbeam-epoch/src/guard.rs @@ -273,7 +273,7 @@ impl Guard { /// global cache. /// /// Call this method after deferring execution of a function if you want to get it executed as - /// soon as possible. Flushing will make sure it is residing in in the global cache, so that + /// soon as possible. Flushing will make sure it is residing in the global cache, so that /// any thread has a chance of taking the function and executing it. /// /// If this method is called from an [`unprotected`] guard, it is a no-op (nothing happens). diff --git a/crossbeam-queue/src/array_queue.rs b/crossbeam-queue/src/array_queue.rs index 3f6d19533..0d2569d4d 100644 --- a/crossbeam-queue/src/array_queue.rs +++ b/crossbeam-queue/src/array_queue.rs @@ -290,7 +290,7 @@ impl ArrayQueue { let slot = unsafe { self.buffer.get_unchecked(index) }; let stamp = slot.stamp.load(Ordering::Acquire); - // If the the stamp is ahead of the head by 1, we may attempt to pop. + // If the stamp is ahead of the head by 1, we may attempt to pop. if head + 1 == stamp { let new = if index + 1 < self.cap { // Same lap, incremented index. diff --git a/crossbeam-utils/src/thread.rs b/crossbeam-utils/src/thread.rs index 9e706c695..847f4cf11 100644 --- a/crossbeam-utils/src/thread.rs +++ b/crossbeam-utils/src/thread.rs @@ -500,7 +500,7 @@ pub struct ScopedJoinHandle<'scope, T> { /// Holds the result of the inner closure. result: SharedOption, - /// A handle to the the spawned thread. + /// A handle to the spawned thread. thread: thread::Thread, /// Borrows the parent scope with lifetime `'scope`.