OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #ifndef SRC_SHARED_ATOMIC_CPP11_H_ | 5 #ifndef SRC_SHARED_ATOMIC_CPP11_H_ |
6 #define SRC_SHARED_ATOMIC_CPP11_H_ | 6 #define SRC_SHARED_ATOMIC_CPP11_H_ |
7 | 7 |
8 #ifndef SRC_SHARED_ATOMIC_H_ | 8 #ifndef SRC_SHARED_ATOMIC_H_ |
9 #error Do not include atomic_cpp11.h directly; use atomic.h instead. | 9 #error Do not include atomic_cpp11.h directly; use atomic.h instead. |
10 #endif | 10 #endif |
11 | 11 |
12 #include <atomic> | 12 #include <atomic> |
13 | 13 |
14 namespace fletch { | 14 namespace dartino { |
15 | 15 |
16 template <typename T> | 16 template <typename T> |
17 using Atomic = std::atomic<T>; | 17 using Atomic = std::atomic<T>; |
18 | 18 |
19 static const std::memory_order kRelaxed = std::memory_order_relaxed; | 19 static const std::memory_order kRelaxed = std::memory_order_relaxed; |
20 static const std::memory_order kConsume = std::memory_order_consume; | 20 static const std::memory_order kConsume = std::memory_order_consume; |
21 static const std::memory_order kAcquire = std::memory_order_acquire; | 21 static const std::memory_order kAcquire = std::memory_order_acquire; |
22 static const std::memory_order kRelease = std::memory_order_release; | 22 static const std::memory_order kRelease = std::memory_order_release; |
23 static const std::memory_order kAcqRel = std::memory_order_acq_rel; | 23 static const std::memory_order kAcqRel = std::memory_order_acq_rel; |
24 static const std::memory_order kSeqCst = std::memory_order_seq_cst; | 24 static const std::memory_order kSeqCst = std::memory_order_seq_cst; |
25 | 25 |
26 } // namespace fletch | 26 } // namespace dartino |
27 | 27 |
28 #endif // SRC_SHARED_ATOMIC_CPP11_H_ | 28 #endif // SRC_SHARED_ATOMIC_CPP11_H_ |
OLD | NEW |