49 |
|
*/ |
50 |
|
public static final int DROP = 3; |
51 |
|
|
52 |
+ |
/** |
53 |
+ |
* To allow opposite lookups. |
54 |
+ |
*/ |
55 |
+ |
public static final String[] algorithms = {"RANDOM", "FIRST", "LAST", "DROP"}; |
56 |
+ |
|
57 |
|
//---STATIC METHODS--- |
58 |
|
|
59 |
|
//---CONSTRUCTORS--- |
136 |
|
throw new InvalidQueueException("Requested queue "+queue+" does not exist"); |
137 |
|
} |
138 |
|
// block if the queue is empty |
139 |
< |
if (((LinkedList) _lists.get(queue)).size() == 0) { |
140 |
< |
synchronized(((LinkedList) _lists.get(queue))) { |
139 |
> |
synchronized(((LinkedList) _lists.get(queue))) { |
140 |
> |
if (((LinkedList) _lists.get(queue)).size() == 0) { |
141 |
|
try { ((LinkedList) _lists.get(queue)).wait(); } catch(Exception e) {} |
142 |
|
} |
143 |
|
} |