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