mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-23 17:52:26 -05:00
Kernel: Make usleep aware of dynamic tick length
On my system, ticks_per_second() returns 1280. So Serenity was always 20% too fast when sleeping!
This commit is contained in:
parent
782db88e82
commit
4a5a7b68eb
Notes:
sideshowbarker
2024-07-19 04:37:44 +09:00
Author: https://github.com/BenWiederhake Commit: https://github.com/SerenityOS/serenity/commit/4a5a7b68eb8 Pull-request: https://github.com/SerenityOS/serenity/pull/2192 Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/elcuco
1 changed files with 1 additions and 1 deletions
|
@ -2436,7 +2436,7 @@ int Process::sys$usleep(useconds_t usec)
|
|||
REQUIRE_PROMISE(stdio);
|
||||
if (!usec)
|
||||
return 0;
|
||||
u64 wakeup_time = Thread::current()->sleep(usec / 1000);
|
||||
u64 wakeup_time = Thread::current()->sleep(usec * TimeManagement::the().ticks_per_second() / 1000000);
|
||||
if (wakeup_time > g_uptime)
|
||||
return -EINTR;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue