Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestRaceIntRWClosures (0.14 sec)

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

    }
    
    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() {
    		y = x
    		ch <- 1
    	}()
    	go func() {
    		x = 1
    		ch <- 1
    	}()
    	<-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