mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
made the mm_pause instruction only available for intel32 and amd64 architectures. closes #1882
This commit is contained in:
parent
b6c2e2fd73
commit
87fa77441a
|
@ -44,6 +44,10 @@
|
|||
#error NOT IMPLEMENTED
|
||||
#endif
|
||||
|
||||
#if defined(CONF_ARCH_IA32) || defined(CONF_ARCH_AMD64)
|
||||
#include <immintrin.h> //_mm_pause
|
||||
#endif
|
||||
|
||||
#if defined(CONF_PLATFORM_SOLARIS)
|
||||
#include <sys/filio.h>
|
||||
#endif
|
||||
|
@ -504,6 +508,14 @@ void thread_detach(void *thread)
|
|||
#endif
|
||||
}
|
||||
|
||||
void cpu_relax()
|
||||
{
|
||||
#if defined(CONF_ARCH_IA32) || defined(CONF_ARCH_AMD64)
|
||||
_mm_pause();
|
||||
#else
|
||||
(void) 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -405,6 +405,12 @@ void thread_yield();
|
|||
*/
|
||||
void thread_detach(void *thread);
|
||||
|
||||
/*
|
||||
Function: cpu_relax
|
||||
Lets the cpu relax a bit.
|
||||
*/
|
||||
void cpu_relax();
|
||||
|
||||
/* Group: Locks */
|
||||
typedef void* LOCK;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
||||
#include <new>
|
||||
|
||||
#include <immintrin.h> //_mm_pause
|
||||
#include <stdlib.h> // qsort
|
||||
#include <stdarg.h>
|
||||
|
||||
|
@ -1776,7 +1775,7 @@ bool CClient::LimitFps()
|
|||
Now = time_get();
|
||||
RenderDeltaTime = (Now - LastT) / Freq;
|
||||
d = DesiredTime - RenderDeltaTime;
|
||||
_mm_pause();
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
SkipFrame = false;
|
||||
|
|
Loading…
Reference in a new issue