1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Remove lock announce message.

This removes problem with static initialization order of mutices vs
tracy.

Lock source location is now transferred in lock wait message.
This commit is contained in:
Bartosz Taudul
2017-10-12 20:14:17 +02:00
parent c42106f4ff
commit 737671adbf
4 changed files with 16 additions and 29 deletions
+3 -8
View File
@@ -17,15 +17,8 @@ class Lockable
public:
tracy_force_inline Lockable( const SourceLocation* srcloc )
: m_id( s_lockCounter.fetch_add( 1, std::memory_order_relaxed ) )
, m_lckloc( (uint64_t)srcloc )
{
Magic magic;
auto& token = s_token.ptr;
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<moodycamel::CanAlloc>( magic );
item->hdr.type = QueueType::LockAnnounce;
item->lockAnnounce.id = m_id;
item->lockAnnounce.srcloc = (uint64_t)srcloc;
tail.store( magic + 1, std::memory_order_release );
}
Lockable( const Lockable& ) = delete;
@@ -44,6 +37,7 @@ public:
item->lockWait.id = m_id;
item->lockWait.thread = thread;
item->lockWait.time = Profiler::GetTime( cpu );
item->lockWait.lckloc = m_lckloc;
tail.store( magic + 1, std::memory_order_release );
}
@@ -113,6 +107,7 @@ public:
private:
T m_lockable;
uint64_t m_id;
uint64_t m_lckloc;
};
};