mirror of
https://github.com/slendidev/lunar.git
synced 2026-01-31 00:38:59 +02:00
28
subprojects/tracy/public/common/TracyYield.hpp
Normal file
28
subprojects/tracy/public/common/TracyYield.hpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef __TRACYYIELD_HPP__
|
||||
#define __TRACYYIELD_HPP__
|
||||
|
||||
#if defined __SSE2__ || defined _M_AMD64 || (defined _M_IX86_FP && _M_IX86_FP == 2)
|
||||
# include <emmintrin.h>
|
||||
#else
|
||||
# include <thread>
|
||||
#endif
|
||||
|
||||
#include "TracyForceInline.hpp"
|
||||
|
||||
namespace tracy
|
||||
{
|
||||
|
||||
static tracy_force_inline void YieldThread()
|
||||
{
|
||||
#if defined __SSE2__ || defined _M_AMD64 || (defined _M_IX86_FP && _M_IX86_FP == 2)
|
||||
_mm_pause();
|
||||
#elif defined __aarch64__
|
||||
asm volatile( "isb" : : );
|
||||
#else
|
||||
std::this_thread::yield();
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user