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
Modules/UDI - Implimenting UDI support, can load udi_dpt from udiref
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
events.c
diff --git
a/KernelLand/Kernel/events.c
b/KernelLand/Kernel/events.c
index
da095e9
..
84a1b0a
100644
(file)
--- a/
KernelLand/Kernel/events.c
+++ b/
KernelLand/Kernel/events.c
@@
-26,15
+26,25
@@
void Threads_PostEvent(tThread *Thread, Uint32 EventMask)
LOG("Thread->EventState = 0x%x", Thread->EventState);
// Currently sleeping on an event?
LOG("Thread->EventState = 0x%x", Thread->EventState);
// Currently sleeping on an event?
-
if( Thread->Status == THREAD_STAT_EVENTSLEEP
)
+
switch(Thread->Status
)
{
{
- // Waiting on this event?
+ // Waiting on this event?
+ case THREAD_STAT_EVENTSLEEP:
if( (Uint32)Thread->RetStatus & EventMask )
{
// Wake up
LOG("Waking thread %p(%i %s)", Thread, Thread->TID, Thread->ThreadName);
Threads_AddActive(Thread);
}
if( (Uint32)Thread->RetStatus & EventMask )
{
// Wake up
LOG("Waking thread %p(%i %s)", Thread, Thread->TID, Thread->ThreadName);
Threads_AddActive(Thread);
}
+ break;
+ case THREAD_STAT_SEMAPHORESLEEP:
+ if( EventMask & THREAD_EVENT_TIMER )
+ {
+ LOG("Waking %p(%i %s) from semaphore on timer",
+ Thread, Thread->TID, Thread->ThreadName);
+ Semaphore_ForceWake(Thread);
+ }
+ break;
}
SHORTREL( &Thread->IsLocked );
}
SHORTREL( &Thread->IsLocked );
@@
-81,7
+91,7
@@
Uint32 Threads_WaitEvents(Uint32 EventMask)
// Note stored anywhere because we're woken using other means
SHORTREL( &glThreadListLock );
SHORTREL( &us->IsLocked );
// Note stored anywhere because we're woken using other means
SHORTREL( &glThreadListLock );
SHORTREL( &us->IsLocked );
-
while(us->Status == THREAD_STAT_EVENTSLEEP) Threads_Yield(
);
+
Threads_int_WaitForStatusEnd(THREAD_STAT_EVENTSLEEP
);
// Woken when lock is acquired
SHORTLOCK( &us->IsLocked );
}
// Woken when lock is acquired
SHORTLOCK( &us->IsLocked );
}
UCC
git Repository :: git.ucc.asn.au