1
2
3
4
5 package atomic
6
7 import "unsafe"
8
9
10
11
12
13
14
15
16 func Load(ptr *uint32) uint32 {
17 return *ptr
18 }
19
20
21
22 func Loadp(ptr unsafe.Pointer) unsafe.Pointer {
23 return *(*unsafe.Pointer)(ptr)
24 }
25
26
27
28 func Load64(ptr *uint64) uint64 {
29 return *ptr
30 }
31
32
33
34 func LoadAcq(ptr *uint32) uint32 {
35 return *ptr
36 }
37
38
39
40 func LoadAcq64(ptr *uint64) uint64 {
41 return *ptr
42 }
43
44
45
46 func LoadAcquintptr(ptr *uintptr) uintptr {
47 return *ptr
48 }
49
50
51 func Xadd(ptr *uint32, delta int32) uint32
52
53
54 func Xadd64(ptr *uint64, delta int64) uint64
55
56
57 func Xadduintptr(ptr *uintptr, delta uintptr) uintptr
58
59
60 func Xchg(ptr *uint32, new uint32) uint32
61
62
63 func Xchg64(ptr *uint64, new uint64) uint64
64
65
66 func Xchguintptr(ptr *uintptr, new uintptr) uintptr
67
68
69
70 func Load8(ptr *uint8) uint8 {
71 return *ptr
72 }
73
74
75 func And8(ptr *uint8, val uint8)
76
77
78 func Or8(ptr *uint8, val uint8)
79
80
81 func And(ptr *uint32, val uint32)
82
83
84 func Or(ptr *uint32, val uint32)
85
86
87
88
89 func Cas64(ptr *uint64, old, new uint64) bool
90
91
92 func CasRel(ptr *uint32, old, new uint32) bool
93
94
95 func Store(ptr *uint32, val uint32)
96
97
98 func Store8(ptr *uint8, val uint8)
99
100
101 func Store64(ptr *uint64, val uint64)
102
103
104 func StoreRel(ptr *uint32, val uint32)
105
106
107 func StoreRel64(ptr *uint64, val uint64)
108
109
110 func StoreReluintptr(ptr *uintptr, val uintptr)
111
112
113
114
115
116 func StorepNoWB(ptr unsafe.Pointer, val unsafe.Pointer)
117
View as plain text