Nugget
atomic_flag_standalone.h
1 // Copyright (c) Electronic Arts Inc. All rights reserved.
4 
5 
6 #ifndef EASTL_ATOMIC_INTERNAL_FLAG_STANDALONE_H
7 #define EASTL_ATOMIC_INTERNAL_FLAG_STANDALONE_H
8 
9 #if defined(EA_PRAGMA_ONCE_SUPPORTED)
10  #pragma once
11 #endif
12 
13 
14 namespace eastl
15 {
16 
17 
19 //
20 // bool atomic_flag_test_and_set(eastl::atomic<T>*)
21 //
22 EASTL_FORCE_INLINE bool atomic_flag_test_and_set(eastl::atomic_flag* atomicObj) EA_NOEXCEPT
23 {
24  return atomicObj->test_and_set();
25 }
26 
27 template <typename Order>
28 EASTL_FORCE_INLINE bool atomic_flag_test_and_set_explicit(eastl::atomic_flag* atomicObj, Order order)
29 {
30  return atomicObj->test_and_set(order);
31 }
32 
33 
35 //
36 // bool atomic_flag_clear(eastl::atomic<T>*)
37 //
38 EASTL_FORCE_INLINE void atomic_flag_clear(eastl::atomic_flag* atomicObj)
39 {
40  atomicObj->clear();
41 }
42 
43 template <typename Order>
44 EASTL_FORCE_INLINE void atomic_flag_clear_explicit(eastl::atomic_flag* atomicObj, Order order)
45 {
46  atomicObj->clear(order);
47 }
48 
49 
51 //
52 // bool atomic_flag_test(eastl::atomic<T>*)
53 //
54 EASTL_FORCE_INLINE bool atomic_flag_test(eastl::atomic_flag* atomicObj)
55 {
56  return atomicObj->test();
57 }
58 
59 template <typename Order>
60 EASTL_FORCE_INLINE bool atomic_flag_test_explicit(eastl::atomic_flag* atomicObj, Order order)
61 {
62  return atomicObj->test(order);
63 }
64 
65 
66 } // namespace eastl
67 
68 
69 #endif /* EASTL_ATOMIC_INTERNAL_FLAG_STANDALONE_H */
Definition: atomic_flag.h:22
EA Standard Template Library.
Definition: algorithm.h:288