Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestNoRaceFin (0.09 sec)

  1. src/runtime/race/testdata/finalizer_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 TestNoRaceFin(t *testing.T) {
    	c := make(chan bool)
    	go func() {
    		x := new(string)
    		runtime.SetFinalizer(x, func(x *string) {
    			*x = "foo"
    		})
    		*x = "bar"
    		c <- true
    	}()
    	<-c
    	runtime.GC()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 03 22:09:38 UTC 2017
    - 1K bytes
    - Viewed (0)
Back to top