Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestNoRaceAfterFunc (0.27 sec)

  1. src/runtime/race/testdata/time_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 (
    	"testing"
    	"time"
    )
    
    func TestNoRaceAfterFunc(_ *testing.T) {
    	v := 0
    	_ = v
    	c := make(chan int)
    	f := func() {
    		v = 1
    		c <- 0
    	}
    	v = 2
    	time.AfterFunc(1, f)
    	<-c
    	v = 3
    }
    
    func TestNoRaceAfterFuncReset(_ *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:34:15 UTC 2024
    - 1.3K bytes
    - Viewed (0)
Back to top