mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 06:34:36 +00:00
Check for shared mutex availability.
This commit is contained in:
parent
ef4c690c32
commit
ce15ad763f
@ -1,7 +1,6 @@
|
||||
#include <chrono>
|
||||
#include <mutex>
|
||||
#include <thread>
|
||||
#include <shared_mutex>
|
||||
#include <stdlib.h>
|
||||
#include "../Tracy.hpp"
|
||||
#include "../common/TracySystem.hpp"
|
||||
@ -185,6 +184,10 @@ void DepthTest()
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __cpp_lib_shared_mutex
|
||||
|
||||
#include <shared_mutex>
|
||||
|
||||
static TracySharedLockable( std::shared_mutex, sharedMutex );
|
||||
|
||||
void SharedRead1()
|
||||
@ -231,6 +234,8 @@ void SharedWrite2()
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void CaptureCallstack()
|
||||
{
|
||||
ZoneScopedS( 10 );
|
||||
@ -286,11 +291,13 @@ int main()
|
||||
auto t11 = std::thread( DepthTest );
|
||||
auto t12 = std::thread( RecLock );
|
||||
auto t13 = std::thread( RecLock );
|
||||
#ifdef __cpp_lib_shared_mutex
|
||||
auto t14 = std::thread( SharedRead1 );
|
||||
auto t15 = std::thread( SharedRead1 );
|
||||
auto t16 = std::thread( SharedRead2 );
|
||||
auto t17 = std::thread( SharedWrite1 );
|
||||
auto t18 = std::thread( SharedWrite2 );
|
||||
#endif
|
||||
auto t19 = std::thread( CallstackTime );
|
||||
auto t20 = std::thread( OnlyMemory );
|
||||
auto t21 = std::thread( DeadlockTest1 );
|
||||
|
Loading…
Reference in New Issue
Block a user