Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 194 for mock (0.15 sec)

  1. cmd/lock-rest-server-common_test.go

    package cmd
    
    import (
    	"context"
    	"os"
    	"reflect"
    	"sync"
    	"testing"
    
    	"github.com/minio/minio/internal/dsync"
    )
    
    // Helper function to create a lock server for testing
    func createLockTestServer(ctx context.Context, t *testing.T) (string, *lockRESTServer, string) {
    	obj, fsDir, err := prepareFS(ctx)
    	if err != nil {
    		t.Fatal(err)
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Mar 23 17:26:21 GMT 2023
    - 3.1K bytes
    - Viewed (0)
  2. src/cmd/cgo/internal/test/cgo_thread_lock.go

    Austin Clements <******@****.***> 1684423194 -0400
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu May 18 16:55:07 GMT 2023
    - 939 bytes
    - Viewed (0)
  3. internal/lsync/lrwmutex.go

    }
    
    // RLock holds a read lock on lm.
    //
    // If one or more read lock are already in use, it will grant another lock.
    // Otherwise the calling go routine blocks until the mutex is available.
    func (lm *LRWMutex) RLock() {
    	const isWriteLock = false
    	lm.lockLoop(context.Background(), lm.id, lm.source, 1<<63-1, isWriteLock)
    }
    
    // GetRLock tries to get a read lock on lm before the timeout occurs.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 4.8K bytes
    - Viewed (0)
  4. internal/dsync/dsync-server_test.go

    	// and positive values indicating number of read locks
    	lockMap map[string]int64
    
    	// Refresh returns lock not found if set to true
    	lockNotFound bool
    
    	// Set to true if you want peers servers to do not respond
    	responseDelay int64
    }
    
    func (l *lockServer) setRefreshReply(refreshed bool) {
    	l.mutex.Lock()
    	defer l.mutex.Unlock()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Jan 23 16:46:37 GMT 2023
    - 8.3K bytes
    - Viewed (0)
  5. cmd/site-replication-metrics.go

    	Endpoint string `json:"-"`
    	// Secure is true if the replication target endpoint is secure
    	Secure bool `json:"-"`
    }
    
    func (sr *SRStats) update(st replStat, dID string) {
    	sr.lock.Lock()
    	defer sr.lock.Unlock()
    	srs, ok := sr.M[dID]
    	if !ok {
    		srs = &SRStatus{
    			XferRateLrg: newXferStats(),
    			XferRateSml: newXferStats(),
    		}
    	}
    	srs.Endpoint = st.Endpoint
    	srs.Secure = st.Secure
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Feb 06 06:00:45 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  6. internal/store/batch.go

    func (b *Batch[K, T]) GetByKey(key K) (T, bool) {
    	b.Lock()
    	defer b.Unlock()
    
    	item, ok := b.items[key]
    	return item, ok
    }
    
    // Len returns the no of items in the batch
    func (b *Batch[K, T]) Len() int {
    	b.Lock()
    	defer b.Unlock()
    
    	return len(b.keys)
    }
    
    // IsFull checks if the batch is full or not
    func (b *Batch[K, T]) IsFull() bool {
    	b.Lock()
    	defer b.Unlock()
    
    	return b.isFull()
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Oct 07 15:07:38 GMT 2023
    - 2.5K bytes
    - Viewed (0)
  7. internal/dsync/dsync-client_test.go

    	return false
    }
    
    // Close closes the underlying socket file descriptor.
    func (restClient *ReconnectRESTClient) Close() error {
    	return nil
    }
    
    var (
    	errLockConflict = errors.New("lock conflict")
    	errLockNotFound = errors.New("lock not found")
    )
    
    func toLockError(err error) error {
    	if err == nil {
    		return nil
    	}
    
    	switch err.Error() {
    	case errLockConflict.Error():
    		return errLockConflict
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Jan 20 17:36:09 GMT 2022
    - 4.4K bytes
    - Viewed (0)
  8. internal/event/targetlist.go

    func (list *TargetList) incCurrentSendCalls(id TargetID) {
    	list.statLock.Lock()
    	defer list.statLock.Unlock()
    
    	stats, ok := list.targetStats[id]
    	if !ok {
    		stats = targetStat{}
    	}
    
    	stats.currentSendCalls++
    	list.targetStats[id] = stats
    	return
    }
    
    func (list *TargetList) decCurrentSendCalls(id TargetID) {
    	list.statLock.Lock()
    	defer list.statLock.Unlock()
    
    	stats, ok := list.targetStats[id]
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 9.2K bytes
    - Viewed (0)
  9. cmd/iam-store.go

    type IAMStorageAPI interface {
    	// The role of the read-write lock is to prevent go routines from
    	// concurrently reading and writing the IAM storage. The (r)lock()
    	// functions return the iamCache. The cache can be safely written to
    	// only when returned by `lock()`.
    	lock() *iamCache
    	unlock()
    	rlock() *iamCache
    	runlock()
    	getUsersSysType() UsersSysType
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 74.4K bytes
    - Viewed (2)
  10. internal/grid/muxclient.go

    		if m.cancelFn != nil {
    			m.cancelFn(context.Canceled)
    		}
    		// Wait for senders to release.
    		m.respMu.Lock()
    	}
    
    	defer m.respMu.Unlock()
    	m.closeLocked()
    }
    
    func (m *muxClient) closeLocked() {
    	if m.closed {
    		return
    	}
    	// We hold the lock, so nobody can modify m.respWait while we're closing.
    	if m.respWait != nil {
    		xioutil.SafeClose(m.respWait)
    		m.respWait = nil
    	}
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 14.2K bytes
    - Viewed (0)
Back to top