Improve std::atomic interface

This commit is contained in:
Baptiste Wicht 2016-09-14 20:41:51 +02:00
parent 552ed92da3
commit 56fd5773fd

View File

@ -24,6 +24,8 @@ struct atomic<bool> {
atomic(const atomic& rhs) = delete;
atomic& operator=(const atomic& rhs) = delete;
explicit atomic(value_type value) : value(value) {}
value_type load() const {
return __atomic_load_n(&value, __ATOMIC_CONSUME);
}
@ -47,6 +49,8 @@ struct atomic<uint64_t> {
atomic(const atomic& rhs) = delete;
atomic& operator=(const atomic& rhs) = delete;
explicit atomic(value_type value) : value(value) {}
value_type load() const {
return __atomic_load_n(&value, __ATOMIC_CONSUME);
}