Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 9 of 9 for guardByKey (0.13 sec)

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

         * @return the value returned by the factory
         */
        public abstract <V> V guardByKey(T key, Supplier<V> supplier);
    
        private static class AdaptiveProducerGuard<T> extends ProducerGuard<T> {
            private final Set<T> producing = new HashSet<>();
    
            @Override
            public <V> V guardByKey(T key, Supplier<V> supplier) {
                synchronized (producing) {
                    while (!producing.add(key)) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Apr 26 16:02:31 UTC 2024
    - 4.7K bytes
    - Viewed (0)
  2. platforms/core-execution/persistent-cache/src/test/groovy/org/gradle/cache/internal/ProducerGuardTest.groovy

        def "calls all factories"() {
            given:
            def calls = new AtomicInteger()
    
            when:
            async {
                100.times {
                    start {
                        guard.guardByKey("foo", new Supplier() {
                            @Override
                            Object get() {
                                return calls.getAndIncrement()
                            }
                        })
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Sep 22 09:08:47 UTC 2023
    - 2.3K bytes
    - Viewed (0)
  3. subprojects/core/src/main/java/org/gradle/api/internal/file/archive/DefaultDecompressionCoordinator.java

            // but multiple threads in this process could still try to extract into the same directory.
            cache.withFileLock(() -> {
                // guardByKey prevents multiple threads in this process from extracting into the same directory at the same time.
                guard.guardByKey(expandedDir, () -> {
                    action.run();
                    return null;
                });
            });
        }
    
        @Override
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Mar 26 15:15:04 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  4. platforms/core-execution/snapshots/src/main/java/org/gradle/internal/vfs/impl/DefaultFileSystemAccess.java

                        case Directory:
                            return Optional.empty();
                        case RegularFile:
                            return Optional.of(producingSnapshots.guardByKey(location,
                                () -> virtualFileSystem.findSnapshot(location)
                                    .orElseGet(() -> {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Apr 26 16:02:35 UTC 2024
    - 11.1K bytes
    - Viewed (0)
  5. platforms/software/dependency-management/src/main/java/org/gradle/api/internal/artifacts/verification/signatures/CrossBuildCachingKeyService.java

            return refreshKeys || elapsed > MISSING_KEY_TIMEOUT;
        }
    
        @Override
        public void findByLongId(long keyId, PublicKeyResultBuilder builder) {
            longIdGuard.guardByKey(keyId, () -> {
                CacheEntry<List<Fingerprint>> fingerprints = longIdToFingerprint.getIfPresent(keyId);
                if (fingerprints == null || hasExpired(fingerprints)) {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Fri Mar 08 10:44:56 UTC 2024
    - 14.1K bytes
    - Viewed (0)
  6. platforms/software/version-control/src/main/java/org/gradle/vcs/internal/resolver/OncePerBuildInvocationVcsVersionWorkingDirResolver.java

        @Nullable
        @Override
        public File selectVersion(final ModuleComponentSelector selector, final VersionControlRepositoryConnection repository) {
            // Perform the work per repository
            return perRepoGuard.guardByKey(repository.getUniqueId(), new Supplier<File>() {
                @Nullable
                @Override
                public File get() {
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Wed Oct 11 12:16:09 UTC 2023
    - 2.6K bytes
    - Viewed (0)
  7. platforms/extensibility/unit-test-fixtures/src/main/java/org/gradle/testfixtures/internal/TestInMemoryIndexedCache.java

                throw UncheckedException.throwAsUncheckedException(e);
            }
        }
    
        @Override
        public V get(final K key, final Function<? super K, ? extends V> producer) {
            return producerGuard.guardByKey(key, () -> {
                if (!entries.containsKey(key)) {
                    put(key, producer.apply(key));
                }
                return TestInMemoryIndexedCache.this.getIfPresent(key);
            });
        }
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Mon May 13 21:54:27 UTC 2024
    - 3.1K bytes
    - Viewed (0)
  8. platforms/software/dependency-management/src/main/java/org/gradle/internal/resource/transfer/DefaultCacheAwareExternalResourceAccessor.java

            return producerGuard.guardByKey(location, () -> {
                LOGGER.debug("Constructing external resource: {}", location);
                CachedExternalResource cached = cachedExternalResourceIndex.lookup(location.toString());
    
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Oct 10 21:10:11 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  9. platforms/software/dependency-management/src/test/groovy/org/gradle/internal/resource/transfer/DefaultCacheAwareExternalResourceAccessorTest.groovy

        final fileRepository = Mock(FileResourceRepository)
        final cachePolicy = new DefaultExternalResourceCachePolicy()
        final ProducerGuard<URI> producerGuard = Stub() {
            guardByKey(_, _) >> { args ->
                def (key, supplier) = args
                supplier.get()
            }
        }
    Registered: Wed Jun 12 18:38:38 UTC 2024
    - Last Modified: Tue Jan 02 17:19:47 UTC 2024
    - 19.1K bytes
    - Viewed (0)
Back to top