Invalidated page that has just been marked COW
[tpg/acess2.git] / Kernel / threads.c
index 1ccac9f..da65596 100644 (file)
@@ -93,7 +93,12 @@ void Threads_Init()
                cur->ThreadName = "Idle Thread";
                Threads_SetTickets(0);  // Never called randomly
                cur->Quantum = 1;       // 1 slice quantum
-               for(;;) __asm__ __volatile__ ("hlt");   // Just yeilds
+               HALT();
+               for(;;) {
+                       //Log("---- Idle");
+                       //Threads_Dump();
+                       HALT(); // Just yeilds
+               }
        }
        #endif
        
@@ -137,6 +142,8 @@ void Threads_SetTickets(int Num)
  */
 int Threads_WaitTID(int TID, int *status)
 {
+       Threads_Dump();
+       
        // Any Child
        if(TID == -1) {
                
@@ -333,7 +340,7 @@ void Threads_Kill(tThread *Thread, int Status)
  */
 void Threads_Yield()
 {
-       Proc_GetCurThread()->Quantum = 0;
+       Proc_GetCurThread()->Remaining = 0;
        HALT();
 }
 
@@ -346,7 +353,7 @@ void Threads_Sleep()
        tThread *cur = Proc_GetCurThread();
        tThread *thread;
        
-       //Log("Proc_Sleep: %i going to sleep", gCurrentThread->TID);
+       Log("Proc_Sleep: %i going to sleep", cur->TID);
        
        // Acquire Spinlock
        LOCK( &giThreadListLock );

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