mirror of https://github.com/PCSX2/pcsx2.git
common: Replace __threadlocal with C++11 thread_local
This commit is contained in:
parent
3b97137ccf
commit
11aebe465f
|
@ -112,3 +112,4 @@ oprofile_data/
|
||||||
/tools/bin
|
/tools/bin
|
||||||
/tools/GSDumpGUI/bin
|
/tools/GSDumpGUI/bin
|
||||||
/tools/GSDumpGUI/obj
|
/tools/GSDumpGUI/obj
|
||||||
|
/.vs
|
||||||
|
|
|
@ -168,7 +168,6 @@ static const int __pagesize = PCSX2_PAGESIZE;
|
||||||
#define PCSX2_ALIGNED16_EXTERN(x) extern __declspec(align(16)) x
|
#define PCSX2_ALIGNED16_EXTERN(x) extern __declspec(align(16)) x
|
||||||
|
|
||||||
#define __noinline __declspec(noinline)
|
#define __noinline __declspec(noinline)
|
||||||
#define __threadlocal __declspec(thread)
|
|
||||||
|
|
||||||
// Don't know if there are Visual C++ equivalents of these.
|
// Don't know if there are Visual C++ equivalents of these.
|
||||||
#define likely(x) (!!(x))
|
#define likely(x) (!!(x))
|
||||||
|
@ -216,7 +215,6 @@ static const int __pagesize = PCSX2_PAGESIZE;
|
||||||
#ifndef __noinline
|
#ifndef __noinline
|
||||||
#define __noinline __attribute__((noinline))
|
#define __noinline __attribute__((noinline))
|
||||||
#endif
|
#endif
|
||||||
#define __threadlocal __thread
|
|
||||||
#define likely(x) __builtin_expect(!!(x), 1)
|
#define likely(x) __builtin_expect(!!(x), 1)
|
||||||
#define unlikely(x) __builtin_expect(!!(x), 0)
|
#define unlikely(x) __builtin_expect(!!(x), 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#include "Threading.h"
|
#include "Threading.h"
|
||||||
|
|
||||||
#if PCSX2_THREAD_LOCAL
|
#if PCSX2_THREAD_LOCAL
|
||||||
#define DeclareTls(x) __threadlocal x
|
#define DeclareTls(x) thread_local x
|
||||||
#else
|
#else
|
||||||
#define DeclareTls(x) Threading::TlsVariable<x>
|
#define DeclareTls(x) Threading::TlsVariable<x>
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -53,7 +53,7 @@ enum XMMSSEType {
|
||||||
|
|
||||||
#ifndef __tls_emit
|
#ifndef __tls_emit
|
||||||
#if x86EMIT_MULTITHREADED
|
#if x86EMIT_MULTITHREADED
|
||||||
#define __tls_emit __threadlocal
|
#define __tls_emit thread_local
|
||||||
#else
|
#else
|
||||||
// Using TlsVariable is sub-optimal and could result in huge executables, so we
|
// Using TlsVariable is sub-optimal and could result in huge executables, so we
|
||||||
// force-disable TLS entirely, and disallow running multithreaded recompilation
|
// force-disable TLS entirely, and disallow running multithreaded recompilation
|
||||||
|
|
|
@ -678,7 +678,7 @@ wxAppWithHelpers::wxAppWithHelpers()
|
||||||
// FS segment register won't have been initialized by the main exe, due to tls_insurance
|
// FS segment register won't have been initialized by the main exe, due to tls_insurance
|
||||||
// being optimized away >_< --air
|
// being optimized away >_< --air
|
||||||
|
|
||||||
static __threadlocal int tls_insurance = 0;
|
static thread_local int tls_insurance = 0;
|
||||||
tls_insurance = 1;
|
tls_insurance = 1;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue