Search Options

Results per page
Sort
Preferred Languages
Advance

Results 131 - 140 of 1,571 for chan2 (0.06 sec)

  1. misc/cgo/gmp/fib.go

    // concurrency, just threads and synchronization
    // and foreign code on multiple pthreads.
    
    package main
    
    import (
    	big "."
    	"runtime"
    )
    
    func fibber(c chan *big.Int, out chan string, n int64) {
    	// Keep the fibbers in dedicated operating system
    	// threads, so that this program tests coordination
    	// between pthreads and not just goroutines.
    	runtime.LockOSThread()
    
    	i := big.NewInt(n)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 10 22:32:35 UTC 2023
    - 919 bytes
    - Viewed (0)
  2. src/internal/reflectlite/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: Mon Dec 13 18:45:54 UTC 2021
    - 2.4K bytes
    - Viewed (0)
  3. pkg/kube/portforwarder.go

    	ErrChan() <-chan error
    
    	// WaitForStop blocks until connection closed (e.g. control-C interrupt)
    	WaitForStop()
    }
    
    var _ PortForwarder = &forwarder{}
    
    type forwarder struct {
    	stopCh       chan struct{}
    	restConfig   *rest.Config
    	podName      string
    	ns           string
    	localAddress string
    	localPort    int
    	podPort      int
    	errCh        chan error
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Aug 14 02:12:37 UTC 2023
    - 5.5K bytes
    - Viewed (0)
  4. pkg/volume/util/nestedpendingoperations/nestedpendingoperations_test.go

    		reconcilerPeriod = 100 * time.Millisecond
    	)
    
    	grm := NewNestedPendingOperations(true /* exponentialBackOffOnError */)
    	opZContinueCh := make(chan interface{})
    	op1ContinueCh := make(chan interface{})
    	op2ContinueCh := make(chan interface{})
    	operationZ := generateWaitFunc(opZContinueCh)
    	operation1 := generateWaitFunc(op1ContinueCh)
    	operation2 := generateWaitWithErrorFunc(op2ContinueCh)
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Aug 26 01:29:17 UTC 2022
    - 36.1K bytes
    - Viewed (0)
  5. test/chancap.go

    package main
    
    import (
    	"strings"
    	"unsafe"
    )
    
    type T chan int
    
    const ptrSize = unsafe.Sizeof((*byte)(nil))
    
    func main() {
    	c := make(T, 10)
    	if len(c) != 0 || cap(c) != 10 {
    		println("chan len/cap ", len(c), cap(c), " want 0 10")
    		panic("fail")
    	}
    
    	for i := 0; i < 3; i++ {
    		c <- i
    	}
    	if len(c) != 3 || cap(c) != 10 {
    		println("chan len/cap ", len(c), cap(c), " want 3 10")
    		panic("fail")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Nov 26 14:06:28 UTC 2018
    - 1.6K bytes
    - Viewed (0)
  6. pkg/queue/delay.go

    		workers: 1,
    		queue:   &pq{},
    		execute: make(chan *delayTask, workerChanBuf),
    		enqueue: make(chan *delayTask, 100),
    	}
    	for _, o := range opts {
    		o(q)
    	}
    	return q
    }
    
    type delayQueue struct {
    	workers       int
    	workerStopped []chan struct{}
    
    	// incoming
    	enqueue chan *delayTask
    	// outgoing
    	execute chan *delayTask
    
    	mu    sync.Mutex
    	queue *pq
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Thu Jul 20 06:27:31 UTC 2023
    - 6.7K bytes
    - Viewed (0)
  7. pkg/kubelet/kuberuntime/kuberuntime_termination_order.go

    	to := &terminationOrdering{
    		prereqs:    map[string][]chan struct{}{},
    		terminated: map[string]chan struct{}{},
    	}
    
    	runningContainers := map[string]struct{}{}
    	for _, name := range runningContainerNames {
    		runningContainers[name] = struct{}{}
    	}
    
    	var mainContainerChannels []chan struct{}
    	// sidecar containers need to wait on main containers, so we create a channel per main container
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Oct 18 00:07:21 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  8. src/sync/cond_test.go

    package sync_test
    
    import (
    	"reflect"
    	"runtime"
    	. "sync"
    	"testing"
    )
    
    func TestCondSignal(t *testing.T) {
    	var m Mutex
    	c := NewCond(&m)
    	n := 2
    	running := make(chan bool, n)
    	awake := make(chan bool, n)
    	for i := 0; i < n; i++ {
    		go func() {
    			m.Lock()
    			running <- true
    			c.Wait()
    			awake <- true
    			m.Unlock()
    		}()
    	}
    	for i := 0; i < n; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 22 18:52:42 UTC 2023
    - 5K bytes
    - Viewed (0)
  9. test/fixedbugs/issue8336.go

    package main
    
    type X struct {
    	c chan int
    }
    
    func main() {
    	defer func() {
    		recover()
    	}()
    	var x *X
    	select {
    	case <-x.c: // should fault and panic before foo is called
    	case <-foo():
    	}
    }
    
    func foo() chan int {
    	println("BUG: foo must not be called")
    	return make(chan int)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 02 13:43:18 UTC 2016
    - 515 bytes
    - Viewed (0)
  10. src/runtime/rwmutex_test.go

    )
    
    func parallelReader(m *RWMutex, clocked chan bool, cunlock *atomic.Bool, cdone chan bool) {
    	m.RLock()
    	clocked <- true
    	for !cunlock.Load() {
    	}
    	m.RUnlock()
    	cdone <- true
    }
    
    func doTestParallelReaders(numReaders int) {
    	GOMAXPROCS(numReaders + 1)
    	var m RWMutex
    	m.Init()
    	clocked := make(chan bool, numReaders)
    	var cunlock atomic.Bool
    	cdone := make(chan bool)
    	for i := 0; i < numReaders; i++ {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Dec 15 22:00:45 UTC 2023
    - 4.2K bytes
    - Viewed (0)
Back to top