diff options
author | Ian Lance Taylor <iant@google.com> | 2016-02-03 21:58:02 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2016-02-03 21:58:02 +0000 |
commit | f98dd1a338867a408f7c72d73fbad7fe7fc93e3a (patch) | |
tree | 2f8da9862a9c1fe0df138917f997b03439c02773 /libgo/go/sync/cond.go | |
parent | b081ed4efc144da0c45a6484aebfd10e0eb9fda3 (diff) | |
download | gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.zip gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.tar.gz gcc-f98dd1a338867a408f7c72d73fbad7fe7fc93e3a.tar.bz2 |
libgo: Update to go1.6rc1.
Reviewed-on: https://go-review.googlesource.com/19200
From-SVN: r233110
Diffstat (limited to 'libgo/go/sync/cond.go')
-rw-r--r-- | libgo/go/sync/cond.go | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libgo/go/sync/cond.go b/libgo/go/sync/cond.go index 9e6bc17..0aefcda 100644 --- a/libgo/go/sync/cond.go +++ b/libgo/go/sync/cond.go @@ -5,6 +5,7 @@ package sync import ( + "internal/race" "sync/atomic" "unsafe" ) @@ -51,12 +52,12 @@ func NewCond(l Locker) *Cond { // func (c *Cond) Wait() { c.checker.check() - if raceenabled { - raceDisable() + if race.Enabled { + race.Disable() } atomic.AddUint32(&c.waiters, 1) - if raceenabled { - raceEnable() + if race.Enabled { + race.Enable() } c.L.Unlock() runtime_Syncsemacquire(&c.sema) @@ -81,14 +82,14 @@ func (c *Cond) Broadcast() { func (c *Cond) signalImpl(all bool) { c.checker.check() - if raceenabled { - raceDisable() + if race.Enabled { + race.Disable() } for { old := atomic.LoadUint32(&c.waiters) if old == 0 { - if raceenabled { - raceEnable() + if race.Enabled { + race.Enable() } return } @@ -97,8 +98,8 @@ func (c *Cond) signalImpl(all bool) { new = 0 } if atomic.CompareAndSwapUint32(&c.waiters, old, new) { - if raceenabled { - raceEnable() + if race.Enabled { + race.Enable() } runtime_Syncsemrelease(&c.sema, old-new) return |