Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for storePointer (0.32 sec)

  1. src/sync/atomic/value.go

    			runtime_procPin()
    			if !CompareAndSwapPointer(&vp.typ, nil, unsafe.Pointer(&firstStoreInProgress)) {
    				runtime_procUnpin()
    				continue
    			}
    			// Complete first store.
    			StorePointer(&vp.data, vlp.data)
    			StorePointer(&vp.typ, vlp.typ)
    			runtime_procUnpin()
    			return
    		}
    		if typ == unsafe.Pointer(&firstStoreInProgress) {
    			// First store in progress. Wait.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 20:48:55 UTC 2024
    - 5.9K bytes
    - Viewed (0)
  2. test/escape_sync_atomic.go

    func LoadPointer(addr *unsafe.Pointer) unsafe.Pointer { // ERROR "leaking param: addr$"
    	return atomic.LoadPointer(addr)
    }
    
    var ptr unsafe.Pointer
    
    func StorePointer() {
    	var x int // ERROR "moved to heap: x"
    	atomic.StorePointer(&ptr, unsafe.Pointer(&x))
    }
    
    func SwapPointer() {
    	var x int // ERROR "moved to heap: x"
    	atomic.SwapPointer(&ptr, unsafe.Pointer(&x))
    }
    
    func CompareAndSwapPointer() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 17 19:09:15 UTC 2019
    - 943 bytes
    - Viewed (0)
  3. src/runtime/atomic_pointer.go

    }
    
    // atomic_storePointer is the implementation of runtime/internal/UnsafePointer.Store
    // (like StoreNoWB but with the write barrier).
    //
    //go:nosplit
    //go:linkname atomic_storePointer internal/runtime/atomic.storePointer
    func atomic_storePointer(ptr *unsafe.Pointer, new unsafe.Pointer) {
    	atomicstorep(unsafe.Pointer(ptr), new)
    }
    
    // atomic_casPointer is the implementation of runtime/internal/UnsafePointer.CompareAndSwap
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 16:25:21 UTC 2024
    - 4K bytes
    - Viewed (0)
  4. src/syscall/dll_windows.go

    		d.mu.Lock()
    		defer d.mu.Unlock()
    		if d.dll == nil {
    			dll, e := LoadDLL(d.Name)
    			if e != nil {
    				return e
    			}
    			// Non-racy version of:
    			// d.dll = dll
    			atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&d.dll)), unsafe.Pointer(dll))
    		}
    	}
    	return nil
    }
    
    // mustLoad is like Load but panics if search fails.
    func (d *LazyDLL) mustLoad() {
    	e := d.Load()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:03:59 UTC 2024
    - 7.7K bytes
    - Viewed (0)
  5. src/internal/runtime/atomic/types.go

    	StorepNoWB(unsafe.Pointer(&u.value), value)
    }
    
    // Store updates the value atomically.
    func (u *UnsafePointer) Store(value unsafe.Pointer) {
    	storePointer(&u.value, value)
    }
    
    // provided by runtime
    //
    //go:linkname storePointer
    func storePointer(ptr *unsafe.Pointer, new unsafe.Pointer)
    
    // CompareAndSwapNoWB atomically (with respect to other methods)
    // compares u's value with old, and if they're equal,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:53:03 UTC 2024
    - 14.2K bytes
    - Viewed (0)
  6. src/runtime/race/testdata/atomic_test.go

    }
    
    func TestNoRaceAtomicLoadStorePointer(t *testing.T) {
    	var x int64
    	_ = x
    	var s unsafe.Pointer
    	var y int = 2
    	var p unsafe.Pointer = unsafe.Pointer(&y)
    	go func() {
    		x = 2
    		atomic.StorePointer(&s, p)
    	}()
    	for atomic.LoadPointer(&s) != p {
    		runtime.Gosched()
    	}
    	x = 1
    }
    
    func TestNoRaceAtomicStoreCASUint64(t *testing.T) {
    	var x int64
    	_ = x
    	var s uint64
    	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)
  7. src/sync/atomic/doc.go

    // Consider using the more ergonomic and less error-prone [Uintptr.Store] instead.
    func StoreUintptr(addr *uintptr, val uintptr)
    
    // StorePointer atomically stores val into *addr.
    // Consider using the more ergonomic and less error-prone [Pointer.Store] instead.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 11.7K bytes
    - Viewed (0)
  8. src/cmd/vendor/golang.org/x/sys/windows/dll_windows.go

    		dll, err = LoadDLL(d.Name)
    	} else {
    		dll, err = loadLibraryEx(d.Name, d.System)
    	}
    	if err != nil {
    		return err
    	}
    
    	// Non-racy version of:
    	// d.dll = dll
    	atomic.StorePointer((*unsafe.Pointer)(unsafe.Pointer(&d.dll)), unsafe.Pointer(dll))
    	return nil
    }
    
    // mustLoad is like Load but panics if search fails.
    func (d *LazyDLL) mustLoad() {
    	e := d.Load()
    	if e != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Dec 05 12:36:42 UTC 2020
    - 12K bytes
    - Viewed (0)
  9. cmd/data-scanner-metric.go

    	initialPtr := unsafe.Pointer(&initial)
    	tracker := &currentPathTracker{
    		name: &initialPtr,
    	}
    
    	p.currentPaths.Store(disk, tracker)
    	return func(path string) {
    			atomic.StorePointer(tracker.name, unsafe.Pointer(&path))
    		}, func() {
    			p.currentPaths.Delete(disk)
    		}
    }
    
    // getCurrentPaths returns the paths currently being processed.
    func (p *scannerMetrics) getCurrentPaths() []string {
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Sep 25 05:15:31 UTC 2023
    - 9.1K bytes
    - Viewed (0)
  10. src/sync/atomic/type.go

    }
    
    // Load atomically loads and returns the value stored in x.
    func (x *Pointer[T]) Load() *T { return (*T)(LoadPointer(&x.v)) }
    
    // Store atomically stores val into x.
    func (x *Pointer[T]) Store(val *T) { StorePointer(&x.v, unsafe.Pointer(val)) }
    
    // Swap atomically stores new into x and returns the previous value.
    func (x *Pointer[T]) Swap(new *T) (old *T) { return (*T)(SwapPointer(&x.v, unsafe.Pointer(new))) }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:37:29 UTC 2024
    - 8.5K bytes
    - Viewed (0)
Back to top