mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:38:11 +00: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
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
Add a link
Reference in a new issue