Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestRaceFuncArgument2 (0.6 sec)

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

    	}
    }
    
    func TestRaceFuncArgument(t *testing.T) {
    	var x int
    	ch := make(chan bool, 1)
    	go func() {
    		emptyFunc(x)
    		ch <- true
    	}()
    	x = 1
    	<-ch
    }
    
    func TestRaceFuncArgument2(t *testing.T) {
    	var x int
    	ch := make(chan bool, 2)
    	go func() {
    		x = 42
    		ch <- true
    	}()
    	go func(y int) {
    		ch <- true
    	}(x)
    	<-ch
    	<-ch
    }
    
    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