Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for TestNoRaceAtomicAddInt64 (0.14 sec)

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

    // license that can be found in the LICENSE file.
    
    package race_test
    
    import (
    	"runtime"
    	"sync"
    	"sync/atomic"
    	"testing"
    	"unsafe"
    )
    
    func TestNoRaceAtomicAddInt64(t *testing.T) {
    	var x1, x2 int8
    	_ = x1 + x2
    	var s int64
    	ch := make(chan bool, 2)
    	go func() {
    		x1 = 1
    		if atomic.AddInt64(&s, 1) == 2 {
    			x2 = 1
    		}
    		ch <- true
    	}()
    	go func() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 16 17:26:46 UTC 2020
    - 4.9K bytes
    - Viewed (0)
Back to top