Use lockable wrapper in test program.

This commit is contained in:
Bartosz Taudul 2017-10-04 15:41:23 +02:00
parent a3ef369a56
commit e7e41f1e5c

View File

@ -39,14 +39,14 @@ void ScopeCheck()
} }
} }
static std::mutex mutex; static TracyLockable( std::mutex, mutex );
void Lock1() void Lock1()
{ {
for(;;) for(;;)
{ {
std::this_thread::sleep_for( std::chrono::milliseconds( 4 ) ); std::this_thread::sleep_for( std::chrono::milliseconds( 4 ) );
std::lock_guard<std::mutex> lock( mutex ); std::lock_guard<LockableBase( std::mutex )> lock( mutex );
ZoneScoped; ZoneScoped;
std::this_thread::sleep_for( std::chrono::milliseconds( 4 ) ); std::this_thread::sleep_for( std::chrono::milliseconds( 4 ) );
} }
@ -57,7 +57,7 @@ void Lock2()
for(;;) for(;;)
{ {
std::this_thread::sleep_for( std::chrono::milliseconds( 3 ) ); std::this_thread::sleep_for( std::chrono::milliseconds( 3 ) );
std::unique_lock<std::mutex> lock( mutex ); std::unique_lock<LockableBase( std::mutex )> lock( mutex );
ZoneScoped; ZoneScoped;
std::this_thread::sleep_for( std::chrono::milliseconds( 5 ) ); std::this_thread::sleep_for( std::chrono::milliseconds( 5 ) );
} }