Search Options

Results per page
Sort
Preferred Languages
Advance

Results 81 - 90 of 1,571 for chan2 (0.04 sec)

  1. src/internal/types/testdata/examples/functions.go

    // Thus even if a type can be inferred successfully, the function
    // call may not be valid.
    
    func fboth[T any](chan T) {}
    func frecv[T any](<-chan T) {}
    func fsend[T any](chan<- T) {}
    
    func _() {
    	var both chan int
    	var recv <-chan int
    	var send chan<-int
    
    	fboth(both)
    	fboth(recv /* ERROR "cannot use" */ )
    	fboth(send /* ERROR "cannot use" */ )
    
    	frecv(both)
    	frecv(recv)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 30 20:19:38 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  2. 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)
  3. src/go/printer/testdata/declarations.input

    func _() (x int)
    func _() (x (int))
    func _() (x (((((int))))))
    
    // special cases: some channel types require parentheses
    func _(x chan(<-chan int))
    func _(x (chan(<-chan int)))
    func _(x ((((chan(<-chan int))))))
    
    func _(x chan<-(chan int))
    func _(x (chan<-(chan int)))
    func _(x ((((chan<-(chan int))))))
    
    // don't introduce comma after last parameter if the closing ) is on the same line
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 13 22:24:31 UTC 2021
    - 16.5K bytes
    - Viewed (0)
  4. internal/grid/muxserver.go

    		if debugPrint {
    			fmt.Println("connected stream mux:", ack.MuxID)
    		}
    	}()
    
    	// Data inbound to the handler
    	var handlerIn chan []byte
    	if inboundCap > 0 {
    		m.inbound = make(chan []byte, inboundCap)
    		handlerIn = make(chan []byte, 1)
    		go func(inbound chan []byte) {
    			wg.Wait()
    			defer xioutil.SafeClose(handlerIn)
    			m.handleInbound(c, inbound, handlerIn)
    		}(m.inbound)
    	}
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri Jun 07 15:51:52 UTC 2024
    - 9.7K bytes
    - Viewed (0)
  5. test/stress/runstress.go

    	}
    	Println("did exec")
    }
    
    func stressExec() {
    	gate := make(chan bool, 10) // max execs at once
    	for {
    		gate <- true
    		go func() {
    			doAnExec()
    			<-gate
    		}()
    	}
    }
    
    func ringf(in <-chan int, out chan<- int, donec chan bool) {
    	for {
    		var n int
    		select {
    		case <-donec:
    			return
    		case n = <-in:
    		}
    		if n == 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:35 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  6. pkg/util/goroutinemap/goroutinemap_test.go

    	}
    }
    
    func generateCallbackFunc(done chan<- interface{}) func() error {
    	return func() error {
    		done <- true
    		return nil
    	}
    }
    
    func generateErrorFunc(done <-chan interface{}) func() error {
    	return func() error {
    		<-done
    		return fmt.Errorf("Generic error")
    	}
    }
    
    func generateWaitFunc(done <-chan interface{}) func() error {
    	return func() error {
    		<-done
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Jan 11 14:09:48 UTC 2017
    - 14.9K bytes
    - Viewed (0)
  7. test/fixedbugs/bug222.dir/chanbug.go

    // Copyright 2009 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 chanbug
    var C chan<- (chan int)
    var D chan<- func()
    var E func() chan int
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jan 24 19:48:15 UTC 2012
    - 263 bytes
    - Viewed (0)
  8. src/runtime/proc_test.go

    			// iteration is 2 * (runtime overhead + chan
    			// send/receive pair + delay + wakeDelay). This allows
    			// the runtime overhead, including the time it takes
    			// for the unblocked goroutine to be scheduled, to be
    			// estimated.
    			ping, pong := make(chan struct{}), make(chan struct{})
    			start := make(chan struct{})
    			done := make(chan struct{})
    			go func() {
    				<-start
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jun 14 00:03:57 UTC 2023
    - 25.8K bytes
    - Viewed (0)
  9. src/go/types/typestring_test.go

    	// maps
    	dup("map[string]int"),
    	{"map[struct{x, y int}][]byte", "map[struct{x int; y int}][]byte"},
    
    	// channels
    	dup("chan<- chan int"),
    	dup("chan<- <-chan int"),
    	dup("<-chan <-chan int"),
    	dup("chan (<-chan int)"),
    	dup("chan<- func()"),
    	dup("<-chan []func() int"),
    }
    
    // types that depend on other type declarations (src in TestTypes)
    var dependentTestTypes = []testEntry{
    	// interfaces
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Apr 28 17:58:07 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  10. src/internal/trace/testdata/testprog/stacks.go

    	go func() { // func1
    		select {}
    	}()
    	go func() { // func2
    		var c chan int
    		c <- 0
    	}()
    	go func() { // func3
    		var c chan int
    		<-c
    	}()
    	done1 := make(chan bool)
    	go func() { // func4
    		<-done1
    	}()
    	done2 := make(chan bool)
    	go func() { // func5
    		done2 <- true
    	}()
    	c1 := make(chan int)
    	c2 := make(chan int)
    	go func() { // func6
    		select {
    		case <-c1:
    		case <-c2:
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 17 18:48:18 UTC 2024
    - 2.4K bytes
    - Viewed (0)
Back to top