diff options
author | Cherry Mui <cherryyz@google.com> | 2022-02-11 14:58:56 +0000 |
---|---|---|
committer | Cherry Mui <cherryyz@google.com> | 2022-02-11 14:58:56 +0000 |
commit | e90b835f3071f1eb71810a3631b792f23df59f24 (patch) | |
tree | dc5a1c1620f14dbc051402095af9c024bc12a202 /src/runtime/race/testdata/mutex_test.go | |
parent | bb93480d009322886df6f5185c988d6d21fdc2c8 (diff) | |
parent | 0a6cf8706fdd0fe1bd26e4d1ecbcd41650bf5e6c (diff) | |
download | go-e90b835f3071f1eb71810a3631b792f23df59f24.tar.gz go-e90b835f3071f1eb71810a3631b792f23df59f24.zip |
[dev.boringcrypto.go1.16] all: merge go1.16.14 into dev.boringcrypto.go1.16
Change-Id: I186a567b3e76df7ecf1842634a3851eab7c9dfce
Diffstat (limited to 'src/runtime/race/testdata/mutex_test.go')
-rw-r--r-- | src/runtime/race/testdata/mutex_test.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/runtime/race/testdata/mutex_test.go b/src/runtime/race/testdata/mutex_test.go index cbed2d370c..9dbed9a2c9 100644 --- a/src/runtime/race/testdata/mutex_test.go +++ b/src/runtime/race/testdata/mutex_test.go @@ -78,16 +78,23 @@ func TestNoRaceMutexPureHappensBefore(t *testing.T) { var mu sync.Mutex var x int16 = 0 _ = x + written := false ch := make(chan bool, 2) go func() { x = 1 mu.Lock() + written = true mu.Unlock() ch <- true }() go func() { - <-time.After(1e5) + time.Sleep(100 * time.Microsecond) mu.Lock() + for !written { + mu.Unlock() + time.Sleep(100 * time.Microsecond) + mu.Lock() + } mu.Unlock() x = 1 ch <- true |