diff options
| author | Ben Gamari <ben@smart-cactus.org> | 2022-07-15 20:52:05 -0400 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2022-07-15 23:17:17 -0400 |
| commit | 13147361a65435c267610511953d68396722e865 (patch) | |
| tree | 73f19bdad2ce76929bd9e37713a9b70028803681 | |
| parent | 073f38049be45ead63aea554bd69f78ad003d7fb (diff) | |
| download | haskell-wip/alpine-i386.tar.gz | |
rts: Eliminate platform-dependent castingwip/alpine-i386
Previously serialiseTaskId had some superfluous platform-dependent logic
to determine whether or not TaskId OsThreadId is an integer. However,
this is unnecessary; we now just unconditionally cast through uintptr_t.
| -rw-r--r-- | rts/Task.h | 10 |
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 |
