0
0
mirror of https://github.com/yse/easy_profiler.git synced 2024-12-27 08:41:02 +08:00

Linux runtime fix

This commit is contained in:
Sergey Yagovtsev 2016-02-24 00:08:13 +03:00
parent 98f3da5122
commit 5dfb456176

View File

@ -2,6 +2,8 @@
#include <thread> #include <thread>
#include <string.h> #include <string.h>
#include <fstream>
using namespace profiler; using namespace profiler;
extern "C"{ extern "C"{
@ -80,10 +82,11 @@ void ProfileManager::beginBlock(Block* _block)
void ProfileManager::endBlock() void ProfileManager::endBlock()
{ {
if (!m_isEnabled) if (!m_isEnabled)
return; return;
size_t threadId = std::hash<std::thread::id>()(std::this_thread::get_id()); uint32_t threadId = std::hash<std::thread::id>()(std::this_thread::get_id());
guard_lock_t lock(m_spin); guard_lock_t lock(m_spin);
auto& stackOfOpenedBlocks = m_openedBracketsMap[threadId]; auto& stackOfOpenedBlocks = m_openedBracketsMap[threadId];