mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-22 14:44:34 +00:00
Move common lock helper functions to a separate header.
This commit is contained in:
parent
4c0e6fe3ca
commit
6e815d13a0
28
server/TracyLockHelpers.hpp
Normal file
28
server/TracyLockHelpers.hpp
Normal 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
|
@ -3,6 +3,7 @@
|
||||
#include "TracyColor.hpp"
|
||||
#include "TracyFilesystem.hpp"
|
||||
#include "TracyImGui.hpp"
|
||||
#include "TracyLockHelpers.hpp"
|
||||
#include "TracyMouse.hpp"
|
||||
#include "TracyPrint.hpp"
|
||||
#include "TracyView.hpp"
|
||||
@ -12,21 +13,6 @@ namespace tracy
|
||||
|
||||
constexpr float MinVisSize = 3;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
enum class LockState
|
||||
{
|
||||
Nothing,
|
||||
|
Loading…
Reference in New Issue
Block a user