|
Revision 269, 1.0 kB
(checked in by mwhitworth, 9 months ago)
|
|
Move magic number code in waitqueue to ifdef code.
|
| Line | |
|---|
| 1 | #include <sched.h> |
|---|
| 2 | #include <task.h> |
|---|
| 3 | #include <wait.h> |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | |
|---|
| 16 | |
|---|
| 17 | void WakeUp(WaitQueue* waitQueue) |
|---|
| 18 | { |
|---|
| 19 | struct WaitQueueEntry* curr; |
|---|
| 20 | |
|---|
| 21 | |
|---|
| 22 | if (ListEmpty(&waitQueue->list)) |
|---|
| 23 | return; |
|---|
| 24 | |
|---|
| 25 | SpinLockIrq(&waitQueue->spinLock); |
|---|
| 26 | |
|---|
| 27 | ListForEachEntry(curr,&(waitQueue->list),next) |
|---|
| 28 | { |
|---|
| 29 | #ifdef WAIT_DEBUG |
|---|
| 30 | if (curr->magic != 0xDEADBEEF) |
|---|
| 31 | printf("WakeUp: Error, %#X!, thread = %#X, prev = %#X, next = %#X, magic = %#X, from %#X\n", |
|---|
| 32 | waitQueue,curr->thread,curr->next.prev,curr->next.next,curr->magic,__builtin_return_address(0)); |
|---|
| 33 | #endif |
|---|
| 34 | ThrResumeThread(curr->thread); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | SpinUnlockIrq(&waitQueue->spinLock); |
|---|
| 38 | |
|---|
| 39 | if (thrNeedSchedule) |
|---|
| 40 | ThrSchedule(); |
|---|
| 41 | } |
|---|