mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-22 00:00:11 +02:00
Timer: always park nested Park (#327)
The nested `Park` might need to do some work, even if the duration is 0 seconds (e.g. a `Reactor`). Similar to what #313 did for CurrentThread.
This commit is contained in:
committed by
Carl Lerche
parent
6defeeb2ba
commit
6a0ecef81a
@@ -478,6 +478,8 @@ where T: Park,
|
||||
|
||||
if deadline > now {
|
||||
self.park.park_timeout(deadline - now)?;
|
||||
} else {
|
||||
self.park.park_timeout(Duration::from_secs(0))?;
|
||||
}
|
||||
}
|
||||
None => {
|
||||
@@ -500,6 +502,8 @@ where T: Park,
|
||||
|
||||
if deadline > now {
|
||||
self.park.park_timeout(cmp::min(deadline - now, duration))?;
|
||||
} else {
|
||||
self.park.park_timeout(Duration::from_secs(0))?;
|
||||
}
|
||||
}
|
||||
None => {
|
||||
|
||||
Reference in New Issue
Block a user