do not self wake up when have a payload

This commit is contained in:
fakeshadow 2021-02-11 21:09:03 -08:00
parent 4fc7d76759
commit b3155e6913
1 changed files with 6 additions and 1 deletions

View File

@ -772,7 +772,12 @@ where
// at this point it's not known io is still scheduled to // at this point it's not known io is still scheduled to
// be waked up. so force wake up dispatcher just in case. // be waked up. so force wake up dispatcher just in case.
// TODO: figure out the overhead. // TODO: figure out the overhead.
if this.payload.is_none() {
// When dispatcher has a payload. The responsibility of
// wake up stream would be shift to PayloadSender.
// Therefore no self wake up is needed.
cx.waker().wake_by_ref(); cx.waker().wake_by_ref();
}
return Ok(false); return Ok(false);
} }