對於Linux用戶空間, 只有TEO系統調用允許設置一個定時器,但不會同時阻止
可與KTIMER
實施
-timer_set_time
-Alarm
爲Win內核:在事件調用進程
KTIMER (Wdm.h)
KeInitializeTimer(PKTIMER Timer):
Timer: Pointer to a timer object, for which the caller provides the storage.
KeSetTimer (PKTIMER Timer, LARGE_INTEGER DueTimer, **PKDPC Dpc**)
爲了贏得用戶的空間,
可與可等待計時器對象實現:
BOOL SetWaitableTimer(
HANDLE hTimer, // handle to a timer object
const LARGE_INTEGER *pDueTime, // when timer will become signaled
LONG lPeriod, // periodic timer interval
PTIMERAPCROUTINE pfnCompletionRoutine, // pointer to the completion routine
LPVOID lpArgToCompletionRoutine, // data passed to the completion routine
BOOL fResume // flag for resume state
);