Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 15 for LoadOrStore (0.15 sec)

  1. src/sync/map_bench_test.go

    			for ; pb.Next(); i++ {
    				m.LoadOrStore(i, i)
    			}
    		},
    	})
    }
    
    func BenchmarkLoadOrStoreCollision(b *testing.B) {
    	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++ {
    				m.LoadOrStore(0, 0)
    			}
    		},
    	})
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 01 15:34:22 UTC 2024
    - 11.5K bytes
    - Viewed (0)
  2. src/sync/map.go

    // read and write operations are defined as follows.
    // [Map.Load], [Map.LoadAndDelete], [Map.LoadOrStore], [Map.Swap], [Map.CompareAndSwap],
    // and [Map.CompareAndDelete] are read operations;
    // [Map.Delete], [Map.LoadAndDelete], [Map.Store], and [Map.Swap] are write operations;
    // [Map.LoadOrStore] is a write operation when it returns loaded set to false;
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 15.6K bytes
    - Viewed (0)
  3. src/internal/concurrent/hashtriemap.go

    		i = n.indirect()
    	}
    	panic("internal/concurrent.HashMapTrie: ran out of hash bits while iterating")
    }
    
    // LoadOrStore returns the existing value for the key if present.
    // Otherwise, it stores and returns the given value.
    // The loaded result is true if the value was loaded, false if stored.
    func (ht *HashTrieMap[K, V]) LoadOrStore(key K, value V) (result V, loaded 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/net/net_fake.go

    		ffd.incomingEmpty <- true
    	case syscall.SOCK_DGRAM:
    		ffd.queue = newPacketQueue(defaultBuffer)
    	default:
    		return wrapErr(syscall.EINVAL)
    	}
    
    	fd.fakeNetFD = ffd
    	if _, dup := sockets.LoadOrStore(ffd.fakeAddr, fd); dup {
    		fd.fakeNetFD = nil
    		return wrapErr(syscall.EADDRINUSE)
    	}
    
    	return nil
    }
    
    func fakeConnect(ctx context.Context, fd *netFD, laddr, raddr sockaddr) error {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 27 19:24:21 UTC 2024
    - 26.4K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/util/peerproxy/peerproxy_handler_test.go

    		ppI.addToStorageVersionMap(svdata.gvr, svdata.serverId)
    	}
    	return ppI, nil
    }
    
    func (h *peerProxyHandler) addToStorageVersionMap(gvr schema.GroupVersionResource, serverId string) {
    	apiserversi, _ := h.svMap.LoadOrStore(gvr, &sync.Map{})
    	apiservers := apiserversi.(*sync.Map)
    	if serverId != "" {
    		apiservers.Store(serverId, true)
    	}
    }
    
    func testDataExists(gvr schema.GroupVersionResource) bool {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  6. src/encoding/gob/type.go

    	// Store the name and type provided by the user....
    	if t, dup := nameToConcreteType.LoadOrStore(name, reflect.TypeOf(value)); dup && t != ut.user {
    		panic(fmt.Sprintf("gob: registering duplicate types for %q: %s != %s", name, t, ut.user))
    	}
    
    	// but the flattened type in the type table, since that's what decode needs.
    	if n, dup := concreteTypeToName.LoadOrStore(ut.base, name); dup && n != name {
    		nameToConcreteType.Delete(name)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 16 02:00:26 UTC 2024
    - 27.2K bytes
    - Viewed (0)
  7. schema/schema.go

    			}
    		}
    	}
    
    	// Cache the schema
    	if v, loaded := cacheStore.LoadOrStore(schemaCacheKey, schema); loaded {
    		s := v.(*Schema)
    		// Wait for the initialization of other goroutines to complete
    		<-s.initialized
    		return s, s.err
    	}
    
    	defer func() {
    		if schema.err != nil {
    Registered: Wed Jun 12 16:27:09 UTC 2024
    - Last Modified: Wed Jun 12 10:52:33 UTC 2024
    - 13.7K bytes
    - Viewed (0)
  8. staging/src/k8s.io/apiserver/pkg/util/peerproxy/peerproxy_handler.go

    			versionSplit := strings.Split(version, "/")
    			if len(versionSplit) == 2 {
    				version = versionSplit[1]
    			}
    			gvr.Version = version
    			apiserversi, _ := h.svMap.LoadOrStore(gvr, &sync.Map{})
    			apiservers := apiserversi.(*sync.Map)
    			apiservers.Store(gr.APIServerID, true)
    		}
    	}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jul 19 00:36:22 UTC 2023
    - 11.5K bytes
    - Viewed (0)
  9. src/cmd/go/internal/modget/query.go

    // multiple concurrent calls will result in the sets being added in
    // nondeterministic order.
    func (q *query) pathOnce(path string, f func() pathSet) {
    	if _, dup := q.pathSeen.LoadOrStore(path, nil); dup {
    		return
    	}
    
    	cs := f()
    
    	if len(cs.pkgMods) > 0 || cs.mod != (module.Version{}) || cs.err != nil {
    		cs.path = path
    		q.candidatesMu.Lock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 27 15:48:25 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  10. src/cmd/go/internal/modfetch/codehost/codehost.go

    func RunWithStdin(ctx context.Context, dir string, stdin io.Reader, cmdline ...any) ([]byte, error) {
    	if dir != "" {
    		muIface, ok := dirLock.Load(dir)
    		if !ok {
    			muIface, _ = dirLock.LoadOrStore(dir, new(sync.Mutex))
    		}
    		mu := muIface.(*sync.Mutex)
    		mu.Lock()
    		defer mu.Unlock()
    	}
    
    	cmd := str.StringList(cmdline...)
    	if os.Getenv("TESTGOVCS") == "panic" {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Apr 14 18:50:24 UTC 2024
    - 12.8K bytes
    - Viewed (0)
Back to top