forked from organicmaps/organicmaps
Correct GetCurrentThreadID.
This commit is contained in:
parent
fcfebfbcda
commit
8d869b98d1
3 changed files with 12 additions and 6 deletions
|
@ -1,8 +1,6 @@
|
|||
#include "thread.hpp"
|
||||
#include "assert.hpp"
|
||||
|
||||
#include "../std/target_os.hpp"
|
||||
|
||||
#if defined(OMIM_OS_BADA)
|
||||
#include <FBaseRtThreadThread.h>
|
||||
#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<void *>(pthread_self());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -335,7 +335,7 @@ private:
|
|||
m2::RectD m_rect;
|
||||
pair<int, int> m_scaleRange;
|
||||
|
||||
map<int, IndexT *> m_indexes;
|
||||
map<threads::ThreadID, IndexT *> m_indexes;
|
||||
uint16_t volatile m_lockCount;
|
||||
uint8_t volatile m_queriesSkipped;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue