mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-29 16:54:35 +00:00
Don't thrash memory bandwith during file load.
This commit is contained in:
parent
c127f51767
commit
470600fbc2
@ -142,6 +142,7 @@ private:
|
||||
{
|
||||
if( m_exit.load( std::memory_order_relaxed ) == true ) return;
|
||||
if( m_signalSwitch.load( std::memory_order_relaxed ) == true ) break;
|
||||
std::this_thread::yield();
|
||||
}
|
||||
m_signalSwitch.store( false, std::memory_order_relaxed );
|
||||
std::swap( m_buf, m_second );
|
||||
@ -165,7 +166,7 @@ private:
|
||||
if( m_offset == BufSize )
|
||||
{
|
||||
m_signalSwitch.store( true, std::memory_order_relaxed );
|
||||
while( m_signalAvailable.load( std::memory_order_acquire ) == false ) {}
|
||||
while( m_signalAvailable.load( std::memory_order_acquire ) == false ) { std::this_thread::yield(); }
|
||||
m_signalAvailable.store( false, std::memory_order_relaxed );
|
||||
}
|
||||
|
||||
@ -184,7 +185,7 @@ private:
|
||||
if( m_offset == BufSize )
|
||||
{
|
||||
m_signalSwitch.store( true, std::memory_order_relaxed );
|
||||
while( m_signalAvailable.load( std::memory_order_acquire ) == false ) {}
|
||||
while( m_signalAvailable.load( std::memory_order_acquire ) == false ) { std::this_thread::yield(); }
|
||||
m_signalAvailable.store( false, std::memory_order_relaxed );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user