Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 12 for semaphore (0.23 sec)

  1. android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

        assertInterrupted();
      }
    
      // Semaphore.tryAcquire() tests
      public void testTryAcquireWithNoWait() {
        Stopwatch stopwatch = Stopwatch.createStarted();
        Semaphore semaphore = new Semaphore(99);
        assertTrue(tryAcquireUninterruptibly(semaphore, 0, MILLISECONDS));
        assertTrue(tryAcquireUninterruptibly(semaphore, -42, MILLISECONDS));
        assertTrue(tryAcquireUninterruptibly(semaphore, LONG_DELAY_MS, MILLISECONDS));
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 30.9K bytes
    - Viewed (0)
  2. android/guava/src/com/google/common/util/concurrent/Striped.java

      }
    
      /**
       * Creates a {@code Striped<Semaphore>} with eagerly initialized, strongly referenced semaphores,
       * with the specified number of permits.
       *
       * @param stripes the minimum number of stripes (semaphores) required
       * @param permits the number of permits in each semaphore
       * @return a new {@code Striped<Semaphore>}
       */
      public static Striped<Semaphore> semaphore(int stripes, int permits) {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Apr 10 20:55:18 GMT 2023
    - 20.3K bytes
    - Viewed (1)
  3. guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

        assertInterrupted();
      }
    
      // Semaphore.tryAcquire() tests
      public void testTryAcquireWithNoWait() {
        Stopwatch stopwatch = Stopwatch.createStarted();
        Semaphore semaphore = new Semaphore(99);
        assertTrue(tryAcquireUninterruptibly(semaphore, 0, MILLISECONDS));
        assertTrue(tryAcquireUninterruptibly(semaphore, -42, MILLISECONDS));
        assertTrue(tryAcquireUninterruptibly(semaphore, LONG_DELAY_MS, MILLISECONDS));
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 31.7K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/util/concurrent/StripedTest.java

            .add(new Striped.LargeLazyStriped<Lock>(64, LOCK_SUPPLER))
            .add(new Striped.SmallLazyStriped<Semaphore>(50, SEMAPHORE_SUPPLER))
            .add(new Striped.SmallLazyStriped<Semaphore>(64, SEMAPHORE_SUPPLER))
            .add(new Striped.LargeLazyStriped<Semaphore>(50, SEMAPHORE_SUPPLER))
            .add(new Striped.LargeLazyStriped<Semaphore>(64, SEMAPHORE_SUPPLER))
            .build();
      }
    
      private static Iterable<Striped<?>> allImplementations() {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.4K bytes
    - Viewed (0)
  5. android/guava-tests/test/com/google/common/util/concurrent/StripedTest.java

            .add(new Striped.LargeLazyStriped<Lock>(64, LOCK_SUPPLER))
            .add(new Striped.SmallLazyStriped<Semaphore>(50, SEMAPHORE_SUPPLER))
            .add(new Striped.SmallLazyStriped<Semaphore>(64, SEMAPHORE_SUPPLER))
            .add(new Striped.LargeLazyStriped<Semaphore>(50, SEMAPHORE_SUPPLER))
            .add(new Striped.LargeLazyStriped<Semaphore>(64, SEMAPHORE_SUPPLER))
            .build();
      }
    
      private static Iterable<Striped<?>> allImplementations() {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Feb 09 22:57:07 GMT 2022
    - 8.4K bytes
    - Viewed (0)
  6. android/guava/src/com/google/common/util/concurrent/Uninterruptibles.java

      }
    
      /**
       * Invokes {@code semaphore.}{@link Semaphore#tryAcquire(int, long, TimeUnit) tryAcquire(permits,
       * timeout, unit)} uninterruptibly.
       *
       * @since 18.0
       */
      @J2ktIncompatible
      @GwtIncompatible // concurrency
      @SuppressWarnings("GoodTime") // should accept a java.time.Duration
      public static boolean tryAcquireUninterruptibly(
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Apr 04 09:45:04 GMT 2023
    - 14.4K bytes
    - Viewed (0)
  7. guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

        try {
          assertTrue(latch.await(LONG_DELAY_MS, MILLISECONDS));
        } catch (Throwable t) {
          threadUnexpectedException(t);
        }
      }
    
      public void await(Semaphore semaphore) {
        try {
          assertTrue(semaphore.tryAcquire(LONG_DELAY_MS, MILLISECONDS));
        } catch (Throwable t) {
          threadUnexpectedException(t);
        }
      }
    
      //     /**
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.7K bytes
    - Viewed (0)
  8. android/guava-tests/test/com/google/common/util/concurrent/JSR166TestCase.java

        try {
          assertTrue(latch.await(LONG_DELAY_MS, MILLISECONDS));
        } catch (Throwable t) {
          threadUnexpectedException(t);
        }
      }
    
      public void await(Semaphore semaphore) {
        try {
          assertTrue(semaphore.tryAcquire(LONG_DELAY_MS, MILLISECONDS));
        } catch (Throwable t) {
          threadUnexpectedException(t);
        }
      }
    
      //     /**
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Thu Feb 22 17:15:24 GMT 2024
    - 37.2K bytes
    - Viewed (0)
  9. src/main/java/jcifs/smb/SmbTransportImpl.java

        private final CIFSContext transportContext;
        private final boolean signingEnforced;
    
        private SmbNegotiationResponse negotiated;
    
        private SMBSigningDigest digest;
    
        private final Semaphore credits = new Semaphore(1, true);
    
        private final int desiredCredits = 512;
    
        private byte[] preauthIntegrityHash = new byte[64];
    
    
    Java
    - Registered: Sun Apr 28 00:10:09 GMT 2024
    - Last Modified: Wed Jan 18 23:47:00 GMT 2023
    - 67K bytes
    - Viewed (0)
  10. doc/go_mem.html

    <p>
    This rule generalizes the previous rule to buffered channels.
    It allows a counting semaphore to be modeled by a buffered channel:
    the number of items in the channel corresponds to the number of active uses,
    the capacity of the channel corresponds to the maximum number of simultaneous uses,
    sending an item acquires the semaphore, and receiving an item releases
    the semaphore.
    This is a common idiom for limiting concurrency.
    </p>
    
    <p>
    HTML
    - Registered: Tue Apr 30 11:13:12 GMT 2024
    - Last Modified: Mon Mar 04 15:54:42 GMT 2024
    - 26.6K bytes
    - Viewed (0)
Back to top