Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 1,309 for ATOMIC (0.13 sec)

  1. 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)
  2. 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)
  3. 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)
  4. internal/pubsub/pubsub.go

    			}
    		}
    		atomic.StoreUint64(&ps.types, uint64(remainTypes))
    		atomic.AddInt32(&ps.numSubscribers, -1)
    	}()
    
    	return nil
    }
    
    // SubscribeJSON - Adds a subscriber to pubsub system and returns results with JSON encoding.
    func (ps *PubSub[T, M]) SubscribeJSON(mask M, subCh chan<- []byte, doneCh <-chan struct{}, filter func(entry T) bool, wg *sync.WaitGroup) error {
    	totalSubs := atomic.AddInt32(&ps.numSubscribers, 1)
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Tue Feb 06 16:57:30 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  5. 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)
  6. 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)
  7. 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)
  8. test/fixedbugs/issue16985.go

    // issue 16985: intrinsified AMD64 atomic ops should clobber flags
    
    package main
    
    import "sync/atomic"
    
    var count uint32
    
    func main() {
    	buffer := []byte("T")
    	for i := 0; i < len(buffer); {
    		atomic.AddUint32(&count, 1)
    		_ = buffer[i]
    		i++
    		i++
    	}
    
    	for i := 0; i < len(buffer); {
    		atomic.CompareAndSwapUint32(&count, 0, 1)
    		_ = buffer[i]
    		i++
    		i++
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 14:26:18 UTC 2016
    - 625 bytes
    - Viewed (0)
  9. src/runtime/lock_sema.go

    //go:nowritebarrier
    func unlock2(l *mutex) {
    	gp := getg()
    	var mp *m
    	for {
    		v := atomic.Loaduintptr(&l.key)
    		if v == locked {
    			if atomic.Casuintptr(&l.key, locked, 0) {
    				break
    			}
    		} else {
    			// Other M's are waiting for the lock.
    			// Dequeue an M.
    			mp = muintptr(v &^ locked).ptr()
    			if atomic.Casuintptr(&l.key, v, uintptr(mp.nextwaitm)) {
    				// Dequeued an M.  Wake it.
    				semawakeup(mp)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 30 17:57:37 UTC 2024
    - 6.8K bytes
    - Viewed (0)
  10. cmd/dynamic-timeouts.go

    		// We are hitting the timeout too often, so increase the timeout by 25%
    		timeout := atomic.LoadInt64(&dt.timeout) * 125 / 100
    
    		// Set upper cap.
    		if timeout > int64(maxDynamicTimeout) {
    			timeout = int64(maxDynamicTimeout)
    		}
    		// Safety, shouldn't happen
    		if timeout < dt.minimum {
    			timeout = dt.minimum
    		}
    		atomic.StoreInt64(&dt.timeout, timeout)
    	} else if failPct < dynamicTimeoutDecreaseThresholdPct {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Aug 19 23:21:05 UTC 2022
    - 4.5K bytes
    - Viewed (0)
Back to top