Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for GetRLock (0.2 sec)

  1. cmd/namespace-lock.go

    )
    
    // local lock servers
    var globalLockServer *localLocker
    
    // RWLocker - locker interface to introduce GetRLock, RUnlock.
    type RWLocker interface {
    	GetLock(ctx context.Context, timeout *dynamicTimeout) (lkCtx LockContext, timedOutErr error)
    	Unlock(lkCtx LockContext)
    	GetRLock(ctx context.Context, timeout *dynamicTimeout) (lkCtx LockContext, timedOutErr error)
    	RUnlock(lkCtx LockContext)
    }
    
    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)
  2. internal/lsync/lrwmutex.go

    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.
    func (lm *LRWMutex) GetRLock(ctx context.Context, id string, source string, timeout time.Duration) (locked bool) {
    	const isWriteLock = false
    	return lm.lockLoop(ctx, id, source, timeout, isWriteLock)
    }
    
    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)
  3. internal/lsync/lrwmutex_test.go

    func testSimpleWriteLock(t *testing.T, duration time.Duration) (locked bool) {
    	ctx := context.Background()
    	lrwm := NewLRWMutex()
    
    	if !lrwm.GetRLock(ctx, "", "object1", time.Second) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("1st read lock acquired, waiting...")
    
    	if !lrwm.GetRLock(ctx, "", "object1", time.Second) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("2nd read lock acquired, waiting...")
    
    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/dsync/drwmutex_test.go

    	ctx1, cancel1 := context.WithCancel(context.Background())
    	if !drwm1.GetRLock(ctx1, cancel1, id, source, Options{Timeout: time.Second}) {
    		panic("Failed to acquire read lock")
    	}
    	// fmt.Println("1st read lock acquired, waiting...")
    
    	drwm2 := NewDRWMutex(ds, "simplelock")
    	ctx2, cancel2 := context.WithCancel(context.Background())
    	if !drwm2.GetRLock(ctx2, cancel2, id, source, Options{Timeout: time.Second}) {
    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)
  5. cmd/erasure-multipart.go

    	if opts.CheckPrecondFn != nil {
    		// Lock the object before reading.
    		lk := er.NewNSLock(bucket, object)
    		lkctx, err := lk.GetRLock(ctx, globalOperationTimeout)
    		if err != nil {
    			return nil, err
    		}
    		rctx := lkctx.Context()
    		obj, err := er.getObjectInfo(rctx, bucket, object, opts)
    		lk.RUnlock(lkctx)
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 16:44:59 GMT 2024
    - 42.4K bytes
    - Viewed (0)
  6. internal/dsync/drwmutex.go

    		Timeout: drwMutexInfinite,
    	})
    }
    
    // GetRLock tries to get a read lock on dm before the timeout elapses.
    //
    // If one or more read locks are already in use, it will grant another lock.
    // Otherwise the calling go routine blocks until either the mutex becomes
    // available and return success or more time has passed than the timeout
    // value and return false.
    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)
  7. cmd/erasure-object.go

    	nsUnlocker := func() {}
    	defer func() {
    		if unlockOnDefer {
    			nsUnlocker()
    		}
    	}()
    
    	// Acquire lock
    	if !opts.NoLock {
    		lock := er.NewNSLock(bucket, object)
    		lkctx, err := lock.GetRLock(ctx, globalOperationTimeout)
    		if err != nil {
    			return nil, err
    		}
    		ctx = lkctx.Context()
    
    		// Release lock when the metadata is verified, and reader
    		// is ready to be read.
    		//
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 16:44:59 GMT 2024
    - 76.3K bytes
    - Viewed (2)
  8. cmd/erasure-server-pool.go

    	nsUnlocker := func() {}
    	defer func() {
    		if unlockOnDefer {
    			nsUnlocker()
    		}
    	}()
    
    	// Acquire lock
    	if !opts.NoLock {
    		lock := z.NewNSLock(bucket, object)
    		lkctx, err := lock.GetRLock(ctx, globalOperationTimeout)
    		if err != nil {
    			return nil, err
    		}
    		ctx = lkctx.Context()
    		nsUnlocker = func() { lock.RUnlock(lkctx) }
    		unlockOnDefer = true
    	}
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 19 16:44:59 GMT 2024
    - 77.8K bytes
    - Viewed (0)
  9. cmd/object-handlers.go

    		return
    	}
    
    	// Take read lock on object, here so subsequent lower-level
    	// calls do not need to.
    	lock := objectAPI.NewNSLock(bucket, object)
    	lkctx, err := lock.GetRLock(ctx, globalOperationTimeout)
    	if err != nil {
    		writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL)
    		return
    	}
    	ctx = lkctx.Context()
    	defer lock.RUnlock(lkctx)
    
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 05 11:39:31 GMT 2024
    - 124.7K bytes
    - Viewed (0)
Back to top