Skip to content

Most visited

Recently visited

navigation

WaitingThread | Android Developers

to top
Android APIs
public class

WaitingThread

extends Object
java.lang.Object
   ↳ org.apache.http.impl.conn.tsccm.WaitingThread

Class Overview

Represents a thread waiting for a connection. This class implements throwaway objects. It is instantiated whenever a thread needs to wait. Instances are not re-used, except if the waiting thread experiences a spurious wakeup and continues to wait.
All methods assume external synchronization on the condition passed to the constructor. Instances of this class do not synchronize access!

Summary

Public Constructors
WaitingThread(Condition cond, RouteSpecificPool pool)
Creates a new entry for a waiting thread.
Public Methods
boolean await(Date deadline)
Blocks the calling thread.
final Condition getCondition()
Obtains the condition.
final RouteSpecificPool getPool()
Obtains the pool, if there is one.
final Thread getThread()
Obtains the thread, if there is one.
void interrupt()
void wakeup()
Wakes up the waiting thread.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WaitingThread (Condition cond, RouteSpecificPool pool)

Added in API level 1

Creates a new entry for a waiting thread.

Parameters
cond the condition for which to wait
pool the pool on which the thread will be waiting, or null

Public Methods

public boolean await (Date deadline)

Added in API level 1

Blocks the calling thread. This method returns when the thread is notified or interrupted, if a timeout occurrs, or if there is a spurious wakeup.
This method assumes external synchronization.

Parameters
deadline when to time out, or null for no timeout
Returns
  • true if the condition was satisfied, false in case of a timeout. Typically, a call to wakeup() is used to indicate that the condition was satisfied. Since the condition is accessible outside, this cannot be guaranteed though.
Throws
InterruptedException if the waiting thread was interrupted
See Also

public final Condition getCondition ()

Added in API level 1

Obtains the condition.

Returns
  • the condition on which to wait, never null

public final RouteSpecificPool getPool ()

Added in API level 1

Obtains the pool, if there is one.

Returns
  • the pool on which a thread is or was waiting, or null

public final Thread getThread ()

Added in API level 1

Obtains the thread, if there is one.

Returns
  • the thread which is waiting, or null

public void interrupt ()

Added in API level 1

public void wakeup ()

Added in API level 1

Wakes up the waiting thread.
This method assumes external synchronization.

This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a one-minute survey?
Help us improve Android tools and documentation.