Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for CompareAndSwapNoWB (0.29 sec)

  1. src/internal/runtime/atomic/types.go

    // hide pointers from the GC. Use with care and sparingly.
    // It is safe to use with values not found in the Go heap.
    // Prefer CompareAndSwap instead.
    //
    //go:nosplit
    func (p *Pointer[T]) CompareAndSwapNoWB(old, new *T) bool {
    	return p.u.CompareAndSwapNoWB(unsafe.Pointer(old), unsafe.Pointer(new))
    }
    
    // CompareAndSwap 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)
  2. src/runtime/atomic_pointer.go

    func atomic_storePointer(ptr *unsafe.Pointer, new unsafe.Pointer) {
    	atomicstorep(unsafe.Pointer(ptr), new)
    }
    
    // atomic_casPointer is the implementation of runtime/internal/UnsafePointer.CompareAndSwap
    // (like CompareAndSwapNoWB but with the write barrier).
    //
    //go:nosplit
    //go:linkname atomic_casPointer internal/runtime/atomic.casPointer
    func atomic_casPointer(ptr *unsafe.Pointer, old, new unsafe.Pointer) bool {
    	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)
  3. src/runtime/tracemap.go

    			// much activity, or the map gets big and races to insert on
    			// the same node are much less likely.
    			if newNode == nil {
    				newNode = tab.newTraceMapNode(data, size, hash, tab.seq.Add(1))
    			}
    			if m.CompareAndSwapNoWB(nil, unsafe.Pointer(newNode)) {
    				return newNode.id, true
    			}
    			// Reload n. Because pointers are only stored once,
    			// we must have lost the race, and therefore n is not nil
    			// anymore.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 17:03:35 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  4. src/runtime/trace.go

    func ReadTrace() []byte {
    top:
    	var buf []byte
    	var park bool
    	systemstack(func() {
    		buf, park = readTrace0()
    	})
    	if park {
    		gopark(func(gp *g, _ unsafe.Pointer) bool {
    			if !trace.reader.CompareAndSwapNoWB(nil, gp) {
    				// We're racing with another reader.
    				// Wake up and handle this case.
    				return false
    			}
    
    			if g2 := traceReader(); gp == g2 {
    				// New data arrived between unlocking
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 21:17:41 UTC 2024
    - 37.1K bytes
    - Viewed (0)
  5. src/runtime/proc.go

    //
    // Nosplit as it is called in a bad stack condition (we know
    // morestack would fail).
    //
    //go:nosplit
    //go:nowritebarrierrec
    func switchToCrashStack(fn func()) {
    	me := getg()
    	if crashingG.CompareAndSwapNoWB(nil, me) {
    		switchToCrashStack0(fn) // should never return
    		abort()
    	}
    	if crashingG.Load() == me {
    		// recursive crashing. too bad.
    		writeErrStr("fatal: recursive switchToCrashStack\n")
    		abort()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 207.5K bytes
    - Viewed (0)
Back to top