mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-25 05:55:13 +00:00
Process: Use monotonic time for timeouts
This commit is contained in:
parent
b4c92c24ee
commit
b536547c52
Notes:
sideshowbarker
2024-07-19 08:14:07 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/b536547c523 Pull-request: https://github.com/SerenityOS/serenity/pull/1396 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/shannonbooth ✅
1 changed files with 2 additions and 2 deletions
|
@ -2788,7 +2788,7 @@ int Process::sys$select(const Syscall::SC_select_params* params)
|
||||||
timeval computed_timeout;
|
timeval computed_timeout;
|
||||||
bool select_has_timeout = false;
|
bool select_has_timeout = false;
|
||||||
if (timeout && (timeout->tv_sec || timeout->tv_usec)) {
|
if (timeout && (timeout->tv_sec || timeout->tv_usec)) {
|
||||||
timeval_add(kgettimeofday(), *timeout, computed_timeout);
|
timeval_add(Scheduler::time_since_boot(), *timeout, computed_timeout);
|
||||||
select_has_timeout = true;
|
select_has_timeout = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2886,7 +2886,7 @@ int Process::sys$poll(pollfd* fds, int nfds, int timeout)
|
||||||
timeout -= 1000;
|
timeout -= 1000;
|
||||||
}
|
}
|
||||||
tvtimeout.tv_usec = timeout * 1000;
|
tvtimeout.tv_usec = timeout * 1000;
|
||||||
timeval_add(kgettimeofday(), tvtimeout, actual_timeout);
|
timeval_add(Scheduler::time_since_boot(), tvtimeout, actual_timeout);
|
||||||
has_timeout = true;
|
has_timeout = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue