mirror of
https://github.com/wolfpld/tracy
synced 2025-04-29 12:23:53 +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()
|
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 ) );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user