Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 2,380 for ONCE (0.04 sec)

  1. src/io/pipe.go

    	if err == nil {
    		err = ErrClosedPipe
    	}
    	p.rerr.Store(err)
    	p.once.Do(func() { close(p.done) })
    	return nil
    }
    
    func (p *pipe) write(b []byte) (n int, err error) {
    	select {
    	case <-p.done:
    		return 0, p.writeCloseError()
    	default:
    		p.wrMu.Lock()
    		defer p.wrMu.Unlock()
    	}
    
    	for once := true; once || len(b) > 0; once = false {
    		select {
    		case p.wrCh <- b:
    			nw := <-p.rdCh
    			b = b[nw:]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 18 19:34:35 UTC 2023
    - 5.1K bytes
    - Viewed (0)
  2. 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)
  3. src/cmd/go/internal/vcweb/fossil.go

    import (
    	"fmt"
    	"log"
    	"net/http"
    	"net/http/cgi"
    	"os"
    	"os/exec"
    	"path/filepath"
    	"sync"
    )
    
    type fossilHandler struct {
    	once          sync.Once
    	fossilPath    string
    	fossilPathErr error
    }
    
    func (h *fossilHandler) Available() bool {
    	h.once.Do(func() {
    		h.fossilPath, h.fossilPathErr = exec.LookPath("fossil")
    	})
    	return h.fossilPathErr == nil
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 21 17:47:26 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  4. src/mime/type_test.go

    package mime
    
    import (
    	"reflect"
    	"strings"
    	"sync"
    	"testing"
    )
    
    func setMimeInit(fn func()) (cleanup func()) {
    	once = sync.Once{}
    	testInitMime = fn
    	return func() {
    		testInitMime = nil
    		once = sync.Once{}
    	}
    }
    
    func clearMimeTypes() {
    	setMimeTypes(map[string]string{}, map[string]string{})
    }
    
    func setType(ext, typ string) {
    	if !strings.HasPrefix(ext, ".") {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 08 21:09:03 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  5. src/net/pipe.go

    	case isClosedChan(p.writeDeadline.wait()):
    		return 0, os.ErrDeadlineExceeded
    	}
    
    	p.wrMu.Lock() // Ensure entirety of b is written together
    	defer p.wrMu.Unlock()
    	for once := true; once || len(b) > 0; once = false {
    		select {
    		case p.wrTx <- b:
    			nw := <-p.wrRx
    			b = b[nw:]
    			n += nw
    		case <-p.localDone:
    			return n, io.ErrClosedPipe
    		case <-p.remoteDone:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  6. subprojects/composite-builds/src/integTest/groovy/org/gradle/integtests/composite/CompositeBuildMinimalConfigurationIntegrationTest.groovy

                    compositeSubstitute()
                }
            }
        }
    
        def "build with discovered substitutions that is not required for dependency substitution is configured only once"() {
            given:
            dependency "org.test:buildB:1.0"
    
            includeBuild buildB
            includeBuild buildC
    
            when:
            buildC.buildFile << """
                println 'Configured buildC'
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Dec 01 20:36:42 UTC 2022
    - 6.4K bytes
    - Viewed (0)
  7. src/sync/oncefunc_test.go

    var (
    	onceFunc = sync.OnceFunc(func() {})
    
    	onceFuncOnce sync.Once
    )
    
    func doOnceFunc() {
    	onceFuncOnce.Do(func() {})
    }
    
    func BenchmarkOnceFunc(b *testing.B) {
    	b.Run("v=Once", func(b *testing.B) {
    		b.ReportAllocs()
    		for i := 0; i < b.N; i++ {
    			// The baseline is direct use of sync.Once.
    			doOnceFunc()
    		}
    	})
    	b.Run("v=Global", func(b *testing.B) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 21 17:31:33 UTC 2023
    - 6.9K bytes
    - Viewed (0)
  8. 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)
  9. subprojects/core/src/test/groovy/org/gradle/deployment/internal/DefaultDeploymentRegistryTest.groovy

            when:
            registry.get("id", TestDeploymentHandle)
            then:
            def e = thrown(IllegalStateException)
            e.message == "Cannot modify deployment handles once the registry has been stopped."
        }
    
        def "cannot register a handle once the registry is stopped" () {
            given:
            registry.stop()
    
            when:
            registry.start("id", DeploymentRegistry.ChangeBehavior.NONE, TestDeploymentHandle)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Mar 08 13:46:07 UTC 2024
    - 4.6K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/util/wait/loop.go

    	var timeCh <-chan time.Time
    	doneCh := ctx.Done()
    
    	if !sliding {
    		timeCh = t.C()
    	}
    
    	// if immediate is true the condition is
    	// guaranteed to be executed at least once,
    	// if we haven't requested immediate execution, delay once
    	if immediate {
    		if ok, err := func() (bool, error) {
    			defer runtime.HandleCrash()
    			return condition(ctx)
    		}(); err != nil || ok {
    			return err
    		}
    	}
    
    	if sliding {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 02:47:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
Back to top