#include "Rts.h"
#if defined(THREADED_RTS)
-#include "OSThreads.h"
#include "RtsUtils.h"
+#include <windows.h>
/* For reasons not yet clear, the entire contents of process.h is protected
* by __STRICT_ANSI__ not being defined.
void
yieldThread()
{
- Sleep(0);
+ SwitchToThread();
return;
}
shutdownThread()
{
_endthreadex(0);
+ barf("_endthreadex returned"); // avoid gcc warning
}
int
(unsigned*)&pId) == 0);
}
+nat
+getNumberOfProcessors (void)
+{
+ static nat nproc = 0;
+
+ if (nproc == 0) {
+ SYSTEM_INFO si;
+ GetSystemInfo(&si);
+ nproc = si.dwNumberOfProcessors;
+ }
+
+ return nproc;
+}
+
+void
+setThreadAffinity (nat n STG_UNUSED, nat m STG_UNUSED)
+{
+ /* ToDo */
+}
+
#else /* !defined(THREADED_RTS) */
int