]> git.ipfire.org Git - thirdparty/gcc.git/blob - libgo/go/sync/atomic/64bit_linux_arm.go
libgo: Update to current sources.
[thirdparty/gcc.git] / libgo / go / sync / atomic / 64bit_linux_arm.go
1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 package atomic
6
7 func loadUint64(addr *uint64) (val uint64) {
8 for {
9 val = *addr
10 if CompareAndSwapUint64(addr, val, val) {
11 break
12 }
13 }
14 return
15 }
16
17 func storeUint64(addr *uint64, val uint64) {
18 for {
19 old := *addr
20 if CompareAndSwapUint64(addr, old, val) {
21 break
22 }
23 }
24 return
25 }
26
27 func addUint64(val *uint64, delta uint64) (new uint64) {
28 for {
29 old := *val
30 new = old + delta
31 if CompareAndSwapUint64(val, old, new) {
32 break
33 }
34 }
35 return
36 }