summaryrefslogtreecommitdiff
path: root/rts/posix/OSThreads.c
diff options
context:
space:
mode:
Diffstat (limited to 'rts/posix/OSThreads.c')
-rw-r--r--rts/posix/OSThreads.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/rts/posix/OSThreads.c b/rts/posix/OSThreads.c
index 63e979080c..a52fbe5d37 100644
--- a/rts/posix/OSThreads.c
+++ b/rts/posix/OSThreads.c
@@ -35,7 +35,6 @@
#endif
#endif
-#if defined(THREADED_RTS)
#include "RtsUtils.h"
#include "Task.h"
@@ -215,6 +214,8 @@ freeThreadLocalKey (ThreadLocalKey *key)
}
}
+#if defined(THREADED_RTS)
+
static void *
forkOS_createThreadWrapper ( void * entry )
{
@@ -266,6 +267,23 @@ getNumberOfProcessors (void)
return nproc;
}
+#else /* !defined(THREADED_RTS) */
+
+int
+forkOS_createThread ( HsStablePtr entry STG_UNUSED )
+{
+ return -1;
+}
+
+void freeThreadingResources (void) { /* nothing */ }
+
+uint32_t getNumberOfProcessors (void)
+{
+ return 1;
+}
+
+#endif /* defined(THREADED_RTS) */
+
#if defined(HAVE_SCHED_H) && defined(HAVE_SCHED_SETAFFINITY)
// Schedules the thread to run on CPU n of m. m may be less than the
// number of physical CPUs, in which case, the thread will be allowed
@@ -353,23 +371,6 @@ interruptOSThread (OSThreadId id)
pthread_kill(id, SIGPIPE);
}
-#else /* !defined(THREADED_RTS) */
-
-int
-forkOS_createThread ( HsStablePtr entry STG_UNUSED )
-{
- return -1;
-}
-
-void freeThreadingResources (void) { /* nothing */ }
-
-uint32_t getNumberOfProcessors (void)
-{
- return 1;
-}
-
-#endif /* defined(THREADED_RTS) */
-
KernelThreadId kernelThreadId (void)
{
#if defined(linux_HOST_OS)