mirror of
https://github.com/gabime/spdlog.git
synced 2024-11-15 16:35:45 +08:00
Fix atomic level
This commit is contained in:
parent
31a7dc6e1e
commit
7d9cf59649
@ -26,17 +26,17 @@ struct null_atomic
|
||||
: value(new_value)
|
||||
{}
|
||||
|
||||
[[nodiscard]] T load(std::memory_order = std::memory_order_relaxed) const
|
||||
[[nodiscard]] T load(std::memory_order = std::memory_order_relaxed) const noexcept
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
void store(T new_value, std::memory_order = std::memory_order_relaxed)
|
||||
void store(T new_value, std::memory_order = std::memory_order_relaxed) noexcept
|
||||
{
|
||||
value = new_value;
|
||||
}
|
||||
|
||||
T exchange(T new_value, std::memory_order = std::memory_order_relaxed)
|
||||
T exchange(T new_value, std::memory_order = std::memory_order_relaxed) noexcept
|
||||
{
|
||||
std::swap(new_value, value);
|
||||
return new_value; // return value before the call
|
||||
|
Loading…
Reference in New Issue
Block a user