Alarm

public class Alarm
extends Thread

java.lang.Object
   ↳ java.lang.Thread
     ↳ com.android.tradefed.util.Alarm


A thread which waits for a period of time and then interrupts a specific other thread. Can call interrupt() to get a thread out of a blocking wait, or close() to stop a thread from blocking on a socket read or write.

All time units are in milliseconds.

Summary

Public constructors

Alarm(long timeout)

Constructor takes the amount of time to wait, in millis.

Public methods

void addSocket(Socket intSocket)
void addThread(Thread intThread)
boolean didAlarmFire()
void run()

Public constructors

Alarm

Alarm (long timeout)

Constructor takes the amount of time to wait, in millis.

Parameters
timeout long: The amount of time to wait, in millis

Throws
IllegalArgumentException if timeout <= 0.

Public methods

addSocket

void addSocket (Socket intSocket)

Parameters
intSocket Socket

addThread

void addThread (Thread intThread)

Parameters
intThread Thread

didAlarmFire

boolean didAlarmFire ()

Returns
boolean

run

void run ()