8#ifndef PXR_ARCH_THREADS_H
9#define PXR_ARCH_THREADS_H
19#ifdef ARCH_COMPILER_MSVC
35#if defined(ARCH_CPU_INTEL)
36#if defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_CLANG)
37#define ARCH_SPIN_PAUSE() __builtin_ia32_pause()
38#elif defined(ARCH_COMPILER_MSVC)
39#define ARCH_SPIN_PAUSE() _mm_pause()
41#elif defined(ARCH_CPU_ARM)
42#if defined(ARCH_COMPILER_GCC) || defined(ARCH_COMPILER_CLANG)
43#define ARCH_SPIN_PAUSE() asm volatile ("yield" ::: "memory")
44#elif defined(ARCH_COMPILER_MSVC)
45#define ARCH_SPIN_PAUSE() __yield();
48#define ARCH_SPIN_PAUSE()
ARCH_API std::thread::id ArchGetMainThreadId()
Return the std::thread_id for the thread arch considers to be the "main" thread.
ARCH_API bool ArchIsMainThread()
Return true if the calling thread is the main thread, false otherwise.