Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for Swap (0.21 sec)

  1. cmd/service.go

    	globalServiceFreezeMu.Lock()
    	// Close when we reach 0
    	globalServiceFreezeCnt--
    	if globalServiceFreezeCnt <= 0 {
    		// Set to a nil channel.
    		var _ch chan struct{}
    		if val := globalServiceFreeze.Swap(_ch); val != nil {
    			if ch, ok := val.(chan struct{}); ok && ch != nil {
    				// Close previous non-nil channel.
    				xioutil.SafeClose(ch)
    			}
    		}
    		globalServiceFreezeCnt = 0 // Don't risk going negative.
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Feb 28 07:02:14 GMT 2024
    - 3.8K bytes
    - Viewed (0)
  2. internal/logger/logger.go

    func uniq(data sort.Interface) (size int) {
    	p, l := 0, data.Len()
    	if l <= 1 {
    		return l
    	}
    	for i := 1; i < l; i++ {
    		if !data.Less(p, i) {
    			continue
    		}
    		p++
    		if p < i {
    			data.Swap(p, i)
    		}
    	}
    	return p + 1
    }
    
    // Remove any duplicates and return unique entries.
    func uniqueEntries(paths []string) []string {
    	sort.Strings(paths)
    	n := uniq(sort.StringSlice(paths))
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 12.2K bytes
    - Viewed (0)
  3. cmd/metacache-entries_test.go

    	"time"
    )
    
    func Test_metaCacheEntries_sort(t *testing.T) {
    	entries := loadMetacacheSampleEntries(t)
    
    	o := entries.entries()
    	if !o.isSorted() {
    		t.Fatal("Expected sorted objects")
    	}
    
    	// Swap first and last
    	o[0], o[len(o)-1] = o[len(o)-1], o[0]
    	if o.isSorted() {
    		t.Fatal("Expected unsorted objects")
    	}
    
    	sorted := o.sort()
    	if !o.isSorted() {
    		t.Fatal("Expected sorted o objects")
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 31.6K bytes
    - Viewed (0)
  4. cmd/xl-storage-disk-id-check.go

    	// alloc on every call, so we have a clean entry to swap in.
    	t := time.Now().Unix()
    	e.init.Do(func() {
    		e.cached.Store(&AccElem{})
    		atomic.StoreInt64(&e.cachedSec, t)
    	})
    	acc := e.cached.Load()
    	if lastT := atomic.LoadInt64(&e.cachedSec); lastT != t {
    		// Check if lastT was changed by someone else.
    		if atomic.CompareAndSwapInt64(&e.cachedSec, lastT, t) {
    			// Now we swap in a new.
    			newAcc := &AccElem{}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sun Apr 28 17:53:50 GMT 2024
    - 33K bytes
    - Viewed (0)
  5. internal/logger/target/testlogger/testlogger.go

    // Call the returned function to disable logging.
    func (t *testLogger) SetFatalTB(tb testing.TB) func() {
    	return t.setTB(tb, fatalMessage)
    }
    
    func (t *testLogger) setTB(tb testing.TB, action int32) func() {
    	old := t.action.Swap(action)
    	t.current.Store(&tb)
    	return func() {
    		t.current.Store(nil)
    		t.action.Store(old)
    	}
    }
    
    func (t *testLogger) String() string {
    	tb := t.current.Load()
    	if tb != nil {
    		tbb := *tb
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Nov 21 01:09:35 GMT 2023
    - 4K bytes
    - Viewed (0)
  6. cmd/bucket-targets.go

    				epHealth.offlineDuration = prev.offlineDuration
    				epHealth.lastHCAt = prev.lastHCAt
    				epHealth.latency = prev.latency
    			}
    			m[t.Endpoint] = epHealth
    		}
    	}
    	// swap out the map
    	sys.hc = m
    	sys.hMutex.Unlock()
    }
    
    func (sys *BucketTargetSys) healthStats() map[string]epHealth {
    	sys.hMutex.RLock()
    	defer sys.hMutex.RUnlock()
    	m := make(map[string]epHealth, len(sys.hc))
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  7. internal/s3select/sql/value.go

    				a.setBool(bA)
    			} else {
    				return fmt.Errorf("Could not convert %s to a boolean", a.String())
    			}
    
    		default:
    			return errCmpMismatchedTypes
    		}
    		return nil
    
    	case !okA && okB:
    		// swap arguments to avoid repeating code
    		return inferTypesForCmp(b, a)
    
    	default:
    		// Does not happen
    		return nil
    	}
    }
    
    // Value arithmetic functions: we do not expose them outside the
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Feb 25 20:31:19 GMT 2022
    - 20.2K bytes
    - Viewed (0)
Back to top