mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 15:05:23 +00:00
Use __declspec( thread ) for thread local storage when compiling with Visual Studio 2015 and higher
This commit is contained in:
@@ -67,6 +67,8 @@
|
|||||||
static thread_local isc_once_t isc_random_once = ISC_ONCE_INIT;
|
static thread_local isc_once_t isc_random_once = ISC_ONCE_INIT;
|
||||||
#elif defined(HAVE___THREAD)
|
#elif defined(HAVE___THREAD)
|
||||||
static __thread isc_once_t isc_random_once = ISC_ONCE_INIT;
|
static __thread isc_once_t isc_random_once = ISC_ONCE_INIT;
|
||||||
|
#elif defined(HAVE___DECLSPEC_THREAD)
|
||||||
|
static __declspec( thread ) isc_once_t isc_random_once = ISC_ONCE_INIT;
|
||||||
#else
|
#else
|
||||||
#error "Unknown method for defining a TLS variable!"
|
#error "Unknown method for defining a TLS variable!"
|
||||||
#endif
|
#endif
|
||||||
|
@@ -16,6 +16,11 @@
|
|||||||
***** Platform-dependent defines.
|
***** Platform-dependent defines.
|
||||||
*****/
|
*****/
|
||||||
|
|
||||||
|
#if _MSC_VER > 1400
|
||||||
|
#define HAVE_TLS 1
|
||||||
|
#define HAVE___DECLSPEC_THREAD 1
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Some compatibility cludges
|
* Some compatibility cludges
|
||||||
*/
|
*/
|
||||||
|
@@ -42,6 +42,8 @@
|
|||||||
static thread_local uint32_t seed[4];
|
static thread_local uint32_t seed[4];
|
||||||
#elif defined(HAVE___THREAD)
|
#elif defined(HAVE___THREAD)
|
||||||
static __thread uint32_t seed[4];
|
static __thread uint32_t seed[4];
|
||||||
|
#elif defined(HAVE___DECLSPEC_THREAD)
|
||||||
|
static __declspec( thread ) uint32_t seed[4];
|
||||||
#else
|
#else
|
||||||
#error "Unknown method for defining a TLS variable!"
|
#error "Unknown method for defining a TLS variable!"
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user