Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 2,656 for ONCE (0.08 sec)

  1. 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)
  2. futures/README.md

    The modules under this directory will be released exactly once each. Once that
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 12 21:42:09 UTC 2018
    - 141 bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. src/internal/lazytemplate/lazytemplate.go

    // template will be parsed the first time it is needed.
    type Template struct {
    	name, text string
    
    	once sync.Once
    	tmpl *template.Template
    }
    
    func (r *Template) tp() *template.Template {
    	r.once.Do(r.build)
    	return r.tmpl
    }
    
    func (r *Template) build() {
    	r.tmpl = template.Must(template.New(r.name).Parse(r.text))
    	r.name, r.text = "", ""
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.3K bytes
    - Viewed (0)
  7. 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)
  8. 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)
  9. 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)
  10. internal/ioutil/wait_pipe.go

    	"sync"
    )
    
    // PipeWriter is similar to io.PipeWriter with wait group
    type PipeWriter struct {
    	*io.PipeWriter
    	once sync.Once
    	done func()
    }
    
    // CloseWithError close with supplied error the writer end.
    func (w *PipeWriter) CloseWithError(err error) error {
    	err = w.PipeWriter.CloseWithError(err)
    	w.once.Do(func() {
    		w.done()
    	})
    	return err
    }
    
    // PipeReader is similar to io.PipeReader with wait group
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Thu Apr 27 14:55:36 UTC 2023
    - 1.7K bytes
    - Viewed (0)
Back to top