Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 260 for ONCE (0.27 sec)

  1. src/sync/once.go

    // first time for this instance of [Once]. In other words, given
    //
    //	var once Once
    //
    // if once.Do(f) is called multiple times, only the first call will invoke f,
    // even if f has a different value in each invocation. A new instance of
    // Once is required for each function to execute.
    //
    // Do is intended for initialization that must be run exactly once. Since f
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 2.5K bytes
    - Viewed (0)
  2. src/sync/example_test.go

    }
    
    func ExampleOnce() {
    	var once sync.Once
    	onceBody := func() {
    		fmt.Println("Only once")
    	}
    	done := make(chan bool)
    	for i := 0; i < 10; i++ {
    		go func() {
    			once.Do(onceBody)
    			done <- true
    		}()
    	}
    	for i := 0; i < 10; i++ {
    		<-done
    	}
    	// Output:
    	// Only once
    }
    
    // This example uses OnceValue to perform an "expensive" computation just once,
    // even when used concurrently.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 23 17:45:47 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apiserver/pkg/endpoints/filterlatency/filterlatency_test.go

    	w := httptest.NewRecorder()
    	wrapped.ServeHTTP(w, testRequest)
    
    	if handlerCallCount != 1 {
    		t.Errorf("expected the given handler to be invoked once, but was actually invoked %d times", handlerCallCount)
    	}
    	if actionCallCount != 1 {
    		t.Errorf("expected the action callback to be invoked once, but was actually invoked %d times", actionCallCount)
    	}
    	if filterRecordGot == nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Jun 07 17:57:37 UTC 2024
    - 7.1K bytes
    - Viewed (0)
  4. platforms/core-runtime/service-provider/src/main/java/org/gradle/internal/service/scopes/GradleModuleServices.java

     */
    @ServiceScope(Scope.Global.class)
    public interface GradleModuleServices extends ServiceRegistrationProvider {
        /**
         * Called once per process, to register any globally scoped services. These services are reused across builds in the same process.
         * The services are closed when the process finishes.
         *
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon May 27 12:34:44 UTC 2024
    - 5.3K bytes
    - Viewed (0)
  5. src/crypto/x509/root.go

    //
    // Do not remove or change the type signature.
    // See go.dev/issue/67401.
    //
    //go:linkname systemRoots
    var (
    	once           sync.Once
    	systemRootsMu  sync.RWMutex
    	systemRoots    *CertPool
    	systemRootsErr error
    	fallbacksSet   bool
    )
    
    func systemRootsPool() *CertPool {
    	once.Do(initSystemRoots)
    	systemRootsMu.RLock()
    	defer systemRootsMu.RUnlock()
    	return systemRoots
    }
    
    func initSystemRoots() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 29 17:58:53 UTC 2024
    - 2.3K bytes
    - Viewed (0)
  6. internal/cachevalue/cache.go

    	// The returned value can no longer be modified once returned.
    	// Should be set before calling Get().
    	updateFn func(ctx context.Context) (T, error)
    
    	// ttl for a cached value.
    	ttl time.Duration
    
    	opts Opts
    
    	// Once can be used to initialize values for lazy initialization.
    	// Should be set before calling Get().
    	Once sync.Once
    
    	// Managed values.
    	val          atomic.Pointer[T]
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 12:50:46 UTC 2024
    - 4.4K bytes
    - Viewed (0)
  7. src/mime/type.go

    	".pdf":  "application/pdf",
    	".png":  "image/png",
    	".svg":  "image/svg+xml",
    	".wasm": "application/wasm",
    	".webp": "image/webp",
    	".xml":  "text/xml; charset=utf-8",
    }
    
    var once sync.Once // guards initMime
    
    var testInitMime, osInitMime func()
    
    func initMime() {
    	if fn := testInitMime; fn != nil {
    		fn()
    	} else {
    		setMimeTypes(builtinTypesLower, builtinTypesLower)
    		osInitMime()
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5K bytes
    - Viewed (0)
  8. architecture/build-state-model.md

    ### Build session state
    
    A "build session" represents a single invocation of Gradle, for example when you run `gradlew build`.
    A session runs the build one or more times.
    For example, when continuous build is enabled, the session may run the build many times, but when it is disabled, the session will run the build once only.
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed May 22 13:39:49 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/internal/aliases/aliases.go

    // [Enabled], which computes the effective value of
    // GODEBUG=gotypesalias=... by invoking the type checker. The Enabled
    // function is expensive and should be called once per task (e.g.
    // package import), not once per call to NewAlias.
    func NewAlias(enabled bool, pos token.Pos, pkg *types.Package, name string, rhs types.Type) *types.TypeName {
    	if enabled {
    		tname := types.NewTypeName(pos, pkg, name, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 1.1K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/telemetry/counter/countertest/countertest.go

    }
    
    // Open enables telemetry data writing to disk.
    // This is supposed to be called once during the program execution
    // (i.e. typically in TestMain), and must not be used with
    // golang.org/x/telemetry/counter.Open.
    func Open(telemetryDir string) {
    	openedMu.Lock()
    	defer openedMu.Unlock()
    	if opened {
    		panic("Open was called more than once")
    	}
    	telemetry.Default = telemetry.NewDir(telemetryDir)
    
    	counter.Open()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 08 16:13:09 UTC 2024
    - 1.5K bytes
    - Viewed (0)
Back to top