- Sort Score
- Result 10 results
- Languages All
Results 1 - 2 of 2 for acquireFor (0.04 sec)
-
android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java
} // Lock.tryLock() tests public void testTryLockTimeoutExceeded() { Stopwatch stopwatch = Stopwatch.createStarted(); Lock lock = new ReentrantLock(); Thread lockThread = acquireFor(lock, 5, SECONDS); boolean lockAcquired = tryLockUninterruptibly(lock, 500, MILLISECONDS); assertFalse(lockAcquired); assertAtLeastTimePassed(stopwatch, 500); assertNotInterrupted();
Registered: Fri Sep 05 12:43:10 UTC 2025 - Last Modified: Wed Jul 16 17:42:14 UTC 2025 - 31.7K bytes - Viewed (0) -
cmd/shared-lock.go
func mergeContext(ctx1, ctx2 context.Context) (context.Context, context.CancelFunc) { ctx, cancel := context.WithCancel(context.Background()) go func() { select { case <-ctx1.Done(): case <-ctx2.Done(): // The lock acquirer decides to cancel, exit this goroutine case <-ctx.Done(): } cancel() }() return ctx, cancel } func (ld sharedLock) GetLock(ctx context.Context) (context.Context, context.CancelFunc) {
Registered: Sun Sep 07 19:28:11 UTC 2025 - Last Modified: Mon Feb 13 09:26:38 UTC 2023 - 2.3K bytes - Viewed (0)