Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for isLockedByCurrentThread (0.27 sec)

  1. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/resources/AbstractTrackedResourceLock.java

        }
    
        @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 {
                        owner.lockAcquired(this);
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 3.2K bytes
    - Viewed (0)
  2. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/resources/ProjectLock.java

        }
    
        @Override
        protected boolean canAcquire() {
            // Either the "all projects" lock is not held, or it is held by this thread
            return !allProjectsLock.isLocked() || allProjectsLock.isLockedByCurrentThread();
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 1.2K bytes
    - Viewed (0)
  3. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/resources/DefaultResourceLockCoordinationServiceTest.groovy

            coordinationService.addLockReleaseListener(listener)
    
            def lock = resourceLock("lock1", true, true)
    
            when:
            coordinationService.withStateLock { state ->
                assert lock.isLockedByCurrentThread()
                lock.unlock()
                return FINISHED
            }
    
            then:
            1 * listener.execute(lock)
            0 * listener._
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 11 17:16:10 UTC 2024
    - 15.4K bytes
    - Viewed (0)
  4. 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)
  5. platforms/core-runtime/base-services/src/main/java/org/gradle/internal/resources/ResourceLock.java

         * Returns true if the current thread holds a lock on this resource.  Returns false otherwise.
         *
         * @return true if the task for this operation holds the lock for this resource.
         */
        boolean isLockedByCurrentThread();
    
        /**
         * Attempt to lock this resource, if not already.  Does not block.
         *
         * @return true if resource is now locked, false otherwise.
         */
        boolean tryLock();
    
        /**
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 1.6K bytes
    - Viewed (0)
  6. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/resources/AbstractTrackedResourceLockTest.groovy

            then:
            thrown(IllegalStateException)
    
            when:
            lock.unlock()
    
            then:
            thrown(IllegalStateException)
    
            when:
            lock.isLockedByCurrentThread()
    
            then:
            thrown(IllegalStateException)
    
            when:
            lock.isLocked()
    
            then:
            thrown(IllegalStateException)
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  7. testing/internal-testing/src/main/groovy/org/gradle/test/fixtures/work/TestWorkerLeaseService.groovy

            return new WorkerLease() {
                @Override
                boolean isLocked() {
                    return false
                }
    
                @Override
                boolean isLockedByCurrentThread() {
                    return false
                }
    
                @Override
                boolean tryLock() {
                    return false
                }
    
                @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 04 07:21:38 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  8. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/resources/SharedResourceLeaseRegistryTest.groovy

                @Override
                ResourceLockState.Disposition transform(ResourceLockState resourceLockState) {
                    held.set(resourceLock.locked && resourceLock.isLockedByCurrentThread())
                    return ResourceLockState.Disposition.FINISHED
                }
            })
            return held.get()
        }
    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/work/DefaultWorkerLeaseService.java

                    Iterator<ResourceLock> iterator = locksNotHeld.iterator();
                    while (iterator.hasNext()) {
                        ResourceLock lock = iterator.next();
                        if (lock.isLockedByCurrentThread()) {
                            iterator.remove();
                        }
                    }
                }
            });
            return locksNotHeld;
        }
    
        @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Apr 09 04:43:28 UTC 2024
    - 20.9K bytes
    - Viewed (0)
  10. subprojects/core/src/test/groovy/org/gradle/execution/plan/AbstractExecutionPlanSpec.groovy

            MockLock(ProjectInternal project, Collection<MockLock> locks) {
                this.locks = locks
                this.project = project
            }
    
            @Override
            boolean isLockedByCurrentThread() {
                return locked && Thread.currentThread() == owner
            }
    
            @Override
            boolean tryLock() {
                if (!locks.contains(this) && locked) {
                    return false
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Mar 24 11:56:02 UTC 2023
    - 7.3K bytes
    - Viewed (0)
Back to top