Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 150 for Unlock (0.21 sec)

  1. internal/lock/lock.go

    	*LockedFile
    	mutex sync.Mutex
    	refs  int // Holds read lock refs.
    }
    
    // IsClosed - Check if the rlocked file is already closed.
    func (r *RLockedFile) IsClosed() bool {
    	r.mutex.Lock()
    	defer r.mutex.Unlock()
    	return r.refs == 0
    }
    
    // IncLockRef - is used by called to indicate lock refs.
    func (r *RLockedFile) IncLockRef() {
    	r.mutex.Lock()
    	r.refs++
    	r.mutex.Unlock()
    }
    
    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)
  2. cmd/bucket-targets.go

    	sys.aMutex.Lock()
    	defer sys.aMutex.Unlock()
    	if v, ok := sys.arnErrsMap[arn]; !ok {
    		sys.arnErrsMap[arn] = arnErrs{
    			updateInProgress: true,
    			count:            v.count + 1,
    			bucket:           bucket,
    		}
    	}
    }
    
    func (sys *BucketTargetSys) markRefreshDone(bucket, arn string) {
    	sys.aMutex.Lock()
    	defer sys.aMutex.Unlock()
    	if v, ok := sys.arnErrsMap[arn]; ok {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 20.9K bytes
    - Viewed (0)
  3. cmd/erasure-server-pool-rebalance.go

    			ok = true
    		}
    	}
    	if ok {
    		lock := z.serverPools[0].NewNSLock(minioMetaBucket, rebalMetaName)
    		lkCtx, err := lock.GetLock(ctx, globalOperationTimeout)
    		if err != nil {
    			rebalanceLogIf(ctx, fmt.Errorf("failed to acquire write lock on %s/%s: %w", minioMetaBucket, rebalMetaName, err))
    			return err
    		}
    		defer lock.Unlock(lkCtx)
    
    		ctx = lkCtx.Context()
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 26.5K bytes
    - Viewed (0)
  4. internal/dsync/drwmutex.go

    }
    
    // Unlock unlocks the write lock.
    //
    // It is a run-time error if dm is not locked on entry to Unlock.
    func (dm *DRWMutex) Unlock(ctx context.Context) {
    	dm.m.Lock()
    	dm.cancelRefresh()
    	dm.m.Unlock()
    
    	restClnts, owner := dm.clnt.GetLockers()
    	// create temp array on stack
    	locks := make([]string, len(restClnts))
    
    	{
    		dm.m.Lock()
    		defer dm.m.Unlock()
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Feb 22 06:26:06 GMT 2024
    - 19.7K bytes
    - Viewed (0)
  5. cmd/namespace-lock.go

    	}
    	timeout.LogSuccess(UTCNow().Sub(start))
    	return LockContext{ctx: newCtx, cancel: cancel}, nil
    }
    
    // Unlock - block until write lock is released.
    func (di *distLockInstance) Unlock(lc LockContext) {
    	if lc.cancel != nil {
    		lc.cancel()
    	}
    	di.rwMutex.Unlock(lc.ctx)
    }
    
    // RLock - block until read lock is taken or timeout has occurred.
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Jun 05 23:56:35 GMT 2023
    - 9.2K bytes
    - Viewed (0)
  6. internal/dsync/drwmutex_test.go

    	mu := NewDRWMutex(ds, "test-runlock-panic-2")
    	defer func() {
    		if recover() == nil {
    			t.Fatalf("read unlock of unlocked RWMutex did not panic")
    		}
    		mu.Unlock(context.Background()) // Unlock, so -test.count > 1 works
    	}()
    	mu.Lock(id, source)
    	mu.RUnlock(context.Background())
    }
    
    // Borrowed from rwmutex_test.go
    func benchmarkRWMutex(b *testing.B, localWork, writeRatio int) {
    	b.ResetTimer()
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Sat Dec 24 03:49:07 GMT 2022
    - 9.7K bytes
    - Viewed (0)
  7. internal/lsync/lrwmutex_test.go

    		}
    	}()
    	mu := NewLRWMutex()
    	mu.RLock()
    	mu.Unlock()
    }
    
    // Borrowed from rwmutex_test.go
    func TestRUnlockPanic(t *testing.T) {
    	defer func() {
    		if recover() == nil {
    			t.Fatalf("read unlock of unlocked RWMutex did not panic")
    		}
    	}()
    	mu := NewLRWMutex()
    	mu.RUnlock()
    }
    
    // Borrowed from rwmutex_test.go
    func TestRUnlockPanic2(t *testing.T) {
    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)
  8. 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 21 19:28:08 GMT 2024
    - Last Modified: Mon Oct 18 15:39:59 GMT 2021
    - 1.3K bytes
    - Viewed (0)
  9. internal/logger/targets.go

    func SystemTargets() []Target {
    	swapSystemMuRW.RLock()
    	defer swapSystemMuRW.RUnlock()
    
    	res := systemTargets
    	return res
    }
    
    // AuditTargets returns active audit targets.
    // Returned slice may not be modified in any way.
    func AuditTargets() []Target {
    	swapAuditMuRW.RLock()
    	defer swapAuditMuRW.RUnlock()
    
    	res := auditTargets
    	return res
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Tue Apr 02 22:56:14 GMT 2024
    - 6.1K bytes
    - Viewed (0)
  10. cmd/untar.go

    	r  io.Reader
    	mu sync.Mutex
    }
    
    func (d *disconnectReader) Read(p []byte) (n int, err error) {
    	d.mu.Lock()
    	defer d.mu.Unlock()
    	if d.r != nil {
    		return d.r.Read(p)
    	}
    	return 0, errors.New("reader closed")
    }
    
    func (d *disconnectReader) Close() error {
    	d.mu.Lock()
    	d.r = nil
    	d.mu.Unlock()
    	return nil
    }
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Thu Apr 04 12:04:40 GMT 2024
    - 6K bytes
    - Viewed (0)
Back to top