flatten 20260225
This commit is contained in:
30
tjp/core/threads/micropause.hpp
Executable file
30
tjp/core/threads/micropause.hpp
Executable file
@@ -0,0 +1,30 @@
|
||||
// License: Modified MIT (NON-AI)
|
||||
// See the LICENSE file in the root directory for license information.
|
||||
// Copyright 2025 Timothy Prepscius
|
||||
|
||||
#pragma once
|
||||
|
||||
#if defined(__aarch64__)
|
||||
|
||||
#elif defined(__x86_64__)
|
||||
#include <immintrin.h>
|
||||
#else
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
namespace tjp::core {
|
||||
|
||||
inline
|
||||
void micropause()
|
||||
{
|
||||
#if defined(__aarch64__)
|
||||
__builtin_arm_yield();
|
||||
#elif defined(__x86_64__)
|
||||
_mm_pause();
|
||||
#else
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user