DescriptionWhen converting between units of time or data types of different precision,
we have to be careful to consistently round in the same direction.
Timeout checks usually check if Now() is less or equal to a deadline in order
to determine if a timeout has occurred. This correctly handles the case where
actual sleep times are equal or longer than requested sleep times.
But if we round down when setting the sleep delay, this can result in
unnecessary and expensive looping. Make sure, we always round up when converting
to a format with less precision.
BUG=none
TEST=none
Patch Set 1 #
Total comments: 1
Patch Set 2 : '' #
Total comments: 5
Patch Set 3 : '' #
Messages
Total messages: 13 (0 generated)
|