edu.emory.mathcs.backport.java.util.concurrent.helpers

Class FIFOWaitQueue

Implemented Interfaces:
java.io.Serializable

public class FIFOWaitQueue
extends WaitQueue
implements java.io.Serializable

Simple linked list queue used in FIFOSemaphore. Methods are not synchronized; they depend on synch of callers. Must be public, since it is used by Semaphore (outside this package). NOTE: this class is NOT present in java.util.concurrent.
See Also:
Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class edu.emory.mathcs.backport.java.util.concurrent.helpers.WaitQueue

WaitQueue.QueuedSync, WaitQueue.WaitNode

Field Summary

protected WaitQueue.WaitNode
head_
protected WaitQueue.WaitNode
tail_

Constructor Summary

FIFOWaitQueue()

Method Summary

WaitQueue.WaitNode
extract()
int
getLength()
Collection
getWaitingThreads()
boolean
hasNodes()
void
insert(WaitQueue.WaitNode w)
boolean
isWaiting(Thread thread)
void
putBack(WaitQueue.WaitNode w)

Methods inherited from class edu.emory.mathcs.backport.java.util.concurrent.helpers.WaitQueue

extract, getLength, getWaitingThreads, hasNodes, insert, isWaiting, putBack

Field Details

head_

protected WaitQueue.WaitNode head_

tail_

protected WaitQueue.WaitNode tail_

Constructor Details

FIFOWaitQueue

public FIFOWaitQueue()

Method Details

extract

public WaitQueue.WaitNode extract()
Overrides:
extract in interface WaitQueue

getLength

public int getLength()
Overrides:
getLength in interface WaitQueue

getWaitingThreads

public Collection getWaitingThreads()
Overrides:
getWaitingThreads in interface WaitQueue

hasNodes

public boolean hasNodes()
Overrides:
hasNodes in interface WaitQueue

insert

public void insert(WaitQueue.WaitNode w)
Overrides:
insert in interface WaitQueue

isWaiting

public boolean isWaiting(Thread thread)
Overrides:
isWaiting in interface WaitQueue

putBack

public void putBack(WaitQueue.WaitNode w)
Overrides:
putBack in interface WaitQueue