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