From 5a155bb75b62f02c8ed16cdafd492b625ce208c0 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Thu, 20 Apr 2017 13:54:01 +0200 Subject: Simplify PTHREAD_VALUE The distinction between MACOSX and other had been introduced with ed8110e101db5a8ea4dde43a3ec38fe40e6fe7e2 "Avoid reinterpret_cast to same type" to work around a GCC 4.6 bug that is fixed since GCC 4.7. Change-Id: I7948721d311de2622c1e08e2ee17b5ccc304b51b --- sal/osl/unx/system.hxx | 6 ------ sal/osl/unx/thread.cxx | 5 +++-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/sal/osl/unx/system.hxx b/sal/osl/unx/system.hxx index 78d49c403ddf..a822b0a83a10 100644 --- a/sal/osl/unx/system.hxx +++ b/sal/osl/unx/system.hxx @@ -271,12 +271,6 @@ int macxp_resolveAlias(char *path, int buflen); # define INIT_GROUPS(name, gid) ((setgid((gid)) == 0) && (initgroups((name), (gid)) == 0)) #endif -#if defined MACOSX -#define PTHREAD_VALUE(t) reinterpret_cast(t) -#else -#define PTHREAD_VALUE(t) ((unsigned long) (t)) -#endif - #ifndef PTHREAD_NONE # define PTHREAD_NONE _pthread_none_ # ifndef PTHREAD_NONE_INIT diff --git a/sal/osl/unx/thread.cxx b/sal/osl/unx/thread.cxx index 34bf38cde607..e829b91781c6 100644 --- a/sal/osl/unx/thread.cxx +++ b/sal/osl/unx/thread.cxx @@ -56,7 +56,8 @@ * (2) 'oslThreadIdentifier' and '{insert|remove|lookup}ThreadId()' * - cannot reliably be applied to 'alien' threads; * - memory leak for 'alien' thread 'HashEntry's; - * - use 'PTHREAD_VALUE(pthread_t)' as identifier instead (?) + * - use 'reinterpret_cast(pthread_t)' as identifier + * instead (?) * - if yes, change 'oslThreadIdentifier' to 'intptr_t' or similar * (3) 'oslSigAlarmHandler()' (#71232#) * - [Under Solaris we get SIGALRM in e.g. pthread_join which terminates @@ -552,7 +553,7 @@ void SAL_CALL osl_setThreadName(char const * name) { /* osl_getThreadIdentifier @@@ see TODO @@@ */ /*****************************************************************************/ -#define HASHID(x) (PTHREAD_VALUE(x) % HashSize) +#define HASHID(x) (reinterpret_cast(x) % HashSize) struct HashEntry { -- cgit