Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 37 for donechan (0.12 sec)

  1. test/stress/runstress.go

    	"os/exec"
    	"strconv"
    	"time"
    )
    
    var (
    	v         = flag.Bool("v", false, "verbose")
    	doMaps    = flag.Bool("maps", true, "stress maps")
    	doExec    = flag.Bool("exec", true, "stress exec")
    	doChan    = flag.Bool("chan", true, "stress channels")
    	doNet     = flag.Bool("net", true, "stress networking")
    	doParseGo = flag.Bool("parsego", true, "stress parsing Go (generates garbage)")
    )
    
    func Println(a ...interface{}) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 19:21:35 UTC 2024
    - 3.6K bytes
    - Viewed (0)
  2. cmd/consolelogger.go

    			entry := lastN[(cnt+i)%last]
    			if (entry == log.Info{}) {
    				continue
    			}
    			select {
    			case subCh <- entry:
    			case <-doneCh:
    				return nil
    			}
    		}
    	}
    	return sys.pubsub.Subscribe(madmin.LogMaskAll, subCh, doneCh, filter)
    }
    
    // Init if HTTPConsoleLoggerSys is valid, always returns nil right now
    func (sys *HTTPConsoleLoggerSys) Init(_ context.Context) error {
    	return nil
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 5.5K bytes
    - Viewed (0)
  3. staging/src/k8s.io/apimachinery/pkg/util/wait/loop.go

    func loopConditionUntilContext(ctx context.Context, t Timer, immediate, sliding bool, condition ConditionWithContextFunc) error {
    	defer t.Stop()
    
    	var timeCh <-chan time.Time
    	doneCh := ctx.Done()
    
    	if !sliding {
    		timeCh = t.C()
    	}
    
    	// if immediate is true the condition is
    	// guaranteed to be executed at least once,
    	// if we haven't requested immediate execution, delay once
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 02:47:00 UTC 2023
    - 2.8K bytes
    - Viewed (0)
  4. src/internal/singleflight/singleflight.go

    	}
    	c := new(call)
    	c.wg.Add(1)
    	g.m[key] = c
    	g.mu.Unlock()
    
    	g.doCall(c, key, fn)
    	return c.val, c.err, c.dups > 0
    }
    
    // DoChan is like Do but returns a channel that will receive the
    // results when they are ready.
    func (g *Group) DoChan(key string, fn func() (any, error)) <-chan Result {
    	ch := make(chan Result, 1)
    	g.mu.Lock()
    	if g.m == nil {
    		g.m = make(map[string]*call)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 30 20:49:56 UTC 2022
    - 3.1K bytes
    - Viewed (0)
  5. staging/src/k8s.io/apiserver/pkg/util/flowcontrol/fairqueuing/testing/eventclock/fake.go

    // but rather leaves that up to other actors (e.g., Run).
    func (fec *Fake) Sleep(duration time.Duration) {
    	doneCh := make(chan struct{})
    	fec.EventAfterDuration(func(time.Time) {
    		fec.clientWG.Add(1)
    		close(doneCh)
    	}, duration)
    	fec.clientWG.Add(-1)
    	<-doneCh
    }
    
    // EventAfterDuration schedules the given function to be invoked once
    // the given duration has passed.
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Sun Dec 18 04:27:38 UTC 2022
    - 7.9K bytes
    - Viewed (0)
  6. pkg/kubelet/nodeshutdown/nodeshutdown_manager_linux_test.go

    		return nil
    	}
    	syncNodeStatus := func() {}
    
    	var shutdownChan chan bool
    	var shutdownChanMut sync.Mutex
    	var connChan = make(chan struct{}, 1)
    
    	lock.Lock()
    	systemDbus = func() (dbusInhibiter, error) {
    		defer func() {
    			connChan <- struct{}{}
    		}()
    		ch := make(chan bool)
    		shutdownChanMut.Lock()
    		shutdownChan = ch
    		shutdownChanMut.Unlock()
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Apr 24 18:25:29 UTC 2024
    - 29.8K bytes
    - Viewed (0)
  7. pkg/kubelet/nodeshutdown/nodeshutdown_manager_linux.go

    				}
    			}(pod, group)
    		}
    
    		var (
    			doneCh = make(chan struct{})
    			timer  = m.clock.NewTimer(time.Duration(group.ShutdownGracePeriodSeconds) * time.Second)
    		)
    		go func() {
    			defer close(doneCh)
    			wg.Wait()
    		}()
    
    		select {
    		case <-doneCh:
    			timer.Stop()
    		case <-timer.C():
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Wed Nov 09 08:02:40 UTC 2022
    - 15.5K bytes
    - Viewed (0)
  8. src/internal/singleflight/singleflight_test.go

    	go func() {
    		g.Do(key, func() (i interface{}, e error) {
    			// Notify that we started
    			secondCh <- struct{}{}
    			<-secondCh
    			return 2, nil
    		})
    	}()
    
    	<-secondCh
    
    	resultCh := g.DoChan(key, func() (i interface{}, e error) {
    		panic("third must not be started")
    	})
    
    	if g.ForgetUnshared(key) {
    		t.Errorf("Before first goroutine finished, key %q is shared, should return false", key)
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 29 22:21:50 UTC 2023
    - 3.9K bytes
    - Viewed (0)
  9. cmd/erasure-server-pool-rebalance.go

    		return ps.Participating && ps.Info.Status == rebalStarted
    	}
    	return false
    }
    
    func (z *erasureServerPools) rebalanceBuckets(ctx context.Context, poolIdx int) (err error) {
    	doneCh := make(chan error, 1)
    	defer xioutil.SafeClose(doneCh)
    
    	// Save rebalance.bin periodically.
    	go func() {
    		// Update rebalance.bin periodically once every 5-10s, chosen randomly
    Registered: Sun Jun 16 00:44:34 UTC 2024
    - Last Modified: Mon Jun 03 15:45:54 UTC 2024
    - 27.3K bytes
    - Viewed (0)
  10. staging/src/k8s.io/apimachinery/pkg/util/wait/loop_test.go

    	defer cancel()
    
    	expectedError := errors.New("Expected error")
    	var attempt int
    	f := ConditionFunc(func() (bool, error) {
    		attempt++
    		return false, expectedError
    	})
    
    	doneCh := make(chan struct{})
    	go func() {
    		defer close(doneCh)
    		if err := loopConditionUntilContext(ctx, timerWithClock(backoff.Timer(), fakeClock), false, true, f.WithContext()); err == nil || err != expectedError {
    			t.Errorf("unexpected error: %v", err)
    		}
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Thu Oct 19 02:48:08 UTC 2023
    - 15.8K bytes
    - Viewed (0)
Back to top