?? wait.c
字號(hào):
/* * This source code is a part of coLinux source package. * * Dan Aloni <da-x@colinux.org>, 2003 (c) * * The code is licensed under the GPL. See the COPYING file at * the root directory. * */#include "../ddk.h"#include <colinux/os/alloc.h>#include <colinux/os/kernel/wait.h>struct co_os_wait { KEVENT event;};co_rc_t co_os_wait_create(co_os_wait_t *wait_out){ co_os_wait_t wait; *wait_out = NULL; wait = co_os_malloc(sizeof(*wait)); if (wait == NULL) return CO_RC(OUT_OF_MEMORY); KeInitializeEvent(&wait->event, SynchronizationEvent, FALSE); *wait_out = wait; return CO_RC(OK);}void co_os_wait_sleep(co_os_wait_t wait){ NTSTATUS status; status = KeWaitForSingleObject(&wait->event, UserRequest, UserMode, TRUE, NULL);}void co_os_wait_wakeup(co_os_wait_t wait){ KeSetEvent(&wait->event, 1, PFALSE);}void co_os_wait_destroy(co_os_wait_t wait){ if (wait != NULL) co_os_free(wait);}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -