/* (non-Javadoc)
@see cyclops2.async.wait.WaitStrategy#take(cyclops2.async.wait.WaitStrategy.Takeable)
971345
@Override
    public T take(final WaitStrategy.Takeable<T> t) throws InterruptedException {
        T result;

        while ((result = t.take()) == null) {
            Thread.yield();
        }

        return result;
    }
403126
@Override
    public void waitForValue(final long timeout, final TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException {
        synchronized (VALUE_LOCK) {
            if (value != null) {
                return;
            }
            // if 0 wait forever like the default java wait() implementation.
            if (timeUnit.toMillis(timeout) == 0) {
                VALUE_LOCK.wait();
            } else {
                timeUnit.timedWait(VALUE_LOCK, timeout);
            }
            if (value == null) {
                throw new NotAvailableException(Observable.class, new TimeoutException());
            }
        }

        //waitUntilNotificationIsFinished();
    }
1130777
@SuppressWarnings("unchecked")
    public E take() throws InterruptedException
    {
        final E[] buffer = consumerBuffer;
        final long mask = consumerMask;
        
        final long cIndex = lpConsumerIndex();
        final long offset = modifiedCalcElementOffset(cIndex, mask);
        Object e = lvElement(buffer, offset);// LoadLoad
        if (e == null)
        {
            long pIndex = lvProducerIndex();
            if (cIndex == pIndex && casProducerIndex(pIndex, pIndex + 1))
            {
                // producers only try a wakeup when both the index and the blocked thread are visible
                soBlocked(Thread.currentThread());
                do
                {
                    LockSupport.park();
                    if (Thread.currentThread().isInterrupted())
                    {
                        throw new InterruptedException();
                    }
                }
                while (lvBlocked() != null);
            }
            // producer index is visible before element, so if we wake up between the index moving and the element
            // store we could see a null.
            e = spinWaitForElement(buffer, offset);
        }

        soElement(buffer, offset, null); // release element null
        soConsumerIndex(cIndex + 2); // release cIndex
        
        return (E) e;
    }
1253277
@Override
    public V get(long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException {
        if (this.m_coordinationLatch.await(timeout, unit) == false) {
            throw new TimeoutException();
        }

        if (m_pendingException != null) {
            throw m_pendingException;
        }

        return m_defaultFuture.get(timeout, unit);
    }
1310718
@Override
    public void waitForAvailabilityState(final AvailabilityState.State availabilityState) throws InterruptedException {
        synchronized (controllerAvailabilityMonitor) {
            while (!Thread.currentThread().isInterrupted()) {
                if (this.availabilityState.equals(availabilityState)) {
                    return;
                }
                controllerAvailabilityMonitor.wait();
            }
        }
    }
768978
@Override
    public void waitForData(long timeout, TimeUnit timeUnit) throws CouldNotPerformException, InterruptedException {
        try {
            if (isDataAvailable()) {
                return;
            }
            long startTime = System.currentTimeMillis();
            getDataFuture().get(timeout, timeUnit);
            long partialTimeout = timeUnit.toMillis(timeout) - (System.currentTimeMillis() - startTime);
            if (partialTimeout <= 0) {
                throw new java.util.concurrent.TimeoutException("Data timeout is reached!");
            }
            dataObservable.waitForValue(partialTimeout, TimeUnit.MILLISECONDS);
        } catch (java.util.concurrent.TimeoutException | CouldNotPerformException | ExecutionException | CancellationException ex) {
            if (shutdownInitiated) {
                throw new InterruptedException("Interrupt request because system shutdown was initiated!");
            }
            throw new NotAvailableException("Data is not yet available!", ex);
        }
    }
367242
public V get(K key, Callable<V> callable) {
        Future<V> future = concurrentMap.get(key);
        if (future == null) {
            FutureTask<V> futureTask = new FutureTask<V>(callable);
            future = concurrentMap.putIfAbsent(key, futureTask);
            if (future == null) {
                future = futureTask;
                futureTask.run();
            }
        }
        try {
            // 此时阻塞
            return future.get();
        } catch (Exception e) {
            concurrentMap.remove(key);
            return null;
        }
    }
1025929
private static String takeJavaCore() throws Throwable {
    logger.entry("takeJavaCore");

    String filePath;
    try {
      javaDumpMethod.invoke(null);

      File javacoreFile = getLatestJavacoreFile();
      filePath = javacoreFile.getAbsolutePath();

    } catch (final InvocationTargetException invocationException) {
      // Unpack invocation target exception and throw to outer catch block.
      throw (invocationException.getTargetException() == null) ? invocationException : invocationException.getTargetException();
    }
    logger.exit("takeJavaCore", (Object) filePath);

    return filePath;
  }
1341046
@Override
    public void go() {
        logger.info("Waiting for select {}...", element);
        Select select = new Select(findElementOrFail(getWebDriver(), element));
        if (OptionSelectorType.INDEX.equals(optionSelectorType)) {
            logger.info("Selecting index {}...", optionSelector);
            select.selectByIndex((Integer) optionSelector);
        } else if (OptionSelectorType.VALUE.equals(optionSelectorType)) {
            logger.info("Selecting value {}...", optionSelector);
            select.selectByValue((String) optionSelector);
        } else if (OptionSelectorType.TEXT.equals(optionSelectorType)) {
            logger.info("Selecting text {}...", optionSelector);
            select.selectByVisibleText((String) optionSelector);
        }
    }
20126
public <T> T act(ProcessCallable<T> callable) throws IOException, InterruptedException {
            return callable.invoke(this, FilePath.localChannel);
        }
1051181
@Override
    public T take() {
        T t = take0();
        if (t != null)
            ++currentRecordNumber;
        return t;
    }
261253
public final void call(T param)
	{
		if (!run)
		{
			run = true;
			prepared = true;

			try
			{
				this.run(param);
			}
			catch (Throwable t)
			{
				log.error("[ParamInvokeable] {prepare} : " + t.getMessage(), t);
			}
		}
	}
425605
@Override
  public T acquire() throws IOException {
    try {
      return acquire(100  /* no timeout */, TimeUnit.DAYS);
    } catch (TimeoutException e) {
      // Never should timeout in acquire().
      throw new RuntimeException(e);
    }
  }
943165
@Override
	public final T get() throws InterruptedException, ExecutionException {
		block(0);
		if (!isUnblocked()) throw new InterruptedException();
		if (hasError()) throw new ExecutionException(error);
		if (isCancelled()) throw new ExecutionException(cancel);
		return result;
	}
597768
protected <T> T performCloneForCloneableMethod(T object, CloneDriver context) {

		Class<?> clazz = object.getClass();

		final T result;
		try {
			MethodHandle handle = context.getCloneMethod(clazz);
			result = (T) handle.invoke(object);
		} catch (Throwable e) {
			throw new IllegalStateException("Could not invoke clone() for instance of: " + clazz.getName(), e);
		}
		return result;
	}
379263
@Override
    public boolean offer(final WaitStrategy.Offerable o) throws InterruptedException {
        while (!o.offer()) {
            LockSupport.parkNanos(1l);
        }
        return true;
    }
340364
@Override
    public ListT<W,T> takeUntil(final Predicate<? super T> p) {

        return (ListT<W,T>) FoldableTransformerSeq.super.takeUntil(p);
    }