Thread safety for FanncyZonesData (#1281)

* FancyZones: make FancyZonesData thread-safe

* fixup: format affected sources

* fixup: clang-format case-style and format FancyZones.cpp

* fixup! add missing lock
This commit is contained in:
Andrey Nekrasov
2020-02-17 18:28:49 +03:00
committed by GitHub
parent cdf2f6b5b4
commit 1e6936a8c3
10 changed files with 1631 additions and 1533 deletions

View File

@@ -68,7 +68,7 @@ namespace FancyZonesUnitTests
GUID guid;
Assert::AreEqual(S_OK, CoCreateGuid(&guid));
return GuidString(guid);
return GuidString(guid);
}
TEST_METHOD_INITIALIZE(Init)
@@ -89,7 +89,7 @@ namespace FancyZonesUnitTests
Assert::IsFalse(std::filesystem::exists(ZoneWindowUtils::GetAppliedZoneSetTmpPath()));
Assert::IsFalse(std::filesystem::exists(ZoneWindowUtils::GetCustomZoneSetsTmpPath()));
m_fancyZonesData = JSONHelpers::FancyZonesData();
m_fancyZonesData.clear_data();
}
TEST_METHOD_CLEANUP(Cleanup)
@@ -622,7 +622,7 @@ namespace FancyZonesUnitTests
const auto processPath = get_process_path(window);
const auto deviceId = m_zoneWindow->UniqueId();
const auto zoneSetId = m_zoneWindow->ActiveZoneSet()->Id();
//fill app zone history map
Assert::IsTrue(m_fancyZonesData.SetAppLastZone(window, deviceId, GuidString(zoneSetId), 0));
Assert::AreEqual((size_t)1, m_fancyZonesData.GetAppZoneHistoryMap().size());