Classes | |
struct | TIMER |
This structure describes a timer for the kernel. More... | |
Functions | |
void | timer_hs (dword deltaStart, dword interval, dword timerFunc, dword userData) |
This function adds a timer. If deltaStart is nonzero, the timer is activated after deltaStart hundredths of seconds starting from the current time. If interval is nonzero, the timer is activated every deltaWork hundredths of seconds starting from the first activation. The activated timer calls timerFunc as stdcall function with one argument userData. Return value is NULL if something has failed or some value which is opaque for the caller. Later this value can be used for cancel_timer_hs. More... | |
void | check_timers_has_work () |
This is a simplified version of check_timers that does not call anything, just checks whether check_timers should do something. More... | |
Variables | |
label | timer_list |
The head of timer list. More... | |
dd | timer_list_owner |
These two variables are used to synchronize access to the global list. Logically, they form an recursive mutex. Physically, the first variable holds the slot number of the current owner or 0, the second variable holds the recursion count. The mutex should be recursive to allow a timer function to add/delete other timers or itself. More... | |
dd | timer_list_numlocks |
dd | timer_next |
A timer function can delete any timer, including itself and the next timer in the chain. To handle such situation correctly, we keep the next timer in a global variable, so the removing operation can update it. More... | |
label | lock_timer_list |
This internal function acquires the lock for the global list. More... | |
label | unlock_timer_list |
This internal function releases the lock for the global list. More... | |
label | cancel_timer_hs |
This function removes a timer. The only argument is [esp+4] = the value which was returned from timer_hs. More... | |
label | check_timers |
This function is regularly called from osloop. It processes the global list and activates the corresponding timers. More... | |
void check_timers_has_work | ( | ) |
This is a simplified version of check_timers that does not call anything, just checks whether check_timers should do something.
void timer_hs | ( | dword | deltaStart, |
dword | interval, | ||
dword | timerFunc, | ||
dword | userData | ||
) |
This function adds a timer. If deltaStart is nonzero, the timer is activated after deltaStart hundredths of seconds starting from the current time. If interval is nonzero, the timer is activated every deltaWork hundredths of seconds starting from the first activation. The activated timer calls timerFunc as stdcall function with one argument userData. Return value is NULL if something has failed or some value which is opaque for the caller. Later this value can be used for cancel_timer_hs.
label cancel_timer_hs |
This function removes a timer. The only argument is [esp+4] = the value which was returned from timer_hs.
label check_timers |
This function is regularly called from osloop. It processes the global list and activates the corresponding timers.
label lock_timer_list |
This internal function acquires the lock for the global list.
label timer_list |
The head of timer list.
dd timer_list_numlocks |
dd timer_list_owner |
These two variables are used to synchronize access to the global list. Logically, they form an recursive mutex. Physically, the first variable holds the slot number of the current owner or 0, the second variable holds the recursion count. The mutex should be recursive to allow a timer function to add/delete other timers or itself.
dd timer_next |
A timer function can delete any timer, including itself and the next timer in the chain. To handle such situation correctly, we keep the next timer in a global variable, so the removing operation can update it.
label unlock_timer_list |
This internal function releases the lock for the global list.