mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Use lockable wrapper in test program.
This commit is contained in:
parent
a3ef369a56
commit
e7e41f1e5c
@ -39,14 +39,14 @@ void ScopeCheck()
|
||||
}
|
||||
}
|
||||
|
||||
static std::mutex mutex;
|
||||
static TracyLockable( std::mutex, mutex );
|
||||
|
||||
void Lock1()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
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;
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 4 ) );
|
||||
}
|
||||
@ -57,7 +57,7 @@ void Lock2()
|
||||
for(;;)
|
||||
{
|
||||
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;
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 5 ) );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user