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