Search Options

Results per page
Sort
Preferred Languages
Advance

Results 61 - 70 of 1,357 for atomics (0.15 sec)

  1. src/cmd/go/testdata/script/cover_sync_atomic_import.txt

    go test -short -cover -covermode=atomic -coverpkg=coverdep/p1 coverdep
    
    # In addition to the above, test to make sure there is no funny
    # business if we try "go test -cover" in atomic mode targeting
    # sync/atomic itself (see #57445). Just a short test run is needed
    # since we're mainly interested in making sure the test builds and can
    # execute at least one test.
    
    go test -short -covermode=atomic -run=TestStoreInt64 sync/atomic
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 00:18:30 UTC 2024
    - 1011 bytes
    - Viewed (0)
  2. internal/once/init.go

    func (l *Init) Do(f func() error) error {
    	if atomic.LoadUint32(&l.done) == 0 {
    		return l.do(f)
    	}
    	return nil
    }
    
    func (l *Init) do(f func() error) error {
    	l.m.Lock()
    	defer l.m.Unlock()
    	if atomic.LoadUint32(&l.done) == 0 {
    		if err := f(); err != nil {
    			return err
    		}
    		// Mark as done only when f() is successful
    		atomic.StoreUint32(&l.done, 1)
    	}
    	return nil
    }
    
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue May 09 04:20:31 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  3. src/runtime/testdata/testprog/preempt.go

    	var ready, ready2 uint32
    	go func() {
    		for {
    			atomic.StoreUint32(&ready, 1)
    			dummy()
    			dummy()
    		}
    	}()
    	// Also start one with a frameless function.
    	// This is an especially interesting case for
    	// LR machines.
    	go func() {
    		atomic.AddUint32(&ready2, 1)
    		frameless()
    	}()
    	// Also test empty infinite loop.
    	go func() {
    		atomic.AddUint32(&ready2, 1)
    		for {
    		}
    	}()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Dec 07 17:46:04 UTC 2021
    - 1.6K bytes
    - Viewed (0)
  4. src/runtime/race/race_windows_test.go

    	a := (*uint64)(unsafe.Pointer(mem))
    	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)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 1.3K bytes
    - Viewed (0)
  5. test/fixedbugs/bug512.go

    package main
    
    import (
    	"sync"
    	"sync/atomic"
    )
    
    var wg sync.WaitGroup
    
    type S struct {
    	i1, i2 int32
    }
    
    var done int32
    
    func (s S) Check(v1, v2 int32) {
    	for {
    		if g1 := atomic.LoadInt32(&s.i1); v1 != g1 {
    			panic(g1)
    		}
    		if g2 := atomic.LoadInt32(&s.i2); v2 != g2 {
    			panic(g2)
    		}
    		if atomic.LoadInt32(&done) != 0 {
    			break
    		}
    	}
    	wg.Done()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 17 19:15:18 UTC 2021
    - 793 bytes
    - Viewed (0)
  6. cni/pkg/nodeagent/healthServer.go

    		_ = http.ListenAndServe(":"+constants.ReadinessPort, router)
    	}()
    
    	return
    }
    
    func initRouter(router *http.ServeMux) (installReady *atomic.Value, watchReady *atomic.Value) {
    	installReady = &atomic.Value{}
    	watchReady = &atomic.Value{}
    	installReady.Store(false)
    	watchReady.Store(false)
    
    	router.HandleFunc(constants.LivenessEndpoint, healthz)
    	router.HandleFunc(constants.ReadinessEndpoint, readyz(installReady, watchReady))
    
    	return
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Apr 15 01:29:35 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  7. src/internal/runtime/atomic/atomic_andor_test.go

    // implementations for all architectures.
    package atomic_test
    
    import (
    	"internal/runtime/atomic"
    	"testing"
    )
    
    func TestAnd32(t *testing.T) {
    	// Basic sanity check.
    	x := uint32(0xffffffff)
    	for i := uint32(0); i < 32; i++ {
    		old := x
    		v := atomic.And32(&x, ^(1 << i))
    		if r := uint32(0xffffffff) << (i + 1); x != r || v != old {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Apr 27 20:49:32 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  8. src/runtime/vdso_freebsd_x86.go

    //go:nosplit
    func (th *vdsoTimehands) getHPETTimecounter() (uint32, bool) {
    	idx := int(th.x86_hpet_idx)
    	if idx >= len(hpetDevMap) {
    		return 0, false
    	}
    
    	p := atomic.Loaduintptr(&hpetDevMap[idx])
    	if p == 0 {
    		systemstack(func() { initHPETTimecounter(idx) })
    		p = atomic.Loaduintptr(&hpetDevMap[idx])
    	}
    	if p == ^uintptr(0) {
    		return 0, false
    	}
    	return *(*uint32)(unsafe.Pointer(p + _HPET_MAIN_COUNTER)), true
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 1.9K bytes
    - Viewed (0)
  9. test/escape_sync_atomic.go

    // license that can be found in the LICENSE file.
    
    // Test escape analysis for sync/atomic.
    
    package escape
    
    import (
    	"sync/atomic"
    	"unsafe"
    )
    
    // BAD: should be "leaking param: addr to result ~r1 level=1$".
    func LoadPointer(addr *unsafe.Pointer) unsafe.Pointer { // ERROR "leaking param: addr$"
    	return atomic.LoadPointer(addr)
    }
    
    var ptr unsafe.Pointer
    
    func StorePointer() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 19:09:15 UTC 2019
    - 943 bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/mod/sumdb/cache.go

    	entryIface, ok := c.m.Load(key)
    	if !ok {
    		entryIface, _ = c.m.LoadOrStore(key, new(cacheEntry))
    	}
    	e := entryIface.(*cacheEntry)
    	if atomic.LoadUint32(&e.done) == 0 {
    		e.mu.Lock()
    		if atomic.LoadUint32(&e.done) == 0 {
    			e.result = f()
    			atomic.StoreUint32(&e.done, 1)
    		}
    		e.mu.Unlock()
    	}
    	return e.result
    }
    
    // Get returns the cached result associated with key.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 29 20:10:15 UTC 2019
    - 1.5K bytes
    - Viewed (0)
Back to top