Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 1,180 for chan2 (0.05 sec)

  1. src/internal/types/testdata/fixedbugs/issue47115.go

    // license that can be found in the LICENSE file.
    
    package p
    
    type C0 interface{ int }
    type C1 interface{ chan int }
    type C2 interface{ chan int | <-chan int }
    type C3 interface{ chan int | chan float32 }
    type C4 interface{ chan int | chan<- int }
    type C5[T any] interface{ ~chan T | chan<- T }
    
    func _[T any](ch T) {
    	ch <- /* ERRORx `cannot send to ch .* no core type` */ 0
    }
    
    func _[T C0](ch T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 840 bytes
    - Viewed (0)
  2. src/cmd/compile/internal/syntax/printer_test.go

    	// channels
    	dup("package p; type _ chan chan int"),
    	dup("package p; type _ chan (<-chan int)"),
    	dup("package p; type _ chan chan<- int"),
    
    	dup("package p; type _ <-chan chan int"),
    	dup("package p; type _ <-chan <-chan int"),
    	dup("package p; type _ <-chan chan<- int"),
    
    	dup("package p; type _ chan<- chan int"),
    	dup("package p; type _ chan<- <-chan int"),
    	dup("package p; type _ chan<- chan<- int"),
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 31 17:08:18 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  3. src/internal/types/testdata/check/builtins1.go

    	clear(x /* ERROR "cannot clear x" */)
    }
    
    // close
    
    type C0 interface{ int }
    type C1 interface{ chan int }
    type C2 interface{ chan int | <-chan int }
    type C3 interface{ chan int | chan float32 }
    type C4 interface{ chan int | chan<- int }
    type C5[T any] interface{ ~chan T | chan<- T }
    
    func _[T any](ch T) {
    	close(ch /* ERROR "cannot close non-channel" */)
    }
    
    func _[T C0](ch T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 18 21:16:29 UTC 2023
    - 6.8K bytes
    - Viewed (0)
  4. staging/src/k8s.io/apimachinery/pkg/util/httpstream/spdy/connection_test.go

    	if err != nil {
    		t.Errorf("server: error accepting connection: %v", err)
    		return
    	}
    
    	streamChan := make(chan httpstream.Stream)
    	replySentChan := make(chan (<-chan struct{}))
    	spdyConn, err := NewServerConnection(conn, func(stream httpstream.Stream, replySent <-chan struct{}) error {
    		streamChan <- stream
    		replySentChan <- replySent
    		return nil
    	})
    	if err != nil {
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Mar 01 11:58:57 UTC 2023
    - 7.9K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apimachinery/pkg/util/wait/wait_test.go

    	if used != 0 {
    		t.Errorf("Expected exactly zero ticks, got %d", used)
    	}
    }
    
    func TestPollForever(t *testing.T) {
    	ch := make(chan struct{})
    	errc := make(chan error, 1)
    	done := make(chan struct{}, 1)
    	complete := make(chan struct{})
    	go func() {
    		f := ConditionFunc(func() (bool, error) {
    			ch <- struct{}{}
    			select {
    			case <-done:
    				return true, nil
    			default:
    			}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Mar 26 16:28:45 UTC 2024
    - 41.1K bytes
    - Viewed (0)
  6. src/internal/types/testdata/fixedbugs/issue51229.go

    func ch1[P chan<- int]() (_ P)           { return } // core(P) == chan<- int   (single type, no tilde)
    func ch2[P ~chan int]()                  { return } // core(P) == ~chan<- int  (tilde)
    func ch3[P chan E, E any](E)             { return } // core(P) == chan<- E     (single type, no tilde)
    func ch4[P chan E | ~chan<- E, E any](E) { return } // core(P) == ~chan<- E    (tilde)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 17 19:54:27 UTC 2023
    - 4.8K bytes
    - Viewed (0)
  7. src/net/pipe.go

    	// Successful receive on rdRx is always followed by send on rdTx.
    	rdRx <-chan []byte
    	rdTx chan<- int
    
    	// Used by local Write to interact with remote Read.
    	// Successful send on wrTx is always followed by receive on wrRx.
    	wrTx chan<- []byte
    	wrRx <-chan int
    
    	once       sync.Once // Protects closing localDone
    	localDone  chan struct{}
    	remoteDone <-chan struct{}
    
    	readDeadline  pipeDeadline
    	writeDeadline pipeDeadline
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 10 03:29:50 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  8. src/cmd/cgo/internal/teststdio/testdata/chain.go

    const N = 10
    const R = 5
    
    func link(left chan<- int, right <-chan int) {
    	// Keep the links in dedicated operating system
    	// threads, so that this program tests coordination
    	// between pthreads and not just goroutines.
    	runtime.LockOSThread()
    	for {
    		v := <-right
    		stdio.Stdout.WriteString(strconv.Itoa(v) + "\n")
    		left <- 1 + v
    	}
    }
    
    func main() {
    	leftmost := make(chan int)
    	var left chan int
    	right := leftmost
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 12 11:59:56 UTC 2023
    - 914 bytes
    - Viewed (0)
  9. pkg/kube/krt/sync.go

    package krt
    
    import "istio.io/istio/pkg/kube"
    
    type Syncer interface {
    	WaitUntilSynced(stop <-chan struct{}) bool
    	HasSynced() bool
    }
    
    var (
    	_ Syncer = channelSyncer{}
    	_ Syncer = pollSyncer{}
    )
    
    type channelSyncer struct {
    	name   string
    	synced <-chan struct{}
    }
    
    func (c channelSyncer) WaitUntilSynced(stop <-chan struct{}) bool {
    	return waitForCacheSync(c.name, stop, c.synced)
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Apr 03 14:25:07 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  10. src/runtime/race/testdata/time_test.go

    import (
    	"testing"
    	"time"
    )
    
    func TestNoRaceAfterFunc(_ *testing.T) {
    	v := 0
    	_ = v
    	c := make(chan int)
    	f := func() {
    		v = 1
    		c <- 0
    	}
    	v = 2
    	time.AfterFunc(1, f)
    	<-c
    	v = 3
    }
    
    func TestNoRaceAfterFuncReset(_ *testing.T) {
    	v := 0
    	_ = v
    	c := make(chan int)
    	f := func() {
    		v = 1
    		c <- 0
    	}
    	t := time.AfterFunc(time.Hour, f)
    	t.Stop()
    	v = 2
    	t.Reset(1)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Mar 08 22:34:15 UTC 2024
    - 1.3K bytes
    - Viewed (0)
Back to top