Side by Side Diff: src/pkg/sync/atomic/64bit_linux_arm.go
Issue 6490119 :
all: FreeBSD/ARM w/ cgo port (Closed)
Patch Set: diff -r cfa9208b98fc http://go.googlecode.com/hg/
Use n/p to move between diff chunks;
N/P to move between comments.
Please Sign in to add in-line comments.
Jump to:
.hgignore
src/make.bash
src/pkg/go/build/build.go
src/pkg/runtime/cgo/gcc_freebsd_arm.c
src/pkg/sync/atomic/64bit_arm.go
src/pkg/sync/atomic/64bit_linux_arm.go
src/pkg/sync/atomic/asm_freebsd_arm.s
test/run
test/testlib
OLD NEW
(Empty) 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 }
OLD NEW