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:
@@ -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;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user