diff options
author | Jack Lloyd <[email protected]> | 2019-09-23 23:03:43 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-09-23 23:03:43 -0400 |
commit | c324794f47c1058708946c4416d154c7a5ff9e08 (patch) | |
tree | f529fcf26fa5586276b4da8e1f7ae98e362ff6e9 /src/lib/utils/cpuid | |
parent | efecb6578b695d50a25e0aa4fc004e6be30c7ff4 (diff) |
Add a RWLock
Diffstat (limited to 'src/lib/utils/cpuid')
-rw-r--r-- | src/lib/utils/cpuid/cpuid.cpp | 7 | ||||
-rw-r--r-- | src/lib/utils/cpuid/cpuid.h | 6 |
2 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/utils/cpuid/cpuid.cpp b/src/lib/utils/cpuid/cpuid.cpp index 18ccff419..81fabf0a3 100644 --- a/src/lib/utils/cpuid/cpuid.cpp +++ b/src/lib/utils/cpuid/cpuid.cpp @@ -13,13 +13,6 @@ namespace Botan { -//static -CPUID::CPUID_Data& CPUID::state() - { - static BOTAN_THREAD_LOCAL CPUID::CPUID_Data g_cpuid; - return g_cpuid; - } - bool CPUID::has_simd_32() { #if defined(BOTAN_TARGET_SUPPORTS_SSE2) diff --git a/src/lib/utils/cpuid/cpuid.h b/src/lib/utils/cpuid/cpuid.h index bd8c8d95f..7b6b8ebc3 100644 --- a/src/lib/utils/cpuid/cpuid.h +++ b/src/lib/utils/cpuid/cpuid.h @@ -401,7 +401,11 @@ class BOTAN_PUBLIC_API(2,1) CPUID final Endian_Status m_endian_status; }; - static CPUID_Data& state(); + static CPUID_Data& state() + { + static CPUID::CPUID_Data g_cpuid; + return g_cpuid; + } }; } |