Skip to content

Commit b70b6ab

Browse files
committed
fix bug caused by Copilot
1 parent 5722944 commit b70b6ab

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

core/src/co_pool/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,9 +191,11 @@ impl<'p> CoroutinePool<'p> {
191191
self.task_queue.is_empty()
192192
}
193193

194-
/// Returns `true` if the local task queue is empty.
194+
/// Returns `true` if the local&global task queue is empty.
195+
///
196+
/// Don't care about other local queue, but do care about global queue.
195197
pub fn is_local_empty(&self) -> bool {
196-
self.task_queue.is_local_empty()
198+
self.task_queue.is_local_empty() && self.task_queue.is_global_empty()
197199
}
198200

199201
/// Returns the number of tasks owned by this pool.

core/src/common/ordered_work_steal.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,11 @@ impl<'l, T: Debug> OrderedLocalQueue<'l, T> {
185185
self.local_len() == 0
186186
}
187187

188+
/// Returns `true` if the global queue is empty.
189+
pub fn is_global_empty(&self) -> bool {
190+
self.shared.is_empty()
191+
}
192+
188193
/// Returns `true` if all the queues are empty.
189194
pub fn is_empty(&self) -> bool {
190195
self.len() == 0

0 commit comments

Comments
 (0)