Fiddling with threading bugs (both Qemu and Bochs hate atm)
[tpg/acess2.git] / Kernel / messages.c
index 4765d65..03e225b 100644 (file)
@@ -6,6 +6,9 @@
 #include <threads.h>
 #include <errno.h>
 
+// === IMPORTS ===
+extern tShortSpinlock  glThreadListLock;
+
 // === CODE ===
 /**
  * \fn int Proc_SendMessage(Uint *Err, Uint Dest, int Length, void *Data)
@@ -60,7 +63,9 @@ int Proc_SendMessage(Uint *Err, Uint Dest, int Length, void *Data)
        
        SHORTREL(&thread->IsLocked);
        
+       SHORTLOCK(&glThreadListLock);
        Threads_Wake( thread );
+       SHORTREL(&glThreadListLock);
        
        return 0;
 }

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