- Sort Score
- Result 10 results
- Languages All
Results 1 - 7 of 7 for GetRLock (0.07 sec)
-
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) -
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.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) -
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) -
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/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)
Registered: Sun Nov 03 19:28:11 UTC 2024 - Last Modified: Sat Oct 05 05:16:15 UTC 2024 - 117.4K bytes - Viewed (0)