Kernel - Updated events and workqueue to use new function
authorJohn Hodge (sonata) <[email protected]>
Fri, 1 Feb 2013 02:50:24 +0000 (10:50 +0800)
committerJohn Hodge (sonata) <[email protected]>
Fri, 1 Feb 2013 02:50:24 +0000 (10:50 +0800)
KernelLand/Kernel/events.c
KernelLand/Kernel/workqueue.c

index c3ab282..84a1b0a 100644 (file)
@@ -91,7 +91,7 @@ Uint32 Threads_WaitEvents(Uint32 EventMask)
                // 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 );
        }
index 9e2c6f6..2cd6a25 100644 (file)
@@ -46,10 +46,7 @@ void *Workqueue_GetWork(tWorkqueue *Queue)
                SHORTREL(&glThreadListLock);
                
                // Yield and sleep
-               Threads_Yield();
-               if(us->Status == THREAD_STAT_QUEUESLEEP) {
-                       // Why are we awake?!
-               }
+               Threads_int_WaitForStatusEnd(THREAD_STAT_QUEUESLEEP);
 
                us->WaitPointer = NULL;
        }

UCC git Repository :: git.ucc.asn.au