Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 598 for ATOMIC (0.1 sec)

  1. src/cmd/vet/testdata/atomic/atomic.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // This file contains tests for the atomic checker.
    
    package atomic
    
    import "sync/atomic"
    
    func AtomicTests() {
    	x := uint64(1)
    	x = atomic.AddUint64(&x, 1) // ERROR "direct assignment to atomic value"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Feb 20 15:46:42 UTC 2019
    - 364 bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/atomic/atomic.go

    )
    
    //go:embed doc.go
    var doc string
    
    var Analyzer = &analysis.Analyzer{
    	Name:             "atomic",
    	Doc:              analysisutil.MustExtractDoc(doc, "atomic"),
    	URL:              "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/atomic",
    	Requires:         []*analysis.Analyzer{inspect.Analyzer},
    	RunDespiteErrors: true,
    	Run:              run,
    }
    
    func run(pass *analysis.Pass) (interface{}, error) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/ir/func_test.go

    			pkg: `foo`,
    			sym: "Bar[go.shape.struct { sync/atomic._ sync/atomic.noCopy; sync/atomic._ sync/atomic.align64; sync/atomic.v uint64 }]",
    		},
    		{
    			in:  `example%2ecom.Bar[go.shape.struct { sync/atomic._ sync/atomic.noCopy; sync/atomic._ sync/atomic.align64; sync/atomic.v uint64 }]`,
    			pkg: `example%2ecom`,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 13:56:32 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  4. src/runtime/atomic_pointer.go

    // to be able to intercept the sync/atomic forms but not the runtime forms.
    
    //go:linkname sync_atomic_StoreUintptr sync/atomic.StoreUintptr
    func sync_atomic_StoreUintptr(ptr *uintptr, new uintptr)
    
    //go:linkname sync_atomic_StorePointer sync/atomic.StorePointer
    //go:nosplit
    func sync_atomic_StorePointer(ptr *unsafe.Pointer, new unsafe.Pointer) {
    	if writeBarrier.enabled {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 16:25:21 UTC 2024
    - 4K bytes
    - Viewed (0)
  5. src/runtime/race/testdata/atomic_test.go

    	go func() {
    		x1 = 1
    		if atomic.AddInt32(&s, 1) == 2 {
    			x2 = 1
    		}
    		ch <- true
    	}()
    	go func() {
    		x2 = 1
    		if atomic.AddInt32(&s, 1) == 2 {
    			x1 = 1
    		}
    		ch <- true
    	}()
    	<-ch
    	<-ch
    }
    
    func TestNoRaceAtomicLoadAddInt32(t *testing.T) {
    	var x int64
    	_ = x
    	var s int32
    	go func() {
    		x = 2
    		atomic.AddInt32(&s, 1)
    	}()
    	for atomic.LoadInt32(&s) != 1 {
    		runtime.Gosched()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 16 17:26:46 UTC 2020
    - 4.9K bytes
    - Viewed (0)
  6. test/fixedbugs/issue24449.go

    	}
    	if len(a) <= len(b) {
    		atomic.AddInt32(&cnt32, 16)
    	}
    	return atomic.LoadInt32(&cnt32) == 31
    }
    
    var cnt64 int64
    
    //go:noinline
    func test64(a, b []int) bool {
    	// Try to generate flag value, issue atomic
    	// adds and then re-use the flag value to see if
    	// the atomic add has clobbered them.
    	atomic.AddInt64(&cnt64, 1)
    	if len(a) == len(b) {
    		atomic.AddInt64(&cnt64, 2)
    	}
    	atomic.AddInt64(&cnt64, 4)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 20 09:44:50 UTC 2018
    - 1.2K bytes
    - Viewed (0)
  7. test/intrinsic_atomic.go

    package main
    
    import "sync/atomic"
    
    var x uint32
    
    func atomics() {
    	_ = atomic.LoadUint32(&x)             // ERROR "intrinsic substitution for LoadUint32"
    	atomic.StoreUint32(&x, 1)             // ERROR "intrinsic substitution for StoreUint32"
    	atomic.AddUint32(&x, 1)               // ERROR "intrinsic substitution for AddUint32"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:25 UTC 2023
    - 839 bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/atomic/doc.go

    // Package atomic defines an Analyzer that checks for common mistakes
    // using the sync/atomic package.
    //
    // # Analyzer atomic
    //
    // atomic: check for common mistakes using the sync/atomic package
    //
    // The atomic checker looks for assignment statements of the form:
    //
    //	x = atomic.AddUint64(&x, 1)
    //
    // which are not atomic.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 09 01:28:01 UTC 2023
    - 505 bytes
    - Viewed (0)
  9. src/internal/runtime/atomic/bench_test.go

    	x = 1
    	ptr := &x
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			atomic.Cas(ptr, 1, 0)
    			atomic.Cas(ptr, 0, 1)
    		}
    	})
    }
    
    func BenchmarkCas64(b *testing.B) {
    	var x uint64
    	x = 1
    	ptr := &x
    	b.RunParallel(func(pb *testing.PB) {
    		for pb.Next() {
    			atomic.Cas64(ptr, 1, 0)
    			atomic.Cas64(ptr, 0, 1)
    		}
    	})
    }
    func BenchmarkXchg(b *testing.B) {
    	var x uint32
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  10. src/runtime/race/race_linux_test.go

    	a := (*uint64)(unsafe.Pointer(&mem[0]))
    	if *a != 0 {
    		t.Fatalf("bad atomic value: %v, want 0", *a)
    	}
    	atomic.AddUint64(a, 1)
    	if *a != 1 {
    		t.Fatalf("bad atomic value: %v, want 1", *a)
    	}
    	atomic.AddUint64(a, 1)
    	if *a != 2 {
    		t.Fatalf("bad atomic value: %v, want 2", *a)
    	}
    }
    
    func TestAtomicPageBoundary(t *testing.T) {
    	// Test that atomic access near (but not cross) a page boundary
    	// doesn't fault. See issue 60825.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 16 14:09:02 UTC 2023
    - 1.9K bytes
    - Viewed (0)
Back to top