PLATFORM := lin\r
endif\r
\r
-KERNEL_SRC = ../../Kernel/\r
+KERNEL_SRC = ../../KernelLand/Kernel/\r
\r
KERNEL_OBJ := logging.o adt.o lib.o drvutil.o debug.o\r
KERNEL_OBJ += vfs/main.o vfs/open.o vfs/acls.o vfs/io.o vfs/dir.o\r
tProcess *Process;
+ Uint32 Events, WaitMask;
+ SDL_sem *EventSem;
+
} tThread;
// === PROTOTYPES ===
return AmmountToAdd;
}
+Uint32 Threads_WaitEvents(Uint32 Mask)
+{
+ Uint32 rv;
+ gpCurrentThread->WaitMask = Mask;
+ if( !(gpCurrentThread->Events & Mask) )
+ SDL_SemWait( gpCurrentThread->EventSem );
+ rv = gpCurrentThread->Events & Mask;
+ gpCurrentThread->Events &= ~Mask;
+ gpCurrentThread->WaitMask = -1;
+ return rv;
+}
+
+void Threads_PostEvent(tThread *Thread, Uint32 Events)
+{
+ Thread->Events |= Events;
+
+ if( Thread->WaitMask & Events )
+ SDL_SemPost( gpCurrentThread->EventSem );
+}
+