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 - Added a per-thread timer object to reduce malloc use
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
time.c
diff --git
a/KernelLand/Kernel/time.c
b/KernelLand/Kernel/time.c
index
d8c2924
..
449afcd
100644
(file)
--- a/
KernelLand/Kernel/time.c
+++ b/
KernelLand/Kernel/time.c
@@
-8,19
+8,11
@@
#define DEBUG 0
#include <acess.h>
#include <timers.h>
#define DEBUG 0
#include <acess.h>
#include <timers.h>
+#include <timers_int.h>
#include <events.h>
#include <hal_proc.h> // Proc_GetCurThread
#include <workqueue.h>
#include <events.h>
#include <hal_proc.h> // Proc_GetCurThread
#include <workqueue.h>
-
-// === TYPEDEFS ===
-struct sTimer {
- tTimer *Next;
- Sint64 FiresAfter;
- void (*Callback)(void*);
- void *Argument;
-// tMutex Lock;
- BOOL bActive;
-};
+#include <threads_int.h> // Used to get thread timer
// === PROTOTYPES ===
void Timer_CallbackThread(void *Unused);
// === PROTOTYPES ===
void Timer_CallbackThread(void *Unused);
@@
-240,11
+232,10
@@
void Time_FreeTimer(tTimer *Timer)
*/
void Time_Delay(int Delay)
{
*/
void Time_Delay(int Delay)
{
- tTimer *t;
-
t = Time_AllocateTimer(
NULL, NULL);
+ tTimer *t
= &Proc_GetCurThread()->ThreadTimer
;
+
Time_InitTimer(t,
NULL, NULL);
Time_ScheduleTimer(t, Delay);
Threads_WaitEvents(THREAD_EVENT_TIMER);
Time_ScheduleTimer(t, Delay);
Threads_WaitEvents(THREAD_EVENT_TIMER);
- Time_FreeTimer(t);
}
// === EXPORTS ===
}
// === EXPORTS ===
UCC
git Repository :: git.ucc.asn.au