Changeset 537
- Timestamp:
- 05/24/08 09:54:33 (6 months ago)
- Files:
-
- 1 modified
-
Whitix/branches/hybrid/kernel/timer.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
Whitix/branches/hybrid/kernel/timer.c
r9 r537 20 20 #include <llist.h> 21 21 #include <console.h> 22 #include <module.h> 22 23 #include <error.h> 23 24 #include <task.h> … … 73 74 } 74 75 76 SYMBOL_EXPORT(TimerAdd); 77 75 78 /*********************************************************************** 76 79 * … … 110 113 return err; 111 114 } 115 116 SYMBOL_EXPORT(TimerRemove); 112 117 113 118 /*********************************************************************** … … 151 156 void Sleep(int milliSeconds) 152 157 { 153 struct Timer * timer=(struct Timer*)malloc(sizeof(struct Timer));158 struct Timer timer; 154 159 155 timer ->func=SleepWakeup;156 timer ->expires=milliSeconds;157 timer ->data=currThread;160 timer.func=SleepWakeup; 161 timer.expires=milliSeconds; 162 timer.data=currThread; 158 163 159 TimerAdd( timer);164 TimerAdd(&timer); 160 165 ThrSuspendThread(currThread); 161 166 ThrSchedule(); 167 } 162 168 163 /* And will arrive here after it expires */ 164 free(timer); 165 } 169 SYMBOL_EXPORT(Sleep);