Example usage for java.lang Runnable wait

List of usage examples for java.lang Runnable wait

Introduction

In this page you can find the example usage for java.lang Runnable wait.

Prototype

public final native void wait(long timeoutMillis) throws InterruptedException;

Source Link

Document

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

Usage

From source file:org.openqa.selendroid.server.model.SelendroidWebDriver.java

private void runSynchronously(Runnable r, long timeout) {
    synchronized (r) {
        serverInstrumentation.getCurrentActivity().runOnUiThread(r);
        try {/*  w ww.  j a  v a2  s.com*/
            r.wait(timeout);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}

From source file:io.selendroid.server.model.SelendroidWebDriver.java

private void runSynchronously(Runnable r, long timeout) {
    synchronized (r) {
        serverInstrumentation.getCurrentActivity().runOnUiThread(r);
        try {/*from w ww  .  j  a  v a2  s .c om*/
            r.wait(timeout);
        } catch (InterruptedException e) {
            Thread.currentThread().interrupt();
        }
    }
}