FAQ
Reviewers: golang-dev_googlegroups.com,

Message:
Hello golang-dev@googlegroups.com,

I'd like you to review this change to
https://dvyukov%40google.com@code.google.com/p/go/


Description:
sync/atomic: fix race instrumentation

Please review this at http://codereview.appspot.com/6782075/

Affected files:
M src/pkg/sync/atomic/race.go


Index: src/pkg/sync/atomic/race.go
===================================================================
--- a/src/pkg/sync/atomic/race.go
+++ b/src/pkg/sync/atomic/race.go
@@ -165,7 +165,7 @@

func LoadUintptr(addr *uintptr) (val uintptr) {
runtime.RaceSemacquire(&mtx)
- runtime.RaceRead(unsafe.Pointer(val))
+ runtime.RaceRead(unsafe.Pointer(addr))
runtime.RaceAcquire(unsafe.Pointer(addr))
val = *addr
runtime.RaceSemrelease(&mtx)
@@ -198,7 +198,7 @@

func StorePointer(addr *unsafe.Pointer, val unsafe.Pointer) {
runtime.RaceSemacquire(&mtx)
- runtime.RaceRead(unsafe.Pointer(val))
+ runtime.RaceRead(unsafe.Pointer(addr))
*addr = val
runtime.RaceRelease(unsafe.Pointer(addr))
runtime.RaceSemrelease(&mtx)
@@ -206,7 +206,7 @@

func StoreUintptr(addr *uintptr, val uintptr) {
runtime.RaceSemacquire(&mtx)
- runtime.RaceRead(unsafe.Pointer(val))
+ runtime.RaceRead(unsafe.Pointer(addr))
*addr = val
runtime.RaceRelease(unsafe.Pointer(addr))
runtime.RaceSemrelease(&mtx)

Search Discussions

  • Ian Lance Taylor at Nov 15, 2012 at 5:22 pm
    LGTM
    On Thu, Nov 15, 2012 at 3:58 AM, wrote:
    Reviewers: golang-dev_googlegroups.com,

    Message:
    Hello golang-dev@googlegroups.com,

    I'd like you to review this change to
    https://dvyukov%40google.com@code.google.com/p/go/


    Description:
    sync/atomic: fix race instrumentation

    Please review this at http://codereview.appspot.com/6782075/

    Affected files:
    M src/pkg/sync/atomic/race.go


    Index: src/pkg/sync/atomic/race.go
    ===================================================================
    --- a/src/pkg/sync/atomic/race.go
    +++ b/src/pkg/sync/atomic/race.go
    @@ -165,7 +165,7 @@

    func LoadUintptr(addr *uintptr) (val uintptr) {
    runtime.RaceSemacquire(&mtx)
    - runtime.RaceRead(unsafe.Pointer(val))
    + runtime.RaceRead(unsafe.Pointer(addr))
    runtime.RaceAcquire(unsafe.Pointer(addr))
    val = *addr
    runtime.RaceSemrelease(&mtx)
    @@ -198,7 +198,7 @@

    func StorePointer(addr *unsafe.Pointer, val unsafe.Pointer) {
    runtime.RaceSemacquire(&mtx)
    - runtime.RaceRead(unsafe.Pointer(val))
    + runtime.RaceRead(unsafe.Pointer(addr))
    *addr = val
    runtime.RaceRelease(unsafe.Pointer(addr))
    runtime.RaceSemrelease(&mtx)
    @@ -206,7 +206,7 @@

    func StoreUintptr(addr *uintptr, val uintptr) {
    runtime.RaceSemacquire(&mtx)
    - runtime.RaceRead(unsafe.Pointer(val))
    + runtime.RaceRead(unsafe.Pointer(addr))
    *addr = val
    runtime.RaceRelease(unsafe.Pointer(addr))
    runtime.RaceSemrelease(&mtx)
  • Dvyukov at Nov 15, 2012 at 5:30 pm

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedNov 15, '12 at 11:58a
activeNov 15, '12 at 5:30p
posts3
users2
websitegolang.org

2 users in discussion

Dvyukov: 2 posts Ian Lance Taylor: 1 post

People

Translate

site design / logo © 2022 Grokbase