[cvs] / jsr166 / src / main / java / util / concurrent / SynchronousQueue.java Repository:
ViewVC logotype

Diff of /jsr166/src/main/java/util/concurrent/SynchronousQueue.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.62, Fri Aug 19 12:51:29 2005 UTC revision 1.63, Fri Aug 19 23:36:50 2005 UTC
# Line 226  Line 226 
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               */               */
# Line 365  Line 365 
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
# Line 677  Line 678 
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
# Line 787  Line 789 
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();
# Line 885  Line 888 
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() {
# Line 894  Line 898 
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() {
# Line 903  Line 908 
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() {
# Line 919  Line 925 
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       */       */
# Line 940  Line 947 
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       */       */
# Line 950  Line 958 
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       */       */
# Line 960  Line 969 
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       */       */
# Line 971  Line 981 
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() {

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

Doug Lea
ViewVC Help
Powered by ViewVC 1.0.8