Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestRaceIntRWGlobalFuncs (0.23 sec)

  1. src/runtime/race/testdata/mop_test.go

    var GlobalCh chan int = make(chan int, 2)
    
    func GlobalFunc1() {
    	GlobalY = GlobalX
    	GlobalCh <- 1
    }
    
    func GlobalFunc2() {
    	GlobalX = 1
    	GlobalCh <- 1
    }
    
    func TestRaceIntRWGlobalFuncs(t *testing.T) {
    	go GlobalFunc1()
    	go GlobalFunc2()
    	<-GlobalCh
    	<-GlobalCh
    }
    
    func TestRaceIntRWClosures(t *testing.T) {
    	var x, y int
    	_ = y
    	ch := make(chan int, 2)
    
    	go func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 23 16:46:25 UTC 2023
    - 28.9K bytes
    - Viewed (0)
Back to top