Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestNoRaceComp (0.42 sec)

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

    // license that can be found in the LICENSE file.
    
    package race_test
    
    import (
    	"testing"
    )
    
    type P struct {
    	x, y int
    }
    
    type S struct {
    	s1, s2 P
    }
    
    func TestNoRaceComp(t *testing.T) {
    	c := make(chan bool, 1)
    	var s S
    	go func() {
    		s.s2.x = 1
    		c <- true
    	}()
    	s.s2.y = 2
    	<-c
    }
    
    func TestNoRaceComp2(t *testing.T) {
    	c := make(chan bool, 1)
    	var s S
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 08 04:08:51 UTC 2014
    - 2.3K bytes
    - Viewed (0)
Back to top