From 8d869b98d1212b7feb39aecef7d7e6a705f97c3f Mon Sep 17 00:00:00 2001 From: vng Date: Fri, 29 Jul 2011 00:40:02 +0300 Subject: [PATCH] Correct GetCurrentThreadID. --- base/thread.cpp | 6 ++---- base/thread.hpp | 10 +++++++++- indexer/index.hpp | 2 +- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/base/thread.cpp b/base/thread.cpp index ae76a7e6d8..37b5c41245 100644 --- a/base/thread.cpp +++ b/base/thread.cpp @@ -1,8 +1,6 @@ #include "thread.hpp" #include "assert.hpp" -#include "../std/target_os.hpp" - #if defined(OMIM_OS_BADA) #include #elif defined(OMIM_OS_WINDOWS_NATIVE) @@ -179,12 +177,12 @@ namespace threads #endif } - int GetCurrentThreadID() + ThreadID GetCurrentThreadID() { #ifdef OMIM_OS_WINDOWS return ::GetCurrentThreadId(); #else - return pthread_self(); + return static_cast(pthread_self()); #endif } } diff --git a/base/thread.hpp b/base/thread.hpp index a539550534..c9ad0330e3 100644 --- a/base/thread.hpp +++ b/base/thread.hpp @@ -1,5 +1,7 @@ #pragma once +#include "../std/target_os.hpp" + #include "../std/stdint.hpp" namespace threads @@ -47,6 +49,12 @@ namespace threads /// @param[in] ms time-out interval in milliseconds void Sleep(size_t ms); - int GetCurrentThreadID(); +#ifdef OMIM_OS_WINDOWS + typedef DWORD ThreadID; +#else + typedef void * ThreadID; +#endif + + ThreadID GetCurrentThreadID(); } // namespace threads diff --git a/indexer/index.hpp b/indexer/index.hpp index fcd69f47c0..527fdd2d83 100644 --- a/indexer/index.hpp +++ b/indexer/index.hpp @@ -335,7 +335,7 @@ private: m2::RectD m_rect; pair m_scaleRange; - map m_indexes; + map m_indexes; uint16_t volatile m_lockCount; uint8_t volatile m_queriesSkipped; };