Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 31 for tryLock (0.13 sec)

  1. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/resources/DefaultResourceLockCoordinationServiceTest.groovy

                @Override
                ResourceLockState.Disposition transform(ResourceLockState workerLeaseState) {
                    if (lock1.tryLock() && lock2.tryLock()) {
                        return FINISHED
                    } else {
                        return FAILED
                    }
                }
            })
    
            then:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 11 17:16:10 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java

        assertFalse(lockA.tryLock());
    
        thread.releaseLockAndFinish();
        assertTrue(lockA.tryLock());
      }
    
      public void testReentrantWriteLock_tryLock() throws Exception {
        LockingThread thread = new LockingThread(writeLockA);
        thread.start();
    
        thread.waitUntilHoldingLock();
        assertFalse(writeLockA.tryLock());
        assertFalse(readLockA.tryLock());
    
        thread.releaseLockAndFinish();
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 16.1K bytes
    - Viewed (0)
  3. guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java

        assertFalse(lockA.tryLock());
    
        thread.releaseLockAndFinish();
        assertTrue(lockA.tryLock());
      }
    
      public void testReentrantWriteLock_tryLock() throws Exception {
        LockingThread thread = new LockingThread(writeLockA);
        thread.start();
    
        thread.waitUntilHoldingLock();
        assertFalse(writeLockA.tryLock());
        assertFalse(readLockA.tryLock());
    
        thread.releaseLockAndFinish();
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Wed Sep 06 17:04:31 UTC 2023
    - 16.1K bytes
    - Viewed (0)
  4. guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java

        }
    
        @Override
        public boolean tryLock() {
          aboutToAcquire(this);
          try {
            return super.tryLock();
          } finally {
            lockStateChanged(this);
          }
        }
    
        @Override
        public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
          aboutToAcquire(this);
          try {
            return super.tryLock(timeout, unit);
          } finally {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri Dec 15 19:31:54 UTC 2023
    - 35.9K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java

        }
    
        @Override
        public boolean tryLock() {
          aboutToAcquire(this);
          try {
            return super.tryLock();
          } finally {
            lockStateChanged(this);
          }
        }
    
        @Override
        public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException {
          aboutToAcquire(this);
          try {
            return super.tryLock(timeout, unit);
          } finally {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Fri Dec 15 19:31:54 UTC 2023
    - 35.9K bytes
    - Viewed (0)
  6. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/resources/DefaultResourceLockCoordinationService.java

            return new AcquireLocks(resourceLocks, false);
        }
    
        /**
         * Attempts an atomic, non-blocking lock on the provided resource locks.
         */
        public static InternalTransformer<ResourceLockState.Disposition, ResourceLockState> tryLock(ResourceLock... resourceLocks) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 11 17:16:10 UTC 2024
    - 11.9K bytes
    - Viewed (0)
  7. android/guava/src/com/google/common/util/concurrent/Monitor.java

        final ReentrantLock lock = this.lock;
        if (!fair && lock.tryLock()) {
          return true;
        }
        boolean interrupted = Thread.interrupted();
        try {
          final long startTime = System.nanoTime();
          for (long remainingNanos = timeoutNanos; ; ) {
            try {
              return lock.tryLock(remainingNanos, TimeUnit.NANOSECONDS);
            } catch (InterruptedException interrupt) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Mon Dec 04 18:22:01 UTC 2023
    - 38.6K bytes
    - Viewed (0)
  8. guava/src/com/google/common/util/concurrent/Uninterruptibles.java

            }
          }
        } finally {
          if (interrupted) {
            Thread.currentThread().interrupt();
          }
        }
      }
    
      /**
       * Invokes {@code lock.}{@link Lock#tryLock(long, TimeUnit) tryLock(timeout, unit)}
       * uninterruptibly.
       *
       * @since 30.0
       */
      @J2ktIncompatible
      @GwtIncompatible // concurrency
      public static boolean tryLockUninterruptibly(Lock lock, Duration timeout) {
    Registered: Wed Jun 12 16:38:11 UTC 2024
    - Last Modified: Tue Apr 04 09:45:04 UTC 2023
    - 18.7K bytes
    - Viewed (0)
  9. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/work/DefaultWorkerLeaseServiceProjectLockTest.groovy

    import java.util.concurrent.locks.ReentrantLock
    
    import static org.gradle.internal.resources.DefaultResourceLockCoordinationService.lock
    import static org.gradle.internal.resources.DefaultResourceLockCoordinationService.tryLock
    import static org.gradle.internal.resources.DefaultResourceLockCoordinationService.unlock
    import static org.gradle.util.Path.path
    
    class DefaultWorkerLeaseServiceProjectLockTest extends AbstractWorkerLeaseServiceTest {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Apr 05 16:29:26 UTC 2024
    - 25.6K bytes
    - Viewed (0)
  10. src/runtime/mgclimit.go

    		l.bucket.fill -= uint64(-change)
    	}
    	if change != 0 && enabled {
    		l.enabled.Store(false)
    	}
    }
    
    // tryLock attempts to lock l. Returns true on success.
    func (l *gcCPULimiterState) tryLock() bool {
    	return l.lock.CompareAndSwap(0, 1)
    }
    
    // unlock releases the lock on l. Must be called if tryLock returns true.
    func (l *gcCPULimiterState) unlock() {
    	old := l.lock.Swap(0)
    	if old != 1 {
    		throw("double unlock")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 22 22:07:41 UTC 2024
    - 17.3K bytes
    - Viewed (0)
Back to top