You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently all wait methods are just cycling in a loop while timer is not
expired. At the beginning of each iteration, `timeout - timer.elapsed()`
expression is used to calculate timeout for `NetProvider::wait()`, and
that `wait` expects only non-negative timeouts (or `-1` for infinity).
So, for example, if the operating system will reschedule the process
right between `timer.isExpired()` and `timer.elapsed()` call, timer
can become expired after we are scheduled again, and we will suddenly
pass a negative value to the provider.
Let's replace `elapsed` method with more safe `timeLeft` which returns
zero when the timeout is expired. Also, such method will be handy in the
following commits.
Closes#128
0 commit comments