MCPcopy Create free account
hub / github.com/chyyuu/os_kernel_lab / sys_sleep

Function sys_sleep

os/src/syscall/sync.rs:6–12  ·  view source on GitHub ↗
(ms: usize)

Source from the content-addressed store, hash-verified

4use alloc::sync::Arc;
5
6pub fn sys_sleep(ms: usize) -> isize {
7 let expire_ms = get_time_ms() + ms;
8 let task = current_task().unwrap();
9 add_timer(expire_ms, task);
10 block_current_and_run_next();
11 0
12}
13
14pub fn sys_mutex_create(blocking: bool) -> isize {
15 let process = current_process();

Callers 1

syscallFunction · 0.70

Calls 4

get_time_msFunction · 0.85
current_taskFunction · 0.85
add_timerFunction · 0.85

Tested by

no test coverage detected