From 04f0b7b21b4902f356809fced858de8d00bae1b6 Mon Sep 17 00:00:00 2001 From: Mark Slee Date: Tue, 21 Aug 2007 01:54:36 +0000 Subject: [PATCH] Use reinterpret_cast instead of static_cast for pthread_t => Thread::id_t Summary: On FreeBSD pthread_t is a pthread*, not uint64_t, so static_cast gest upset Reviewed By: dreiss Test Plan: Compile on FreeBSD git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665210 13f79535-47bb-0310-9956-ffa450edef68 --- lib/cpp/src/concurrency/PosixThreadFactory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.cpp b/lib/cpp/src/concurrency/PosixThreadFactory.cpp index 73aba616b..f6ab6c729 100644 --- a/lib/cpp/src/concurrency/PosixThreadFactory.cpp +++ b/lib/cpp/src/concurrency/PosixThreadFactory.cpp @@ -135,7 +135,7 @@ class PthreadThread: public Thread { } id_t getId() { - return static_cast(pthread_); + return reinterpret_cast(pthread_); } shared_ptr runnable() const { return Thread::runnable(); } @@ -258,7 +258,7 @@ class PosixThreadFactory::Impl { void setDetached(bool value) { detached_ = value; } - Thread::id_t getCurrentThreadId() const {return static_cast(pthread_self());} + Thread::id_t getCurrentThreadId() const {return reinterpret_cast(pthread_self());} };