diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-05-11 03:05:22 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-25 20:21:25 +0200 |
commit | 4a5a7b68eb89f2b87c5df9cde844a85e4b2a8fca (patch) | |
tree | 75a21c811c7ce9fc37a437b71e888f7546eecd30 /Kernel | |
parent | 782db88e826d46440ecc22d82446e8fc4ff96588 (diff) | |
download | serenity-4a5a7b68eb89f2b87c5df9cde844a85e4b2a8fca.zip |
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!
Diffstat (limited to 'Kernel')
-rw-r--r-- | Kernel/Process.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 8bca1bce5c..7ed7a13240 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -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; |