Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestRaceInterCall (0.15 sec)

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

    func (p InterImpl) Foo(x int) {
    }
    
    type InterImpl2 InterImpl
    
    func (p *InterImpl2) Foo(x int) {
    	if p == nil {
    		InterImpl{}.Foo(x)
    	}
    	InterImpl(*p).Foo(x)
    }
    
    func TestRaceInterCall(t *testing.T) {
    	c := make(chan bool, 1)
    	p := InterImpl{}
    	var x Inter = p
    	go func() {
    		p2 := InterImpl{}
    		x = p2
    		c <- true
    	}()
    	x.Foo(0)
    	<-c
    }
    
    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