Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for acquireFor (0.23 sec)

  1. 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();
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 31.7K bytes
    - Viewed (0)
  2. 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();
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 30.9K bytes
    - Viewed (0)
  3. 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) {
    Go
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Mon Feb 13 09:26:38 GMT 2023
    - 2.3K bytes
    - Viewed (0)
Back to top