Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for tryEnter (0.05 sec)

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

        thread1.callAndAssertReturns(true, tryEnter());
        thread2.callAndAssertReturns(false, tryEnter());
        thread1.callAndAssertReturns(true, tryEnter());
        thread2.callAndAssertReturns(false, tryEnter());
        thread1.callAndAssertReturns(leave());
        thread2.callAndAssertReturns(false, tryEnter());
        thread1.callAndAssertReturns(leave());
        thread2.callAndAssertReturns(true, tryEnter());
      }
    
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Thu Dec 19 18:03:30 UTC 2024
    - 8K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/GeneratedMonitorTest.java

        return method.getName().startsWith("enter") || method.getName().startsWith("tryEnter");
      }
    
      /** Identifies just tryEnterXxx methods (a subset of {@link #isAnyEnter}), which never block. */
      private static boolean isTryEnter(Method method) {
        return method.getName().startsWith("tryEnter");
      }
    
      /**
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Aug 11 19:31:30 UTC 2025
    - 27K bytes
    - Viewed (0)
  3. guava/src/com/google/common/util/concurrent/Monitor.java

     * as the condition of an <i>if</i> statement containing a <i>try/finally</i> block to ensure that
     * the current thread leaves the monitor cleanly:
     *
     * {@snippet :
     * if (monitor.tryEnter()) {
     *   try {
     *     // do things while occupying the monitor
     *   } finally {
     *     monitor.leave();
     *   }
     * } else {
     *   // do other things since the monitor was not available
     * }
     * }
     *
    Registered: Fri Sep 05 12:43:10 UTC 2025
    - Last Modified: Mon Mar 17 20:26:29 UTC 2025
    - 42.8K bytes
    - Viewed (0)
Back to top