From fb63e4fefbb1325a21f643febc97987c82fcae7a Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 12 Jul 2013 00:03:32 -0400 Subject: runtime: make cas64 like cas32 and casp The current cas64 definition hard-codes the x86 behavior of updating *old with the new value when the cas fails. This is inconsistent with cas32 and casp. Make it consistent. This means that the cas64 uses will be epsilon less efficient than they might be, because they have to do an unnecessary memory load on x86. But so be it. Code clarity and consistency is more important. R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/10909045 --- src/pkg/runtime/runtime.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/pkg/runtime/runtime.h') diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h index 6c590be633..49503ab41b 100644 --- a/src/pkg/runtime/runtime.h +++ b/src/pkg/runtime/runtime.h @@ -761,7 +761,7 @@ int32 runtime·write(int32, void*, int32); int32 runtime·close(int32); int32 runtime·mincore(void*, uintptr, byte*); bool runtime·cas(uint32*, uint32, uint32); -bool runtime·cas64(uint64*, uint64*, uint64); +bool runtime·cas64(uint64*, uint64, uint64); bool runtime·casp(void**, void*, void*); // Don't confuse with XADD x86 instruction, // this one is actually 'addx', that is, add-and-fetch. -- cgit v1.3