Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 205 for locked (0.21 sec)

  1. internal/dsync/locked_rand.go

    func (r *lockedRandSource) Int63() (n int64) {
    	r.lk.Lock()
    	n = r.src.Int63()
    	r.lk.Unlock()
    	return
    }
    
    // Seed uses the provided seed value to initialize the generator to a
    // deterministic state.
    func (r *lockedRandSource) Seed(seed int64) {
    	r.lk.Lock()
    	r.src.Seed(seed)
    	r.lk.Unlock()
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Oct 18 15:39:59 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  2. internal/dsync/drwmutex.go

    			if sendRelease(ctx, ds, restClnts[lockID], owner, (*locks)[lockID], isReadLock, names...) {
    				(*locks)[lockID] = ""
    			}
    		}(lockID)
    	}
    	wg.Wait()
    
    	// Return true if releaseAll was successful, otherwise we return 'false'
    	// to indicate we haven't sufficiently unlocked lockers to avoid deadlocks.
    	//
    	// Caller may use this as an indication to call again.
    	return !checkFailedUnlocks(*locks, tolerance)
    }
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  3. internal/lsync/lrwmutex_test.go

    	wl := NewLRWMutex()
    	var rl sync.Locker
    	wlocked := make(chan bool, 1)
    	rlocked := make(chan bool, 1)
    	rl = wl.DRLocker()
    	n := 10
    	go func() {
    		for i := 0; i < n; i++ {
    			rl.Lock()
    			rl.Lock()
    			rlocked <- true
    			wl.Lock()
    			wlocked <- true
    		}
    	}()
    	for i := 0; i < n; i++ {
    		<-rlocked
    		rl.Unlock()
    		select {
    		case <-wlocked:
    			t.Fatal("RLocker() didn't read-lock it")
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Mar 05 04:57:35 GMT 2023
    - 7.9K bytes
    - Viewed (0)
  4. internal/lock/lock_test.go

    	}
    
    	// unlock the file
    	if err = l.Close(); err != nil {
    		t.Fatal(err)
    	}
    
    	// try lock the unlocked file
    	dupl, err := LockedOpenFile(f.Name(), os.O_WRONLY|os.O_CREATE, 0o600)
    	if err != nil {
    		t.Errorf("err = %v, want %v", err, nil)
    	}
    
    	// blocking on locked file
    	locked := make(chan struct{}, 1)
    	go func() {
    		bl, blerr := LockedOpenFile(f.Name(), os.O_WRONLY, 0o600)
    		if blerr != nil {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.6K bytes
    - Viewed (0)
  5. internal/dsync/drwmutex_test.go

    	}
    	// fmt.Println("Write lock failed due to timeout")
    	return
    }
    
    func TestSimpleWriteLockAcquired(t *testing.T) {
    	locked := testSimpleWriteLock(t, 10*testDrwMutexAcquireTimeout)
    
    	expected := true
    	if locked != expected {
    		t.Errorf("TestSimpleWriteLockAcquired(): \nexpected %#v\ngot      %#v", expected, locked)
    	}
    }
    
    func TestSimpleWriteLockTimedOut(t *testing.T) {
    	locked := testSimpleWriteLock(t, testDrwMutexAcquireTimeout)
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Sat Dec 24 03:49:07 GMT 2022
    - 9.7K bytes
    - Viewed (0)
  6. cmd/local-locker.go

    	}
    
    	l.mutex.Lock()
    	defer l.mutex.Unlock()
    	var lri []lockRequesterInfo
    
    	resource := args.Resources[0]
    	if lri, reply = l.lockMap[resource]; !reply {
    		// No lock is held on the given name
    		return true, nil
    	}
    	if isWriteLock(lri) {
    		// A write-lock is held, cannot release a read lock
    		return false, fmt.Errorf("RUnlock attempted on a write locked entity: %s", resource)
    	}
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Feb 19 22:54:46 GMT 2024
    - 10.6K bytes
    - Viewed (0)
  7. internal/lock/lock.go

    // Package lock - implements filesystem locking wrappers around an
    // open file descriptor.
    package lock
    
    import (
    	"errors"
    	"os"
    	"sync"
    )
    
    // ErrAlreadyLocked is returned if the underlying fd is already locked.
    var ErrAlreadyLocked = errors.New("file already locked")
    
    // RLockedFile represents a read locked file, implements a special
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sun Jan 02 17:15:06 GMT 2022
    - 2.5K bytes
    - Viewed (0)
  8. cmd/namespace-lock.go

    	} else {
    		locked = nsLk.GetLock(ctx, opsID, lockSource, timeout)
    	}
    
    	if !locked { // We failed to get the lock
    		// Decrement ref count since we failed to get the lock
    		n.lockMapMutex.Lock()
    		n.lockMap[resource].ref--
    		if n.lockMap[resource].ref < 0 {
    			logger.CriticalIf(GlobalContext, errors.New("resource reference count was lower than 0"))
    		}
    		if n.lockMap[resource].ref == 0 {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Jun 05 23:56:35 GMT 2023
    - 9.2K bytes
    - Viewed (0)
  9. cmd/data-scanner.go

    			if i.debug {
    				if obj.VersionID != "" {
    					console.Debugf(applyVersionActionsLogPrefix+" lifecycle: %s v(%s) is locked, not deleting\n", obj.Name, obj.VersionID)
    				} else {
    					console.Debugf(applyVersionActionsLogPrefix+" lifecycle: %s is locked, not deleting\n", obj.Name)
    				}
    			}
    			// add this version back to remaining versions for
    			// subsequent lifecycle policy applications
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Apr 22 17:49:30 GMT 2024
    - 47.4K bytes
    - Viewed (0)
  10. internal/lsync/lrwmutex.go

    	const isWriteLock = false
    	return lm.lockLoop(ctx, id, source, timeout, isWriteLock)
    }
    
    func (lm *LRWMutex) lock(id, source string, isWriteLock bool) (locked bool) {
    	lm.mu.Lock()
    	defer lm.mu.Unlock()
    
    	lm.id = id
    	lm.source = source
    	if isWriteLock {
    		if lm.ref == 0 && !lm.isWriteLock {
    			lm.ref = 1
    			lm.isWriteLock = true
    			locked = true
    		}
    	} else {
    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)
Back to top