Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestNoRaceWaitGroup (0.17 sec)

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

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package race_test
    
    import (
    	"runtime"
    	"sync"
    	"testing"
    	"time"
    )
    
    func TestNoRaceWaitGroup(t *testing.T) {
    	var x int
    	_ = x
    	var wg sync.WaitGroup
    	n := 1
    	for i := 0; i < n; i++ {
    		wg.Add(1)
    		j := i
    		go func() {
    			x = j
    			wg.Done()
    		}()
    	}
    	wg.Wait()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 03 22:09:38 UTC 2017
    - 5.3K bytes
    - Viewed (0)
Back to top