From 0c235990237934d10c5cbfcf47068e706c7c8d92 Mon Sep 17 00:00:00 2001 From: AzaezelX Date: Mon, 19 Jul 2021 09:58:14 -0500 Subject: [PATCH] adress #501 - thread oversight. as discussed in the followup conversation to #500, seems like there's been a bit of command-drift since the writeup we were referencing to attempt consistentcy, so back to treating mac and nix differently on this front, looks like --- Engine/lib/convexDecomp/NvThreadConfig.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Engine/lib/convexDecomp/NvThreadConfig.cpp b/Engine/lib/convexDecomp/NvThreadConfig.cpp index 0cb6d75a8..607b791f9 100644 --- a/Engine/lib/convexDecomp/NvThreadConfig.cpp +++ b/Engine/lib/convexDecomp/NvThreadConfig.cpp @@ -133,9 +133,15 @@ void tc_spinloop() // Pause would do nothing on the Xbox. Threads are not scheduled. #elif defined( _WIN64 ) YieldProcessor( ); -#elif defined( __APPLE__ )||(__linux__) +#elif defined( __APPLE__ ) pthread_yield_np(); -#else +#elif defined(__linux__) + #if defined(_POSIX_PRIORITY_SCHEDULING) + sched_yield(); + #else + asm("pause"); + #endif +#elif __asm { pause }; #endif }