Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 10 for CompareAndDelete (0.21 sec)

  1. src/internal/concurrent/hashtriemap_test.go

    			}
    			for i, s := range testData {
    				expectPresent(t, s, i)(m.Load(s))
    				expectNotDeleted(t, s, math.MaxInt)(m.CompareAndDelete(s, math.MaxInt))
    				expectDeleted(t, s, i)(m.CompareAndDelete(s, i))
    				expectNotDeleted(t, s, i)(m.CompareAndDelete(s, i))
    				expectMissing(t, s, 0)(m.Load(s))
    			}
    			for _, s := range testData {
    				expectMissing(t, s, 0)(m.Load(s))
    			}
    		}
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 16:01:55 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  2. src/sync/map_reference_test.go

    	LoadOrStore(key, value any) (actual any, loaded bool)
    	LoadAndDelete(key any) (value any, loaded bool)
    	Delete(any)
    	Swap(key, value any) (previous any, loaded bool)
    	CompareAndSwap(key, old, new any) (swapped bool)
    	CompareAndDelete(key, old any) (deleted bool)
    	Range(func(key, value any) (shouldContinue bool))
    	Clear()
    }
    
    var (
    	_ mapInterface = &RWMutexMap{}
    	_ mapInterface = &DeepCopyMap{}
    )
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 5.6K bytes
    - Viewed (0)
  3. src/internal/concurrent/hashtriemap.go

    		newIndirect = nextIndirect
    	}
    	return &top.node
    }
    
    // CompareAndDelete deletes the entry for key if its value is equal to old.
    //
    // If there is no current value for key in the map, CompareAndDelete returns false
    // (even if the old value is the nil interface value).
    func (ht *HashTrieMap[K, V]) CompareAndDelete(key K, old V) (deleted bool) {
    	hash := ht.keyHash(abi.NoEscape(unsafe.Pointer(&key)), ht.seed)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 16:01:55 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  4. src/unique/handle.go

    		// try to get the pointer we need out of it.
    		ptr = wp.Strong()
    		if ptr != nil {
    			break
    		}
    		// The weak pointer is nil, so the old value is truly dead.
    		// Try to remove it and start over.
    		m.CompareAndDelete(value, wp)
    	}
    	runtime.KeepAlive(toInsert)
    	return Handle[T]{ptr}
    }
    
    var (
    	// uniqueMaps is an index of type-specific concurrent maps used for unique.Make.
    	//
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 16:01:55 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  5. src/sync/map_bench_test.go

    	benchMap(b, bench{
    		setup: func(_ *testing.B, m mapInterface) {
    			m.LoadOrStore(0, 0)
    		},
    
    		perG: func(b *testing.B, pb *testing.PB, i int, m mapInterface) {
    			for ; pb.Next(); i++ {
    				if m.CompareAndDelete(0, 0) {
    					m.Store(0, 0)
    				}
    			}
    		},
    	})
    }
    
    func BenchmarkCompareAndDeleteMostlyHits(b *testing.B) {
    	const hits, misses = 1023, 1
    
    	benchMap(b, bench{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  6. src/sync/map.go

    		m.missLocked()
    	}
    	return swapped
    }
    
    // CompareAndDelete deletes the entry for key if its value is equal to old.
    // The old value must be of a comparable type.
    //
    // If there is no current value for key in the map, CompareAndDelete
    // returns false (even if the old value is the nil interface value).
    func (m *Map) CompareAndDelete(key, old any) (deleted bool) {
    	read := m.loadReadOnly()
    	e, ok := read.m[key]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  7. src/sync/map_test.go

    	opLoadAndDelete    = mapOp("LoadAndDelete")
    	opDelete           = mapOp("Delete")
    	opSwap             = mapOp("Swap")
    	opCompareAndSwap   = mapOp("CompareAndSwap")
    	opCompareAndDelete = mapOp("CompareAndDelete")
    	opClear            = mapOp("Clear")
    )
    
    var mapOps = [...]mapOp{
    	opLoad,
    	opStore,
    	opLoadOrStore,
    	opLoadAndDelete,
    	opDelete,
    	opSwap,
    	opCompareAndSwap,
    	opCompareAndDelete,
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  8. src/net/net_fake.go

    	}
    	return peer.queue.write(ffd.writeDeadline.Load(), p, ffd.fd.laddr.(sockaddr))
    }
    
    func (ffd *fakeNetFD) Close() (err error) {
    	if ffd.fakeAddr != (fakeSockAddr{}) {
    		sockets.CompareAndDelete(ffd.fakeAddr, ffd.fd)
    	}
    
    	if ffd.queue != nil {
    		if closeErr := ffd.queue.closeRead(); err == nil {
    			err = closeErr
    		}
    	}
    	if ffd.peer != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 19:24:21 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/stdlib/manifest.go

    		{"TrimSpace", Func, 0},
    		{"TrimSuffix", Func, 1},
    	},
    	"sync": {
    		{"(*Cond).Broadcast", Method, 0},
    		{"(*Cond).Signal", Method, 0},
    		{"(*Cond).Wait", Method, 0},
    		{"(*Map).CompareAndDelete", Method, 20},
    		{"(*Map).CompareAndSwap", Method, 20},
    		{"(*Map).Delete", Method, 9},
    		{"(*Map).Load", Method, 9},
    		{"(*Map).LoadAndDelete", Method, 15},
    		{"(*Map).LoadOrStore", Method, 9},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 534.2K bytes
    - Viewed (0)
  10. api/go1.20.txt

    pkg runtime/coverage, func WriteMeta(io.Writer) error #51430
    pkg strings, func CutPrefix(string, string) (string, bool) #42537
    pkg strings, func CutSuffix(string, string) (string, bool) #42537
    pkg sync, method (*Map) CompareAndDelete(interface{}, interface{}) bool #51972
    pkg sync, method (*Map) CompareAndSwap(interface{}, interface{}, interface{}) bool #51972
    pkg sync, method (*Map) Swap(interface{}, interface{}) (interface{}, bool) #51972
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 17 21:23:32 UTC 2023
    - 602.6K bytes
    - Viewed (0)
Back to top