summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-05-11 03:05:22 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-25 20:21:25 +0200
commit4a5a7b68eb89f2b87c5df9cde844a85e4b2a8fca (patch)
tree75a21c811c7ce9fc37a437b71e888f7546eecd30 /Kernel
parent782db88e826d46440ecc22d82446e8fc4ff96588 (diff)
downloadserenity-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.cpp2
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;