Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 28 for tryLock (0.11 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. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. platforms/core-runtime/messaging/src/main/java/org/gradle/internal/event/DefaultListenerManager.java

                ensureAllWithoutLoggerInitialized();
            }
    
            void maybeAdd(final ListenerDetails listener) {
                if (type.isInstance(listener.listener)) {
                    if (broadcasterLock.tryLock()) {
                        try {
                            checkListenersCanBeAdded();
                            listeners.add(listener);
                            invalidateDispatchCache();
                        } finally {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 11 10:09:43 UTC 2024
    - 18.3K bytes
    - Viewed (0)
  10. testing/internal-testing/src/main/groovy/org/gradle/test/fixtures/work/TestWorkerLeaseService.groovy

                    return false
                }
    
                @Override
                boolean isLockedByCurrentThread() {
                    return false
                }
    
                @Override
                boolean tryLock() {
                    return false
                }
    
                @Override
                void unlock() {
    
                }
    
                @Override
                String getDisplayName() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Thu Apr 04 07:21:38 UTC 2024
    - 4.7K bytes
    - Viewed (0)
Back to top