Search Options

Results per page
Sort
Preferred Languages
Advance

Results 111 - 120 of 1,571 for chan2 (0.04 sec)

  1. test/fixedbugs/bug277.go

    		m(x int) int
    	})(s) // this is accepted by 6g
    	i = interface {
    		m(x int) int
    	}(s) // this is not accepted by 6g (but should be)
    	l = []int(l)
    	m = map[string]int(m)
    	c = chan int(c)
    	_ = chan<- int(c)
    	_ = <-(chan int)(c)
    	_ = <-(<-chan int)(c)
    }
    
    /*
    6g bug277.go
    bug277.go:46: syntax error: unexpected (, expecting {
    bug277.go:50: syntax error: unexpected interface
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 18 21:15:42 UTC 2012
    - 1.4K bytes
    - Viewed (0)
  2. src/cmd/go/internal/par/queue_test.go

    	)
    
    	q := NewQueue(maxActive)
    	t.Logf("q = NewQueue(%d)", maxActive)
    
    	var wg sync.WaitGroup
    	wg.Add(totalWork)
    	started := make([]chan struct{}, totalWork)
    	unblock := make(chan struct{})
    	for i := range started {
    		started[i] = make(chan struct{})
    		i := i
    		q.Add(func() {
    			close(started[i])
    			<-unblock
    			wg.Done()
    		})
    	}
    
    	for i, c := range started {
    		if i < maxActive {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 24 21:08:46 UTC 2020
    - 1.4K bytes
    - Viewed (0)
  3. src/go/internal/gccgoimporter/parser_test.go

    	{id: "foo", typ: "<type 1 map [<type -1>] <type -2>>", want: "map[int8]int16"},
    	{id: "foo", typ: "<type 1 chan <type -1>>", want: "chan int8"},
    	{id: "foo", typ: "<type 1 chan <- <type -1>>", want: "<-chan int8"},
    	{id: "foo", typ: "<type 1 chan -< <type -1>>", want: "chan<- int8"},
    	{id: "foo", typ: "<type 1 struct { I8 <type -1>; I16 <type -2> \"i16\"; }>", want: "struct{I8 int8; I16 int16 \"i16\"}"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 26 20:35:55 UTC 2018
    - 2.8K bytes
    - Viewed (0)
  4. src/runtime/race/testdata/regression_test.go

    	var s stack
    	go func(s *stack) {}(&s)
    	s.push(1)
    	x := s.pop()
    	_ = x
    }
    
    type RpcChan struct {
    	c chan bool
    }
    
    var makeChanCalls int
    
    //go:noinline
    func makeChan() *RpcChan {
    	makeChanCalls++
    	c := &RpcChan{make(chan bool, 1)}
    	c.c <- true
    	return c
    }
    
    func call() bool {
    	x := <-makeChan().c
    	return x
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Nov 03 02:01:34 UTC 2015
    - 2.7K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/promise/promise_test.go

    }
    
    func goGetExpectNotYet(t *testing.T, wr WriteOnce, gots chan interface{}, trigger string) {
    	go func() {
    		gots <- wr.Get()
    	}()
    	select {
    	case <-gots:
    		t.Errorf("Get returned before %s", trigger)
    	case <-time.After(time.Second):
    		t.Log("Good: Get did not return yet")
    	}
    }
    
    func goGetAndExpect(t *testing.T, wr WriteOnce, gots chan interface{}, expected interface{}) {
    	go func() {
    		gots <- wr.Get()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Mon Aug 21 19:19:31 UTC 2023
    - 3K bytes
    - Viewed (0)
  6. src/runtime/race/testdata/issue12664_test.go

    var issue12664 = "hi"
    
    func TestRaceIssue12664(t *testing.T) {
    	c := make(chan struct{})
    	go func() {
    		issue12664 = "bye"
    		close(c)
    	}()
    	fmt.Println(issue12664)
    	<-c
    }
    
    type MyI interface {
    	foo()
    }
    
    type MyT int
    
    func (MyT) foo() {
    }
    
    var issue12664_2 MyT = 0
    
    func TestRaceIssue12664_2(t *testing.T) {
    	c := make(chan struct{})
    	go func() {
    		issue12664_2 = 1
    		close(c)
    	}()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 1.1K bytes
    - Viewed (0)
  7. test/chan/select3.go

    		}
    		c <- always // f blocked always
    	}()
    	if <-c != signal {
    		panic(signal + " block")
    	}
    }
    
    func main() {
    	const async = 1 // asynchronous channels
    	var nilch chan int
    	closedch := make(chan int)
    	close(closedch)
    
    	// sending/receiving from a nil channel blocks
    	testBlock(always, func() {
    		nilch <- 7
    	})
    	testBlock(always, func() {
    		<-nilch
    	})
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Jul 08 02:10:12 UTC 2017
    - 4.1K bytes
    - Viewed (0)
  8. src/runtime/race/testdata/rwmutex_test.go

    	var mu2 sync.RWMutex
    	var x int16 = 0
    	_ = x
    	ch := make(chan bool, 2)
    	go func() {
    		mu1.Lock()
    		defer mu1.Unlock()
    		x = 1
    		ch <- true
    	}()
    	go func() {
    		mu2.Lock()
    		x = 2
    		mu2.Unlock()
    		ch <- true
    	}()
    	<-ch
    	<-ch
    }
    
    func TestNoRaceRWMutex(t *testing.T) {
    	var mu sync.RWMutex
    	var x, y int64 = 0, 1
    	_ = y
    	ch := make(chan bool, 2)
    	go func() {
    		mu.Lock()
    		defer mu.Unlock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 03 22:09:38 UTC 2017
    - 2.1K bytes
    - Viewed (0)
  9. pilot/pkg/server/instance.go

    }
    
    var _ Instance = &instance{}
    
    // New creates a new server Instance.
    func New() Instance {
    	return &instance{
    		done:       make(chan struct{}),
    		components: make(chan task, 1000), // should be enough?
    	}
    }
    
    type instance struct {
    	components chan task
    	done       chan struct{}
    
    	// requiredTerminations keeps track of tasks that should block instance exit
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Tue May 23 17:08:31 UTC 2023
    - 4.6K bytes
    - Viewed (0)
  10. src/runtime/race/testdata/mutex_test.go

    	var mu sync.Mutex
    	var x int16 = 0
    	_ = x
    	ch := make(chan bool, 2)
    	go func() {
    		mu.Lock()
    		defer mu.Unlock()
    		x = 1
    		ch <- true
    	}()
    	go func() {
    		mu.Lock()
    		x = 2
    		mu.Unlock()
    		ch <- true
    	}()
    	<-ch
    	<-ch
    }
    
    func TestRaceMutex(t *testing.T) {
    	var mu sync.Mutex
    	var x int16 = 0
    	_ = x
    	ch := make(chan bool, 2)
    	go func() {
    		x = 1
    		mu.Lock()
    		defer mu.Unlock()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 23 22:14:38 UTC 2021
    - 2K bytes
    - Viewed (0)
Back to top