summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rts/Task.h10
1 files changed, 2 insertions, 8 deletions
diff --git a/rts/Task.h b/rts/Task.h
index fd7b68aecf..929601edb3 100644
--- a/rts/Task.h
+++ b/rts/Task.h
@@ -318,14 +318,8 @@ typedef StgWord64 TaskId;
//
#if defined(THREADED_RTS)
INLINE_HEADER TaskId serialiseTaskId (OSThreadId taskID) {
-#if defined(freebsd_HOST_OS) || defined(darwin_HOST_OS)
- // Here OSThreadId is a pthread_t and pthread_t is a pointer, but within
- // the process we can still use that pointer value as a unique id.
- return (TaskId) (size_t) taskID;
-#else
- // On Windows, Linux and others it's an integral type to start with.
- return (TaskId) taskID;
-#endif
+ // N.B. OSThreadId may be a pointer, therefore we first cast to uintptr_t
+ return (TaskId) (uintptr_t) taskID;
}
#endif