1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Move common lock helper functions to a separate header.

This commit is contained in:
Bartosz Taudul
2023-04-08 18:43:36 +02:00
parent 4c0e6fe3ca
commit 6e815d13a0
2 changed files with 29 additions and 15 deletions
+28
View File
@@ -0,0 +1,28 @@
#ifndef __TRACYLOCKHELPERS_HPP__
#define __TRACYLOCKHELPERS_HPP__
#include <stdint.h>
#include "../public/common/TracyForceInline.hpp"
namespace tracy
{
static tracy_force_inline uint64_t GetThreadBit( uint8_t thread )
{
return uint64_t( 1 ) << thread;
}
static tracy_force_inline bool IsThreadWaiting( uint64_t bitlist, uint64_t threadBit )
{
return ( bitlist & threadBit ) != 0;
}
static tracy_force_inline bool AreOtherWaiting( uint64_t bitlist, uint64_t threadBit )
{
return ( bitlist & ~threadBit ) != 0;
}
}
#endif