| 226 |
(SNode.class, SNode.class, "match"); |
(SNode.class, SNode.class, "match"); |
| 227 |
|
|
| 228 |
/** |
/** |
| 229 |
* Tries to match node s to this node, if so, waking up |
* Tries to match node s to this node, if so, waking up thread. |
| 230 |
* thread. Fulfillers call tryMatch to identify their |
* Fulfillers call tryMatch to identify their waiters. |
| 231 |
* waiters. Waiters block until they have been |
* Waiters block until they have been matched. |
| 232 |
* matched. |
* |
| 233 |
* @param s the node to match |
* @param s the node to match |
| 234 |
* @return true if successfully matched to s |
* @return true if successfully matched to s |
| 235 |
*/ |
*/ |
| 365 |
|
|
| 366 |
/** |
/** |
| 367 |
* Spins/blocks until node s is matched by a fulfill operation. |
* Spins/blocks until node s is matched by a fulfill operation. |
| 368 |
|
* |
| 369 |
* @param s the waiting node |
* @param s the waiting node |
| 370 |
* @param timed true if timed wait |
* @param timed true if timed wait |
| 371 |
* @param nanos timeout value |
* @param nanos timeout value |
| 678 |
|
|
| 679 |
/** |
/** |
| 680 |
* Spins/blocks until node s is fulfilled. |
* Spins/blocks until node s is fulfilled. |
| 681 |
|
* |
| 682 |
* @param s the waiting node |
* @param s the waiting node |
| 683 |
* @param e the comparison value for checking match |
* @param e the comparison value for checking match |
| 684 |
* @param timed true if timed wait |
* @param timed true if timed wait |
| 789 |
} |
} |
| 790 |
|
|
| 791 |
/** |
/** |
| 792 |
* Creates a <tt>SynchronousQueue</tt> with specified fairness policy. |
* Creates a <tt>SynchronousQueue</tt> with the specified fairness policy. |
| 793 |
* @param fair if true, waiting threads contend in FIFO order for access; |
* |
| 794 |
* otherwise the order is unspecified. |
* @param fair if true, waiting threads contend in FIFO order for |
| 795 |
|
* access; otherwise the order is unspecified. |
| 796 |
*/ |
*/ |
| 797 |
public SynchronousQueue(boolean fair) { |
public SynchronousQueue(boolean fair) { |
| 798 |
transferer = (fair)? new TransferQueue() : new TransferStack(); |
transferer = (fair)? new TransferQueue() : new TransferStack(); |
| 888 |
/** |
/** |
| 889 |
* Always returns <tt>true</tt>. |
* Always returns <tt>true</tt>. |
| 890 |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
| 891 |
|
* |
| 892 |
* @return <tt>true</tt> |
* @return <tt>true</tt> |
| 893 |
*/ |
*/ |
| 894 |
public boolean isEmpty() { |
public boolean isEmpty() { |
| 898 |
/** |
/** |
| 899 |
* Always returns zero. |
* Always returns zero. |
| 900 |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
| 901 |
|
* |
| 902 |
* @return zero. |
* @return zero. |
| 903 |
*/ |
*/ |
| 904 |
public int size() { |
public int size() { |
| 908 |
/** |
/** |
| 909 |
* Always returns zero. |
* Always returns zero. |
| 910 |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
| 911 |
|
* |
| 912 |
* @return zero. |
* @return zero. |
| 913 |
*/ |
*/ |
| 914 |
public int remainingCapacity() { |
public int remainingCapacity() { |
| 925 |
/** |
/** |
| 926 |
* Always returns <tt>false</tt>. |
* Always returns <tt>false</tt>. |
| 927 |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
| 928 |
|
* |
| 929 |
* @param o the element |
* @param o the element |
| 930 |
* @return <tt>false</tt> |
* @return <tt>false</tt> |
| 931 |
*/ |
*/ |
| 947 |
/** |
/** |
| 948 |
* Returns <tt>false</tt> unless the given collection is empty. |
* Returns <tt>false</tt> unless the given collection is empty. |
| 949 |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
| 950 |
|
* |
| 951 |
* @param c the collection |
* @param c the collection |
| 952 |
* @return <tt>false</tt> unless given collection is empty |
* @return <tt>false</tt> unless given collection is empty |
| 953 |
*/ |
*/ |
| 958 |
/** |
/** |
| 959 |
* Always returns <tt>false</tt>. |
* Always returns <tt>false</tt>. |
| 960 |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
| 961 |
|
* |
| 962 |
* @param c the collection |
* @param c the collection |
| 963 |
* @return <tt>false</tt> |
* @return <tt>false</tt> |
| 964 |
*/ |
*/ |
| 969 |
/** |
/** |
| 970 |
* Always returns <tt>false</tt>. |
* Always returns <tt>false</tt>. |
| 971 |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
* A <tt>SynchronousQueue</tt> has no internal capacity. |
| 972 |
|
* |
| 973 |
* @param c the collection |
* @param c the collection |
| 974 |
* @return <tt>false</tt> |
* @return <tt>false</tt> |
| 975 |
*/ |
*/ |
| 981 |
* Always returns <tt>null</tt>. |
* Always returns <tt>null</tt>. |
| 982 |
* A <tt>SynchronousQueue</tt> does not return elements |
* A <tt>SynchronousQueue</tt> does not return elements |
| 983 |
* unless actively waited on. |
* unless actively waited on. |
| 984 |
|
* |
| 985 |
* @return <tt>null</tt> |
* @return <tt>null</tt> |
| 986 |
*/ |
*/ |
| 987 |
public E peek() { |
public E peek() { |