mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Use shared lockable wrappers in test.
This commit is contained in:
parent
782231b048
commit
06fcb24440
@ -139,14 +139,14 @@ void DepthTest()
|
||||
}
|
||||
}
|
||||
|
||||
static std::shared_mutex sharedMutex;
|
||||
static TracySharedLockable( std::shared_mutex, sharedMutex );
|
||||
|
||||
void SharedRead()
|
||||
{
|
||||
for(;;)
|
||||
{
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) );
|
||||
std::shared_lock<std::shared_mutex> lock( sharedMutex );
|
||||
std::shared_lock<SharedLockableBase( std::shared_mutex )> lock( sharedMutex );
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 4 ) );
|
||||
}
|
||||
}
|
||||
@ -156,7 +156,7 @@ void SharedWrite()
|
||||
for(;;)
|
||||
{
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 4 ) );
|
||||
std::unique_lock<std::shared_mutex> lock( sharedMutex );
|
||||
std::unique_lock<SharedLockableBase( std::shared_mutex )> lock( sharedMutex );
|
||||
std::this_thread::sleep_for( std::chrono::milliseconds( 1 ) );
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user