Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 54 for tryLock (0.14 sec)

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

            when:
            resourceLock.tryLock()
    
            then:
            thrown(IllegalStateException)
    
            when:
            resourceLock.unlock()
    
            then:
            thrown(IllegalStateException)
        }
    
        def "can lock and unlock a resource"() {
            when:
            coordinationService.withStateLock(tryLock(resourceLock))
    
            then:
            resourceLock.doIsLocked()
    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. subprojects/core/src/testFixtures/groovy/org/gradle/internal/classpath/ClassBasedLock.groovy

            initializeLock()
            lock.lockInterruptibly()
        }
    
        @Override
        boolean tryLock() {
            initializeLock()
            return lock.tryLock()
        }
    
        @Override
        boolean tryLock(long time, @NotNull TimeUnit unit) throws InterruptedException {
            initializeLock()
            return tryLock(time, unit)
        }
    
        @Override
        Condition newCondition() {
            initializeLock()
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon Jul 24 15:57:56 UTC 2023
    - 2.1K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. subprojects/core/src/test/groovy/org/gradle/execution/plan/DefaultPlanExecutorTest.groovy

            then:
            result.failures.empty
    
            1 * workerLeaseService.currentWorkerLease >> workerLease
    
            then:
            1 * cancellationHandler.isCancellationRequested() >> false
            1 * workerLease.tryLock() >> true
            1 * workSource.executionState() >> WorkSource.State.MaybeWorkReadyToStart
            1 * workSource.selectNext() >> WorkSource.Selection.of(node)
            1 * worker.execute(node)
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Apr 05 16:29:26 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  7. src/sync/rwmutex.go

    	}
    }
    
    // TryLock tries to lock rw for writing and reports whether it succeeded.
    //
    // Note that while correct uses of TryLock do exist, they are rare,
    // and use of TryLock is often a sign of a deeper problem
    // in a particular use of mutexes.
    func (rw *RWMutex) TryLock() bool {
    	if race.Enabled {
    		_ = rw.w.state
    		race.Disable()
    	}
    	if !rw.w.TryLock() {
    		if race.Enabled {
    			race.Enable()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 7.2K bytes
    - Viewed (0)
  8. platforms/core-runtime/base-services/src/test/groovy/org/gradle/internal/resources/AbstractResourceLockRegistryTest.groovy

            when:
            lock.tryLock()
    
            then:
            registry.getResourceLocksByCurrentThread() == [lock]
        }
    
        def "does not get locks associated with other threads"() {
            when:
            def lock = registry.getResourceLock("test")
            inNewThread { registry.getResourceLock("another").tryLock() }
    
            and:
            lock.tryLock()
    
            then:
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 08:48:02 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  9. src/sync/mutex.go

    	}
    	// Slow path (outlined so that the fast path can be inlined)
    	m.lockSlow()
    }
    
    // TryLock tries to lock m and reports whether it succeeded.
    //
    // Note that while correct uses of TryLock do exist, they are rare,
    // and use of TryLock is often a sign of a deeper problem
    // in a particular use of mutexes.
    func (m *Mutex) TryLock() bool {
    	old := m.state
    	if old&(mutexLocked|mutexStarving) != 0 {
    		return false
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 21:14:51 UTC 2024
    - 8.4K bytes
    - Viewed (0)
  10. 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)
Back to top