Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 54 for tryLock (0.17 sec)

  1. platforms/core-execution/persistent-cache/src/main/java/org/gradle/cache/internal/filelock/LockFileAccess.java

        }
    
        public FileLockOutcome tryLockInfo(boolean shared) throws IOException {
            return lockInfoAccess.tryLock(lockFileAccess, shared);
        }
    
        public FileLockOutcome tryLockState(boolean shared) throws IOException {
            return lockStateAccess.tryLock(lockFileAccess, shared);
        }
    
        /**
         * Reads the lock state from the lock file.
         */
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:08:47 UTC 2023
    - 3.1K bytes
    - Viewed (0)
  2. 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)
  3. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/resources/AbstractTrackedResourceLockTest.groovy

        def "tracks the lock in the current resource lock state and calls provided actions"() {
            given:
            _ * coordinationService.current >> resourceLockState
    
            when:
            lock.tryLock()
    
            then:
            1 * container.lockAcquired(lock)
            1 * resourceLockState.registerLocked(lock)
    
            when:
            lock.unlock()
    
            then:
            1 * container.lockReleased(lock)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  4. 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)
  5. platforms/core-execution/persistent-cache/src/main/java/org/gradle/cache/internal/filelock/LockInfoAccess.java

            lockFileAccess.setLength(Math.min(lockFileAccess.length(), infoRegionPos));
        }
    
        public FileLockOutcome tryLock(RandomAccessFile lockFileAccess, boolean shared) throws IOException {
            try {
                FileLock fileLock = lockFileAccess.getChannel().tryLock(infoRegionPos, INFORMATION_REGION_SIZE - infoRegionPos, shared);
                if (fileLock == null) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Apr 16 15:49:51 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  6. 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)
  7. platforms/core-execution/persistent-cache/src/main/java/org/gradle/cache/internal/filelock/LockStateAccess.java

            } catch (EOFException e) {
                return protocol.createInitialState();
            }
        }
    
        public FileLockOutcome tryLock(RandomAccessFile lockFileAccess, boolean shared) throws IOException {
            try {
                FileLock fileLock = lockFileAccess.getChannel().tryLock(REGION_START, stateRegionSize, shared);
                if (fileLock == null) {
                    return FileLockOutcome.LOCKED_BY_ANOTHER_PROCESS;
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:08:47 UTC 2023
    - 4K bytes
    - Viewed (0)
  8. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/resources/SharedResourceLeaseRegistryTest.groovy

    import java.util.concurrent.CountDownLatch
    
    import static org.gradle.internal.resources.DefaultResourceLockCoordinationService.lock
    import static org.gradle.internal.resources.DefaultResourceLockCoordinationService.tryLock
    import static org.gradle.internal.resources.DefaultResourceLockCoordinationService.unlock
    
    class SharedResourceLeaseRegistryTest extends ConcurrentSpec {
        def coordinationService = new DefaultResourceLockCoordinationService()
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 5K bytes
    - Viewed (0)
  9. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/resources/TaskExecutionLock.java

            super(displayName, coordinationService, owner);
            this.stateLock = stateLock;
        }
    
        @Override
        protected boolean canAcquire() {
            return stateLock.isLockedByCurrentThread() || stateLock.tryLock();
        }
    
        @Override
        protected void releaseLock() {
            super.releaseLock();
            stateLock.unlock();
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  10. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/resources/AbstractTrackedResourceLock.java

            this.owner = owner;
        }
    
        @Override
        public String toString() {
            return getClass().getSimpleName() + " " + getDisplayName();
        }
    
        @Override
        public boolean tryLock() {
            if (!isLockedByCurrentThread()) {
                if (acquireLock()) {
                    LOGGER.debug("{}: acquired lock on {}", Thread.currentThread().getName(), displayName);
                    try {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 3.2K bytes
    - Viewed (0)
Back to top