Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for WaitGroup (0.1 sec)

  1. cni/pkg/nodeagent/server_test.go

    // Custom "wait group with timeout" for waiting for fakeServer calls in a goroutine to finish
    type WaitGroup struct {
    	count int32
    	done  chan struct{}
    }
    
    func NewWaitGroup() *WaitGroup {
    	return &WaitGroup{
    		done: make(chan struct{}),
    	}
    }
    
    func NewWaitForNCalls(t *testing.T, n int32) (*WaitGroup, func()) {
    	wg := &WaitGroup{
    		done: make(chan struct{}),
    	}
    
    	wg.Add(n)
    	return wg, func() {
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Wed Oct 09 16:05:45 UTC 2024
    - 18.7K bytes
    - Viewed (0)
  2. cmd/erasure.go

    // - Non-healing disks
    // - Healing disks (if inclHealing is true)
    func (er erasureObjects) getOnlineDisksWithHealingAndInfo(inclHealing bool) (newDisks []StorageAPI, newInfos []DiskInfo, healing int) {
    	var wg sync.WaitGroup
    	disks := er.getDisks()
    	infos := make([]DiskInfo, len(disks))
    	r := rand.New(rand.NewSource(time.Now().UnixNano()))
    	for _, i := range r.Perm(len(disks)) {
    		i := i
    		wg.Add(1)
    		go func() {
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Oct 04 22:23:33 UTC 2024
    - 16.1K bytes
    - Viewed (0)
  3. cmd/notification.go

    func (sys *NotificationSys) StorageInfo(ctx context.Context, objLayer ObjectLayer, metrics bool) StorageInfo {
    	var storageInfo StorageInfo
    	replies := make([]StorageInfo, len(sys.peerClients))
    
    	var wg sync.WaitGroup
    	for i, client := range sys.peerClients {
    		if client == nil {
    			continue
    		}
    		wg.Add(1)
    		go func(client *peerRESTClient, idx int) {
    			defer wg.Done()
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 09 16:58:30 UTC 2024
    - 46.2K bytes
    - Viewed (0)
  4. cmd/perf-tests.go

    func selfSpeedTest(ctx context.Context, opts speedTestOpts) (res SpeedTestResult, err error) {
    	objAPI := newObjectLayerFn()
    	if objAPI == nil {
    		return SpeedTestResult{}, errServerNotInitialized
    	}
    
    	var wg sync.WaitGroup
    	var errOnce sync.Once
    	var retError string
    	var totalBytesWritten uint64
    	var totalBytesRead uint64
    
    	objCountPerThread := make([]uint64, opts.concurrency)
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri May 24 23:05:23 UTC 2024
    - 11.8K bytes
    - Viewed (0)
  5. internal/dsync/dsync_test.go

    		// TOTAL
    		time.Sleep(2 * testDrwMutexAcquireTimeout)
    		// fmt.Println("Unlocking dm1")
    
    		dm1st.Unlock(context.Background())
    	}()
    	expect += 2 * testDrwMutexAcquireTimeout
    
    	var wg sync.WaitGroup
    	wg.Add(2)
    
    	go func() {
    		defer wg.Done()
    
    		dm2nd.Lock(id, source)
    
    		// Release lock after 10 seconds
    		go func() {
    			time.Sleep(2 * testDrwMutexAcquireTimeout)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Jun 19 14:35:19 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  6. cmd/erasure-sets.go

    // and re-arranges the disks in proper position.
    func (s *erasureSets) connectDisks(log bool) {
    	defer func() {
    		s.lastConnectDisksOpTime = time.Now()
    	}()
    
    	var wg sync.WaitGroup
    	diskMap := s.getDiskMap()
    	for _, endpoint := range s.endpoints.Endpoints {
    		cdisk := diskMap[endpoint]
    		if cdisk != nil && cdisk.IsOnline() {
    			if s.lastConnectDisksOpTime.IsZero() {
    				continue
    			}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Sep 27 10:41:37 UTC 2024
    - 37K bytes
    - Viewed (1)
  7. internal/dsync/drwmutex.go

    	ctx, cancel := context.WithTimeout(ctx, ds.Timeouts.ForceUnlockCall)
    	defer cancel()
    
    	restClnts, _ := ds.GetLockers()
    
    	args := LockArgs{
    		UID: id,
    	}
    
    	var wg sync.WaitGroup
    	for index, c := range restClnts {
    		wg.Add(1)
    		// Send refresh request to all nodes
    		go func(index int, c NetLocker) {
    			defer wg.Done()
    			c.ForceUnlock(ctx, args)
    		}(index, c)
    	}
    	wg.Wait()
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Sep 09 15:49:49 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  8. cmd/sftp-server-driver.go

    	}
    	for i := range w.buffer {
    		delete(w.buffer, i)
    	}
    	w.wg.Wait()
    	return err
    }
    
    type writerAt struct {
    	w      *io.PipeWriter
    	r      *io.PipeReader
    	wg     *sync.WaitGroup
    	buffer map[int64][]byte
    	err    error
    
    	nextOffset int64
    	m          sync.Mutex
    }
    
    func (w *writerAt) WriteAt(b []byte, offset int64) (n int, err error) {
    	w.m.Lock()
    	defer w.m.Unlock()
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Wed Jun 05 07:51:13 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  9. cmd/metacache-stream.go

    type metacacheWriter struct {
    	streamErr   error
    	mw          *msgp.Writer
    	creator     func() error
    	closer      func() error
    	blockSize   int
    	streamWg    sync.WaitGroup
    	reuseBlocks bool
    }
    
    // newMetacacheWriter will create a serializer that will write objects in given order to the output.
    // Provide a block size that affects latency. If 0 a default of 128KiB will be used.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Apr 04 12:04:40 UTC 2024
    - 19.5K bytes
    - Viewed (0)
  10. cmd/metacache-server-pool.go

    	o.debugln("Raw List", o)
    	filterCh := make(chan metaCacheEntry, o.Limit)
    	listCtx, cancelList := context.WithCancel(ctx)
    	filteredResults := o.gatherResults(listCtx, filterCh)
    	var wg sync.WaitGroup
    	wg.Add(1)
    	var listErr error
    
    	go func(o listPathOptions) {
    		defer wg.Done()
    		o.StopDiskAtLimit = true
    		listErr = z.listMerged(listCtx, o, filterCh)
    		o.debugln("listMerged returned with", listErr)
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Fri Jul 12 16:23:16 UTC 2024
    - 12.7K bytes
    - Viewed (0)
Back to top