Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 21 for Unlock (0.18 sec)

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

        Lock lockA = factory.newReentrantReadWriteLock(OtherOrder.FIRST).readLock();
        Lock lockB = factory.newReentrantLock(OtherOrder.SECOND);
    
        lockA.lock();
        lockA.lock();
        lockB.lock();
        lockB.lock();
        lockA.unlock();
        lockA.unlock();
        lockB.unlock();
        lockB.unlock();
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.1K bytes
    - Viewed (1)
  2. guava-tests/test/com/google/common/util/concurrent/CycleDetectingLockFactoryTest.java

        Lock lockA = factory.newReentrantReadWriteLock(OtherOrder.FIRST).readLock();
        Lock lockB = factory.newReentrantLock(OtherOrder.SECOND);
    
        lockA.lock();
        lockA.lock();
        lockB.lock();
        lockB.lock();
        lockA.unlock();
        lockA.unlock();
        lockB.unlock();
        lockB.unlock();
      }
    
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 16.1K bytes
    - Viewed (0)
  3. android/guava/src/com/google/common/util/concurrent/CycleDetectingLockFactory.java

     *
     * <ul>
     *   <li>for an unnested {@code lock()} and {@code unlock()}, a cycle detecting lock takes 38ns as
     *       opposed to the 24ns taken by a plain lock.
     *   <li>for nested locking, the cost increases with the depth of the nesting:
     *       <ul>
     *         <li>2 levels: average of 64ns per lock()/unlock()
     *         <li>3 levels: average of 77ns per lock()/unlock()
     *         <li>4 levels: average of 99ns per lock()/unlock()
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Fri Dec 15 19:31:54 GMT 2023
    - 35.9K bytes
    - Viewed (0)
  4. android/guava/src/com/google/common/util/concurrent/Monitor.java

        }
        final ReentrantLock lock = this.lock;
        lock.lock();
    
        boolean satisfied = false;
        try {
          return satisfied = guard.isSatisfied();
        } finally {
          if (!satisfied) {
            lock.unlock();
          }
        }
      }
    
      /**
       * Enters this monitor if the guard is satisfied. Blocks at most the given time acquiring the
       * lock, but does not wait for the guard to be satisfied.
    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)
  5. guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

          lock.lock();
          try {
            return condition.await(time, unit);
          } finally {
            lock.unlock();
          }
        }
    
        @Override
        public void awaitUninterruptibly() {
          lock.lock();
          try {
            condition.awaitUninterruptibly();
          } finally {
            lock.unlock();
          }
        }
    
        @Override
    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)
  6. android/guava/src/com/google/common/util/concurrent/AbstractScheduledService.java

             * holding a lock. Still, it would be nice to avoid somehow.
             */
            lock.lock();
            try {
              currentFuture.cancel(mayInterruptIfRunning);
            } finally {
              lock.unlock();
            }
          }
    
          @Override
          public boolean isCancelled() {
            lock.lock();
            try {
              return currentFuture.isCancelled();
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed Dec 13 19:45:20 GMT 2023
    - 25.8K bytes
    - Viewed (0)
  7. android/guava-tests/test/com/google/common/util/concurrent/UninterruptiblesTest.java

          lock.lock();
          try {
            return condition.await(time, unit);
          } finally {
            lock.unlock();
          }
        }
    
        @Override
        public void awaitUninterruptibly() {
          lock.lock();
          try {
            condition.awaitUninterruptibly();
          } finally {
            lock.unlock();
          }
        }
    
        @Override
    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)
  8. android/guava-tests/test/com/google/common/cache/CacheTesting.java

            drainRecencyQueue(segment);
          }
        }
      }
    
      static void drainRecencyQueue(Segment<?, ?> segment) {
        segment.lock();
        try {
          segment.cleanUp();
        } finally {
          segment.unlock();
        }
      }
    
      static void drainReferenceQueues(Cache<?, ?> cache) {
        if (hasLocalCache(cache)) {
          drainReferenceQueues(toLocalCache(cache));
        }
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  9. guava-tests/test/com/google/common/cache/CacheTesting.java

            drainRecencyQueue(segment);
          }
        }
      }
    
      static void drainRecencyQueue(Segment<?, ?> segment) {
        segment.lock();
        try {
          segment.cleanUp();
        } finally {
          segment.unlock();
        }
      }
    
      static void drainReferenceQueues(Cache<?, ?> cache) {
        if (hasLocalCache(cache)) {
          drainReferenceQueues(toLocalCache(cache));
        }
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Tue Feb 20 17:00:05 GMT 2024
    - 16.7K bytes
    - Viewed (0)
  10. android/guava/src/com/google/common/util/concurrent/Striped.java

         * error-prone code like:
         *
         * Striped<Lock> stripedLock = Striped.lazyWeakXXX(...)'
         * Iterable<Lock> locks = stripedLock.bulkGet(keys);
         * for (Lock lock : locks) {
         *   lock.lock();
         * }
         * operation();
         * for (Lock lock : locks) {
         *   lock.unlock();
         * }
         *
    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)
Back to top