git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Kernel - Expose thread timer for EVENT_TIMER, multiple sleepers for workqueue, cleanu...
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
time.c
diff --git
a/KernelLand/Kernel/time.c
b/KernelLand/Kernel/time.c
index
a6ccd8b
..
15b6190
100644
(file)
--- a/
KernelLand/Kernel/time.c
+++ b/
KernelLand/Kernel/time.c
@@
-231,6
+231,14
@@
void Time_FreeTimer(tTimer *Timer)
LOG("%p deallocated %p", __builtin_return_address(0), Timer);
}
LOG("%p deallocated %p", __builtin_return_address(0), Timer);
}
+void Time_ScheduleEvent(int Delay)
+{
+ tTimer *t = &Proc_GetCurThread()->ThreadTimer;
+ Time_RemoveTimer(t);
+ Time_InitTimer(t, NULL, NULL);
+ Time_ScheduleTimer(t, Delay);
+}
+
/**
* \fn void Time_Delay(int Delay)
* \brief Delay for a small ammount of time
/**
* \fn void Time_Delay(int Delay)
* \brief Delay for a small ammount of time
@@
-238,9
+246,8
@@
void Time_FreeTimer(tTimer *Timer)
void Time_Delay(int Delay)
{
LOG("(%i)", Delay);
void Time_Delay(int Delay)
{
LOG("(%i)", Delay);
- tTimer *t = &Proc_GetCurThread()->ThreadTimer;
- Time_InitTimer(t, NULL, NULL);
- Time_ScheduleTimer(t, Delay);
+ Threads_ClearEvent(THREAD_EVENT_TIMER);
+ Time_ScheduleEvent(Delay);
Threads_WaitEvents(THREAD_EVENT_TIMER);
}
Threads_WaitEvents(THREAD_EVENT_TIMER);
}
UCC
git Repository :: git.ucc.asn.au