Search in sources :

Example 6 with Thread

use of java.lang.Thread in project ACS by ACS-Community.

the class LogStressImpl method logNumTimes.

/////////////////////////////////////////////////////////////
// Implementation of LogStressOperations
/////////////////////////////////////////////////////////////
public void logNumTimes(int numTimes, int delayBetweenLogs) {
    m_logger.info("logNumTimes called...");
    this.threadDone = false;
    this.numTimesToLog = numTimes;
    this.delay = delayBetweenLogs;
    Thread sendingThread = m_containerServices.getThreadFactory().newThread(new LogSender());
    sendingThread.start();
}
Also used : Thread(java.lang.Thread)

Example 7 with Thread

use of java.lang.Thread in project jdk8u_jdk by JetBrains.

the class DisplayChangeVITest method main.

public static void main(String[] args) throws Exception {
    DisplayChangeVITest test = new DisplayChangeVITest();
    GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
    if (gd.isFullScreenSupported()) {
        gd.setFullScreenWindow(test);
        Thread t = new Thread(test);
        t.run();
        synchronized (lock) {
            while (!done) {
                try {
                    lock.wait(50);
                } catch (InterruptedException ex) {
                    ex.printStackTrace();
                }
            }
        }
        System.err.println("Test Passed.");
    } else {
        System.err.println("Full screen not supported. Test passed.");
    }
}
Also used : GraphicsDevice(java.awt.GraphicsDevice) Thread(java.lang.Thread)

Example 8 with Thread

use of java.lang.Thread in project android_frameworks_base by DirtyUnicorns.

the class SvcMonitor method startMonitor.

private void startMonitor(Intent intent) {
    if (tMonitor != null) {
        Log.d(TAG, "thread already active");
        return;
    }
    javaProc = intent.getStringExtra("java");
    halProc = intent.getStringExtra("hal");
    period = intent.getIntExtra("period", 1000);
    if (javaProc == null || halProc == null || period < 100) {
        Log.d(TAG, "Failed starting monitor, invalid arguments.");
        stopSelf();
        return;
    }
    Runnable monitor = new MonitorRunnable(this);
    tMonitor = new Thread(monitor);
    tMonitor.start();
}
Also used : Runnable(java.lang.Runnable) Thread(java.lang.Thread)

Example 9 with Thread

use of java.lang.Thread in project android_frameworks_base by crdroidandroid.

the class SvcMonitor method startMonitor.

private void startMonitor(Intent intent) {
    if (tMonitor != null) {
        Log.d(TAG, "thread already active");
        return;
    }
    javaProc = intent.getStringExtra("java");
    halProc = intent.getStringExtra("hal");
    period = intent.getIntExtra("period", 1000);
    if (javaProc == null || halProc == null || period < 100) {
        Log.d(TAG, "Failed starting monitor, invalid arguments.");
        stopSelf();
        return;
    }
    Runnable monitor = new MonitorRunnable(this);
    tMonitor = new Thread(monitor);
    tMonitor.start();
}
Also used : Runnable(java.lang.Runnable) Thread(java.lang.Thread)

Aggregations

Thread (java.lang.Thread)9 Runnable (java.lang.Runnable)5 Message (android.os.Message)1 GraphicsDevice (java.awt.GraphicsDevice)1 CountDownLatch (java.util.concurrent.CountDownLatch)1