mirror of
https://github.com/golang/go
synced 2024-11-15 02:50:31 -07:00
n
Change-Id: Iad9d831d7b69427671d8327949a81b3c06794e11
This commit is contained in:
parent
3cbfd3c119
commit
54c3c82269
@ -54,8 +54,6 @@ func TestChanSendBarrier(t *testing.T) {
|
||||
testChanSendBarrier(false)
|
||||
}
|
||||
|
||||
var globalMu sync.Mutex
|
||||
|
||||
func testChanSendBarrier(useSelect bool) {
|
||||
var wg sync.WaitGroup
|
||||
outer := 100
|
||||
@ -75,12 +73,15 @@ func testChanSendBarrier(useSelect bool) {
|
||||
if !ok {
|
||||
panic(1)
|
||||
}
|
||||
garbage = make([]byte, 1<<10)
|
||||
garbage = makeByte()
|
||||
}
|
||||
globalMu.Lock()
|
||||
global = garbage
|
||||
globalMu.Unlock()
|
||||
_ = garbage
|
||||
}()
|
||||
}
|
||||
wg.Wait()
|
||||
}
|
||||
|
||||
//go:noinline
|
||||
func makeByte() []byte {
|
||||
return make([]byte, 1<<10)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user