aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/runtime.c
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2013-03-05 09:46:52 +0200
committerDmitriy Vyukov <dvyukov@google.com>2013-03-05 09:46:52 +0200
commitadd334986778a09dce559f4d8b7ee69534abd47d (patch)
tree9a34043cf6fc15ca93a904ca2dae23099f7ac310 /src/pkg/runtime/runtime.c
parent2fe840f4f69bb1013ff5ae8968d8ab8257fb2d22 (diff)
downloadgo-add334986778a09dce559f4d8b7ee69534abd47d.tar.xz
runtime: add atomic xchg64
It will be handy for network poller. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7429048
Diffstat (limited to 'src/pkg/runtime/runtime.c')
-rw-r--r--src/pkg/runtime/runtime.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c
index 4d57cbafdf..d3ee2a0ec9 100644
--- a/src/pkg/runtime/runtime.c
+++ b/src/pkg/runtime/runtime.c
@@ -156,6 +156,10 @@ TestAtomic64(void)
runtime·throw("xadd64 failed");
if(runtime·atomicload64(&z64) != (2ull<<40)+2)
runtime·throw("xadd64 failed");
+ if(runtime·xchg64(&z64, (3ull<<40)+3) != (2ull<<40)+2)
+ runtime·throw("xchg64 failed");
+ if(runtime·atomicload64(&z64) != (3ull<<40)+3)
+ runtime·throw("xchg64 failed");
}
void