mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-01 09:59:06 +08:00
Removed the race condition (#4735)
This commit is contained in:
parent
ce60bcedb0
commit
282e0adfe2
@ -9,13 +9,7 @@
|
||||
template<uint16_t APIVersion>
|
||||
bool IsAPIContractVxAvailable()
|
||||
{
|
||||
static bool isAPIContractVxAvailableInitialized = false;
|
||||
static bool isAPIContractVxAvailable = false;
|
||||
if (!isAPIContractVxAvailableInitialized)
|
||||
{
|
||||
isAPIContractVxAvailableInitialized = true;
|
||||
isAPIContractVxAvailable = winrt::Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", APIVersion);
|
||||
}
|
||||
static bool isAPIContractVxAvailable = winrt::Windows::Foundation::Metadata::ApiInformation::IsApiContractPresent(L"Windows.Foundation.UniversalApiContract", APIVersion);
|
||||
|
||||
return isAPIContractVxAvailable;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user