From dc1c9ab48f4c4b48db8f05fe785a738d58b17acf Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Fri, 6 Feb 2015 14:35:47 +0100 Subject: [PATCH] fixed casts for threads --- lib/Basics/threads-posix.cpp | 4 ++-- lib/Basics/threads-posix.h | 4 ++-- lib/Scheduler/SchedulerThread.cpp | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/Basics/threads-posix.cpp b/lib/Basics/threads-posix.cpp index 3582140dd1..ef6f8041d5 100644 --- a/lib/Basics/threads-posix.cpp +++ b/lib/Basics/threads-posix.cpp @@ -108,7 +108,7 @@ void TRI_InitThread (TRI_thread_t* thread) { //////////////////////////////////////////////////////////////////////////////// TRI_pid_t TRI_CurrentProcessId () { - return (TRI_pid_t) getpid(); + return getpid(); } //////////////////////////////////////////////////////////////////////////////// @@ -128,7 +128,7 @@ TRI_tpid_t TRI_CurrentThreadProcessId () { //////////////////////////////////////////////////////////////////////////////// TRI_tid_t TRI_CurrentThreadId () { - return (TRI_tid_t) pthread_self(); + return pthread_self(); } //////////////////////////////////////////////////////////////////////////////// diff --git a/lib/Basics/threads-posix.h b/lib/Basics/threads-posix.h index 3e1690c5e1..65d8203ba6 100644 --- a/lib/Basics/threads-posix.h +++ b/lib/Basics/threads-posix.h @@ -54,13 +54,13 @@ /// @brief thread process identifier //////////////////////////////////////////////////////////////////////////////// -#define TRI_tpid_t int +#define TRI_tpid_t pid_t //////////////////////////////////////////////////////////////////////////////// /// @brief thread identifier //////////////////////////////////////////////////////////////////////////////// -#define TRI_tid_t uintptr_t +#define TRI_tid_t pthread_t //////////////////////////////////////////////////////////////////////////////// /// @brief thread diff --git a/lib/Scheduler/SchedulerThread.cpp b/lib/Scheduler/SchedulerThread.cpp index 75ba2273bf..fce4b8a227 100644 --- a/lib/Scheduler/SchedulerThread.cpp +++ b/lib/Scheduler/SchedulerThread.cpp @@ -112,7 +112,7 @@ bool SchedulerThread::open () { //////////////////////////////////////////////////////////////////////////////// void SchedulerThread::beginShutdown () { - LOG_TRACE("beginning shutdown sequence of scheduler thread (%d)", (int) threadId()); + LOG_TRACE("beginning shutdown sequence of scheduler thread (%llu)", (unsigned long long) threadId()); _stopping = 1; _scheduler->wakeupLoop(_loop); @@ -231,7 +231,7 @@ void SchedulerThread::destroyTask (Task* task) { //////////////////////////////////////////////////////////////////////////////// void SchedulerThread::run () { - LOG_TRACE("scheduler thread started (%d)", (int) threadId()); + LOG_TRACE("scheduler thread started (%llu)", (unsigned long long) threadId()); if (_defaultLoop) { #ifdef TRI_HAVE_POSIX_THREADS @@ -305,7 +305,7 @@ void SchedulerThread::run () { SCHEDULER_UNLOCK(&_queueLock); } - LOG_TRACE("scheduler thread stopped (%d)", (int) threadId()); + LOG_TRACE("scheduler thread stopped (%llu)", (unsigned long long) threadId()); _stopped = 1;