Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for enterWhen (0.28 sec)

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

        TestGuard guard = new TestGuard(true);
        thread1.callAndAssertReturns(enterWhen(), guard);
        // same as above but with the new syntax
        thread1.callAndAssertReturns(enterWhen(), monitor.newGuard(() -> true));
      }
    
      public final void testEnterWhen_initiallyFalse() throws Exception {
        TestGuard guard = new TestGuard(false);
        thread1.callAndAssertWaits(enterWhen(), guard);
        monitor.enter();
        guard.setSatisfied(true);
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Apr 26 20:07:17 GMT 2023
    - 8K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/MonitorTestCase.java

        thread1.callAndAssertReturns(enterWhen(), guard);
      }
    
      public final void testEnterWhen_initiallyFalse() throws Exception {
        TestGuard guard = new TestGuard(false);
        thread1.callAndAssertWaits(enterWhen(), guard);
        monitor.enter();
        guard.setSatisfied(true);
        monitor.leave();
        thread1.assertPriorCallReturns(enterWhen());
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 26 20:07:17 GMT 2023
    - 7.9K bytes
    - Viewed (0)
  3. android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java

        if (monitor.enterWhen(notEmpty, timeout, unit)) {
          try {
            return extract();
          } finally {
            monitor.leave();
          }
        } else {
          return null;
        }
      }
    
      @CanIgnoreReturnValue
      @Override
      public E take() throws InterruptedException {
        final Monitor monitor = this.monitor;
        monitor.enterWhen(notEmpty);
        try {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 22.5K bytes
    - Viewed (0)
  4. guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedArrayBlockingQueue.java

        if (monitor.enterWhen(notEmpty, timeout, unit)) {
          try {
            return extract();
          } finally {
            monitor.leave();
          }
        } else {
          return null;
        }
      }
    
      @CanIgnoreReturnValue
      @Override
      public E take() throws InterruptedException {
        final Monitor monitor = this.monitor;
        monitor.enterWhen(notEmpty);
        try {
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 22.5K bytes
    - Viewed (0)
  5. android/guava/src/com/google/common/util/concurrent/Monitor.java

     *
     *   public V get() throws InterruptedException {
     *     monitor.enterWhen(valuePresent);
     *     try {
     *       V result = value;
     *       value = null;
     *       return result;
     *     } finally {
     *       monitor.leave();
     *     }
     *   }
     *
     *   public void set(V newValue) throws InterruptedException {
     *     monitor.enterWhen(valueAbsent);
     *     try {
     *       value = newValue;
     *     } finally {
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Mon Dec 04 18:22:01 GMT 2023
    - 38.6K bytes
    - Viewed (0)
  6. android/guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java

      @CanIgnoreReturnValue // pushed down from class to method
      @Override
      public @Nullable E poll(long timeout, TimeUnit unit) throws InterruptedException {
        final Monitor monitor = this.monitor;
        if (monitor.enterWhen(notEmpty, timeout, unit)) {
          try {
            return q.poll();
          } finally {
            monitor.leave();
          }
        } else {
          return null;
        }
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 19.5K bytes
    - Viewed (0)
  7. guava-tests/benchmark/com/google/common/util/concurrent/MonitorBasedPriorityBlockingQueue.java

      @CanIgnoreReturnValue // pushed down from class to method
      @Override
      public @Nullable E poll(long timeout, TimeUnit unit) throws InterruptedException {
        final Monitor monitor = this.monitor;
        if (monitor.enterWhen(notEmpty, timeout, unit)) {
          try {
            return q.poll();
          } finally {
            monitor.leave();
          }
        } else {
          return null;
        }
      }
    
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Wed Apr 19 19:24:36 GMT 2023
    - 19.5K bytes
    - Viewed (0)
Back to top