Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.Condition.await()


          if (shutdown)
            return null;

          Condition lockCond = lockMap.get(offset);
          if (lockCond != null)
            lockCond.await(10, TimeUnit.SECONDS); // 10s for checking shutdown
          else
            break;
        } while (true);
        condition = entryLock.newCondition();
        lockMap.put(offset, condition);
View Full Code Here


            // while keeping the wait-for-flush (future.get) out of anything latency-sensitive.
            return commitLogUpdater_.submit(new WrappedRunnable()
            {
                public void runMayThrow() throws InterruptedException, IOException
                {
                    condition.await();
                    if (writeCommitLog)
                    {
                        // if we're not writing to the commit log, we are replaying the log, so marking
                        // the log header with "you can discard anything written before the context" is not valid
                        CommitLog.instance().discardCompletedSegments(table_, columnFamily_, ctx);
View Full Code Here

            {
                public void run()
                {
                    try
                    {
                        condition.await();
                        if (writeCommitLog)
                        {
                            // if we're not writing to the commit log, we are replaying the log, so marking
                            // the log header with "you can discard anything written before the context" is not valid
                            onMemtableFlush(ctx);
View Full Code Here

    final Condition condition = lock.newCondition();
    lock.lock();
    try {
      // Wait for listener to be notified:
      while (listener.getLaunch(configName) == null) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      launch = listener.getLaunch(configName);
      // Wait for launch to terminate:
      while (!launch.isTerminated()) {
        condition.await(100, TimeUnit.MILLISECONDS);
View Full Code Here

        condition.await(100, TimeUnit.MILLISECONDS);
      }
      launch = listener.getLaunch(configName);
      // Wait for launch to terminate:
      while (!launch.isTerminated()) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      // Give the tracker a bit more time to finish:
      condition.await(100, TimeUnit.MILLISECONDS);
    } finally {
      lock.unlock();
View Full Code Here

      // Wait for launch to terminate:
      while (!launch.isTerminated()) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      // Give the tracker a bit more time to finish:
      condition.await(100, TimeUnit.MILLISECONDS);
    } finally {
      lock.unlock();
    }
    tracker.setEnabled(false);
View Full Code Here

    final Condition condition = lock.newCondition();
    lock.lock();
    try {
      while (listener.getLaunch(configName1) == null
          || listener.getLaunch(configName2) == null) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      while (!listener.getLaunch(configName1).isTerminated()
          || !listener.getLaunch(configName2).isTerminated()) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
View Full Code Here

          || listener.getLaunch(configName2) == null) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      while (!listener.getLaunch(configName1).isTerminated()
          || !listener.getLaunch(configName2).isTerminated()) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      condition.await(100, TimeUnit.MILLISECONDS);
    } finally {
      lock.unlock();
    }
View Full Code Here

      }
      while (!listener.getLaunch(configName1).isTerminated()
          || !listener.getLaunch(configName2).isTerminated()) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      condition.await(100, TimeUnit.MILLISECONDS);
    } finally {
      lock.unlock();
    }
    tracker.setEnabled(false);
View Full Code Here

    final Condition condition = lock.newCondition();
    lock.lock();
    try {
      // We had two breakpoints set, so we need to resume twice:
      while (suspendResume[0] == null) {
        condition.await(100, TimeUnit.MICROSECONDS);
      }
      suspendResume[0].resume();
      suspendResume[0] = null;
      condition.await(100, TimeUnit.MILLISECONDS);
      while (suspendResume[0] == null) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.