mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-12 22:17:11 -04:00
Improve std::atomic interface
This commit is contained in:
parent
552ed92da3
commit
56fd5773fd
@ -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);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user