This commit is contained in:
Nekotekina
2016-05-13 17:01:48 +03:00
parent e2d82394f6
commit 266db1336d
81 changed files with 2247 additions and 1731 deletions
+9 -8
View File
@@ -1,6 +1,7 @@
#pragma once
#include "types.h"
#include "Platform.h"
// Helper class, provides access to compiler-specific atomic intrinsics
template<typename T, std::size_t Size>
@@ -744,9 +745,9 @@ public:
while (true)
{
func(_new = old, args...);
func((_new = old), args...);
if (atomic_storage<type>::compare_exchange(m_data, old, _new)) return old;
if (LIKELY(atomic_storage<type>::compare_exchange(m_data, old, _new))) return old;
}
}
@@ -765,9 +766,9 @@ public:
while (true)
{
func(_new = old, args...);
func((_new = old), args...);
if (atomic_storage<type>::compare_exchange(m_data, old, _new)) return _new;
if (LIKELY(atomic_storage<type>::compare_exchange(m_data, old, _new))) return _new;
}
}
@@ -786,9 +787,9 @@ public:
while (true)
{
RT&& result = func(_new = old, args...);
RT&& result = func((_new = old), args...);
if (atomic_storage<type>::compare_exchange(m_data, old, _new)) return std::move(result);
if (LIKELY(atomic_storage<type>::compare_exchange(m_data, old, _new))) return std::move(result);
}
}
@@ -800,9 +801,9 @@ public:
while (true)
{
func(_new = old, args...);
func((_new = old), args...);
if (atomic_storage<type>::compare_exchange(m_data, old, _new)) return;
if (LIKELY(atomic_storage<type>::compare_exchange(m_data, old, _new))) return;
}
}