Update null_mutex.h

Using std::exchange for null_atomic_int::exchange
pull/1752/head
Fei Chong 5 years ago committed by GitHub
parent 233e97c5e4
commit 16195ec34a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -40,8 +40,7 @@ struct null_atomic_int
int exchange(int new_value, std::memory_order = std::memory_order_relaxed)
{
std::swap(new_value, value);
return new_value; // return value before the call
return std::exchange(new_value, value);
}
};

Loading…
Cancel
Save