Search Options

Results per page
Sort
Preferred Languages
Advance

Results 141 - 150 of 1,571 for chan2 (0.16 sec)

  1. test/fixedbugs/issue4313.go

    package main
    
    func main() {
    	c := make(chan int, 1)
    	x := 0
    	select {
    	case c <- x: // should see x = 0, not x = 42 (after makec)
    	case <-makec(&x): // should be evaluated only after c and x on previous line
    	}
    	y := <-c
    	if y != 0 {
    		panic(y)
    	}
    }
    
    func makec(px *int) chan bool {
    	if false { for {} }
    	*px = 42
    	return make(chan bool, 0)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 546 bytes
    - Viewed (0)
  2. test/fixedbugs/issue15281.go

    package main
    
    import "runtime"
    
    func main() {
    	{
    		x := inuse()
    		c := make(chan []byte, 10)
    		c <- make([]byte, 10<<20)
    		close(c)
    		f1(c, x)
    	}
    	{
    		x := inuse()
    		c := make(chan []byte, 10)
    		c <- make([]byte, 10<<20)
    		close(c)
    		f2(c, x)
    	}
    }
    
    func f1(c chan []byte, start int64) {
    	for x := range c {
    		if delta := inuse() - start; delta < 9<<20 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 17 09:45:44 UTC 2020
    - 1.2K bytes
    - Viewed (0)
  3. test/typeparam/issue48191.go

    				return G2(619.2)
    			}(G3(""), 954.0)])
    		}
    		var m7 map[G2]int64
    		var ch7 chan byte
    		var fnc1 func(bool, func(chan G2, struct {
    			h0 G2
    		}, int64) **rune, int) map[complex128]int32 = func(p0 bool, p1 func(chan G2, struct {
    			h0 G2
    		}, int64) **rune, p2 int) map[complex128]int32 {
    			pf2 = pf2
    			as7 = as7
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 19:45:34 UTC 2022
    - 9.7K bytes
    - Viewed (0)
  4. src/reflect/set_test.go

    	x any
    	t any
    	b bool
    }{
    	{new(chan int), new(<-chan int), true},
    	{new(<-chan int), new(chan int), false},
    	{new(*int), new(IntPtr), true},
    	{new(IntPtr), new(*int), true},
    	{new(IntPtr), new(IntPtr1), false},
    	{new(Ch), new(<-chan any), true},
    	// test runs implementsTests too
    }
    
    type IntPtr *int
    type IntPtr1 *int
    type Ch <-chan any
    
    func TestAssignableTo(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 13:56:11 UTC 2022
    - 5.7K bytes
    - Viewed (0)
  5. internal/grid/grid_test.go

    	remoteHost := remote.HostName()
    
    	// 1: Echo
    	serverSent := make(chan struct{})
    	serverCanceled := make(chan struct{})
    	register := func(manager *Manager) {
    		errFatal(manager.RegisterStreamingHandler(handlerTest, StreamHandler{
    			Handle: func(ctx context.Context, payload []byte, _ <-chan []byte, resp chan<- []byte) *RemoteErr {
    				// Send many responses.
    				// Test that this doesn't block.
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Jun 07 15:51:52 UTC 2024
    - 36.4K bytes
    - Viewed (0)
  6. staging/src/k8s.io/apimachinery/pkg/util/wait/wait.go

    func ContextForChannel(parentCh <-chan struct{}) context.Context {
    	return channelContext{stopCh: parentCh}
    }
    
    var _ context.Context = channelContext{}
    
    // channelContext will behave as if the context were cancelled when stopCh is
    // closed.
    type channelContext struct {
    	stopCh <-chan struct{}
    }
    
    func (c channelContext) Done() <-chan struct{} { return c.stopCh }
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 14 19:14:11 UTC 2023
    - 7.1K bytes
    - Viewed (0)
  7. pilot/pkg/bootstrap/configcontroller.go

    		s.addTerminatingStartFunc("ingress status", func(stop <-chan struct{}) error {
    			leaderelection.
    				NewLeaderElection(args.Namespace, args.PodName, leaderelection.IngressController, args.Revision, s.kubeClient).
    				AddRunFunction(func(leaderStop <-chan struct{}) {
    					ingressSyncer := ingress.NewStatusSyncer(s.environment.Watcher, s.kubeClient)
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Feb 28 16:41:38 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  8. src/os/signal/signal_plan9_test.go

    func TestStress(t *testing.T) {
    	dur := 3 * time.Second
    	if testing.Short() {
    		dur = 100 * time.Millisecond
    	}
    	defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
    	done := make(chan bool)
    	finished := make(chan bool)
    	go func() {
    		sig := make(chan os.Signal, 1)
    		Notify(sig, syscall.Note("alarm"))
    		defer Stop(sig)
    	Loop:
    		for {
    			select {
    			case <-sig:
    			case <-done:
    				break Loop
    			}
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sun Mar 14 17:56:50 UTC 2021
    - 3.6K bytes
    - Viewed (0)
  9. test/fixedbugs/issue4323.go

    // forgets to typecheck the declarations in the inlined copy.
    
    package main
    
    type reader struct {
    	C chan T
    }
    
    type T struct{ C chan []byte }
    
    var r = newReader()
    
    func newReader() *reader { return new(reader) }
    
    func (r *reader) Read(n int) ([]byte, error) {
    	req := T{C: make(chan []byte)}
    	r.C <- req
    	return <-req.C, nil
    }
    
    func main() {
    	s, err := r.Read(1)
    	_, _ = s, err
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 610 bytes
    - Viewed (0)
  10. test/fixedbugs/issue8011.go

    // Copyright 2014 The Go Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package main
    
    func main() {
    	c := make(chan chan int, 1)
    	c1 := make(chan int, 1)
    	c1 <- 42
    	c <- c1
    	x := <-<-c
    	if x != 42 {
    		println("BUG:", x, "!= 42")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 330 bytes
    - Viewed (0)
Back to top