- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 22 for getBlocks (0.1 sec)
-
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) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Sep 29 22:40:36 UTC 2024 - 9.2K bytes - Viewed (0) -
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...")
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Mar 05 04:57:35 UTC 2023 - 7.9K bytes - Viewed (0) -
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}) {
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Dec 24 03:49:07 UTC 2022 - 9.7K bytes - Viewed (0) -
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) }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Jan 02 17:15:06 UTC 2022 - 4.8K bytes - Viewed (0) -
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 }
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sun Sep 29 22:40:36 UTC 2024 - 89.8K bytes - Viewed (0) -
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.
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Sep 09 15:49:49 UTC 2024 - 20.4K bytes - Viewed (0) -
internal/dsync/dsync_test.go
} dm := NewDRWMutex(ds, "aap") dm.refreshInterval = testDrwMutexRefreshInterval ctx, cancel := context.WithCancel(context.Background()) if !dm.GetLock(ctx, cancel, id, source, Options{Timeout: 5 * time.Minute}) { t.Fatal("GetLock() should be successful") } // Make it run twice. timer := time.NewTimer(testDrwMutexRefreshInterval * 2) select { case <-ctx.Done():
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Wed Jun 19 14:35:19 UTC 2024 - 11.1K bytes - Viewed (0) -
cmd/shared-lock.go
lockContext chan LockContext } func (ld sharedLock) backgroundRoutine(ctx context.Context, objAPI ObjectLayer, lockName string) { for { locker := objAPI.NewNSLock(minioMetaBucket, lockName) lkctx, err := locker.GetLock(ctx, sharedLockTimeout) if err != nil { continue } keepLock: for { select { case <-ctx.Done(): return case <-lkctx.Context().Done():
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Mon Feb 13 09:26:38 UTC 2023 - 2.3K bytes - Viewed (0) -
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. //
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Thu Oct 31 22:10:24 UTC 2024 - 78.8K bytes - Viewed (0) -
cmd/callhome.go
} func runCallhome(ctx context.Context, objAPI ObjectLayer) bool { // Make sure only 1 callhome is running on the cluster. locker := objAPI.NewNSLock(minioMetaBucket, "callhome/runCallhome.lock") lkctx, err := locker.GetLock(ctx, callhomeLeaderLockTimeout) if err != nil { // lock timedout means some other node is the leader, // cycle back return 'true' return true } ctx = lkctx.Context() defer locker.Unlock(lkctx)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Fri May 17 16:53:34 UTC 2024 - 5.3K bytes - Viewed (0)