async_engine: slightly optimize dispatch
This commit is contained in:
parent
297a6e58cd
commit
0ccc1a2391
1 changed files with 2 additions and 2 deletions
|
|
@ -97,7 +97,7 @@ impl AsyncEngine {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
self.num_queued.fetch_sub(stash.len());
|
self.num_queued.fetch_sub(stash.len());
|
||||||
for runnable in stash.drain(..) {
|
while let Some(runnable) = stash.pop_front() {
|
||||||
runnable.run();
|
runnable.run();
|
||||||
if self.stopped.get() {
|
if self.stopped.get() {
|
||||||
return;
|
return;
|
||||||
|
|
@ -105,7 +105,7 @@ impl AsyncEngine {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.yields.swap(&mut *yield_stash);
|
self.yields.swap(&mut *yield_stash);
|
||||||
for waker in yield_stash.drain(..) {
|
while let Some(waker) = yield_stash.pop_front() {
|
||||||
waker.wake();
|
waker.wake();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue