Package java.util.concurrent.locks

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


      while (suspendResume[0] == null) {
        condition.await(100, TimeUnit.MICROSECONDS);
      }
      suspendResume[0].resume();
      suspendResume[0] = null;
      condition.await(100, TimeUnit.MILLISECONDS);
      while (suspendResume[0] == null) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      suspendResume[0].resume();
      condition.await(500, TimeUnit.MILLISECONDS);
View Full Code Here


      }
      suspendResume[0].resume();
      suspendResume[0] = null;
      condition.await(100, TimeUnit.MILLISECONDS);
      while (suspendResume[0] == null) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      suspendResume[0].resume();
      condition.await(500, TimeUnit.MILLISECONDS);
    } finally {
      lock.unlock();
View Full Code Here

      condition.await(100, TimeUnit.MILLISECONDS);
      while (suspendResume[0] == null) {
        condition.await(100, TimeUnit.MILLISECONDS);
      }
      suspendResume[0].resume();
      condition.await(500, TimeUnit.MILLISECONDS);
    } finally {
      lock.unlock();
    }

    assertEquals(1, tracker.getData().size());
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

                        // too many threads.  Handle a task if there is one, otherwise exit
                        return pollTask();
                    } else if (!allowCoreThreadTimeout && threadCount < coreThreadLimit) {
                        // ignore timeout until we are not a core thread or until core threads are allowed to time out
                        try {
                            enqueueCondition.await();
                        } catch (InterruptedException e) {
                            intr = true;
                        }
                    } else {
                        final TimeUnit timeUnit = keepAliveTimeUnit;
View Full Code Here

                        if (remaining <= 0L && (allowCoreThreadTimeout || threadCount > coreThreadLimit)) {
                            // the timeout has expired
                            return pollTask();
                        }
                        try {
                            enqueueCondition.await(remaining, timeUnit);
                        } catch (InterruptedException e) {
                            intr = true;
                        }
                    }
                    task = queue.poll();
View Full Code Here

       
        workqueue.schedule(doNothing, 5000);
       
        runLock.lock();
        try {
            runCondition.await();
        } finally {
            runLock.unlock();
        }
       
        assertTrue("expected delay",
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

                        Thread.currentThread().interrupt();
                    }
                }
                else if (info.isLockInterruptibly()) {
                    try {
                        condition.await();
                    }
                    catch (InterruptedException e) {
                        Thread.currentThread().interrupt();
                    }
                }
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.