From 6b63436d415ee507bcc69abea5841491ac5dd3ea Mon Sep 17 00:00:00 2001 From: _Redstone_c_ Date: Fri, 22 Apr 2022 22:33:23 +0800 Subject: [PATCH] refactor(templates): remove TAtomic::IsLockFree function --- Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp | 2 -- Redcraft.Utility/Source/Public/Templates/Atomic.h | 3 --- 2 files changed, 5 deletions(-) diff --git a/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp b/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp index 1e3e474..6288480 100644 --- a/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp +++ b/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp @@ -1248,7 +1248,6 @@ void TestAtomic() TAtomic TempA; always_check(TempA.bIsAlwaysLockFree); - always_check(TempA.IsLockFree()); always_check((TempA = 11) == 11); TempA.Store(12); always_check(TempA.Load() == 12); @@ -1291,7 +1290,6 @@ void TestAtomic() TAtomicRef TempA(A); always_check(TempA.bIsAlwaysLockFree); - always_check(TempA.IsLockFree()); always_check((TempA = 11) == 11); TempA.Store(12); always_check(TempA.Load() == 12); diff --git a/Redcraft.Utility/Source/Public/Templates/Atomic.h b/Redcraft.Utility/Source/Public/Templates/Atomic.h index 832ed2a..18a71cb 100644 --- a/Redcraft.Utility/Source/Public/Templates/Atomic.h +++ b/Redcraft.Utility/Source/Public/Templates/Atomic.h @@ -77,9 +77,6 @@ public: FORCEINLINE ValueType operator=(ValueType Desired) { return Element = Desired; } FORCEINLINE ValueType operator=(ValueType Desired) volatile requires bIsAlwaysLockFree { return Element = Desired; } - FORCEINLINE bool IsLockFree() const { return Element.is_lock_free(); } - FORCEINLINE bool IsLockFree() const volatile { return Element.is_lock_free(); } - FORCEINLINE void Store(ValueType Desired, EMemoryOrder Order = EMemoryOrder::SequentiallyConsistent) { MEMORY_ORDER_CHECK(Order, 0x01 | 0x08 | 0x20); Element.store(Desired, static_cast(Order)); } FORCEINLINE void Store(ValueType Desired, EMemoryOrder Order = EMemoryOrder::SequentiallyConsistent) volatile requires bIsAlwaysLockFree { MEMORY_ORDER_CHECK(Order, 0x01 | 0x08 | 0x20); Element.store(Desired, static_cast(Order)); }