syscalls: fix nanosleep, thanks to gemini, sorry for that
This commit is contained in:
@@ -315,10 +315,11 @@ uint32_t sys_nanosleep(TrapFrame *tf)
|
||||
//debug_log("waiting for 0x%X ms\n", ms);
|
||||
size_t start_time = timer_ticks;
|
||||
|
||||
scheduler_lock();
|
||||
current->wake_up_time = timer_ticks + ms;
|
||||
//debug_log("setting wake up time to %X (current time is %X)\n", current->wake_up_time, timer_ticks);
|
||||
|
||||
//TODO: find a way to call the scheduler from here without fucking shit up
|
||||
current->state = Waiting;
|
||||
schedule();
|
||||
scheduler_unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user