ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/jsr166y/ForkJoinPool.java
(Generate patch)

Comparing jsr166/src/jsr166y/ForkJoinPool.java (file contents):
Revision 1.10 by jsr166, Mon Jul 20 23:07:43 2009 UTC vs.
Revision 1.11 by jsr166, Tue Jul 21 00:15:13 2009 UTC

# Line 81 | Line 81 | public class ForkJoinPool extends Abstra
81           * Returns a new worker thread operating in the given pool.
82           *
83           * @param pool the pool this thread works in
84 <         * @throws NullPointerException if pool is null;
84 >         * @throws NullPointerException if pool is null
85           */
86          public ForkJoinWorkerThread newThread(ForkJoinPool pool);
87      }
# Line 273 | Line 273 | public class ForkJoinPool extends Abstra
273      /**
274       * Try incrementing active count; fail on contention. Called by
275       * workers before/during executing tasks.
276 <     * @return true on success;
276 >     * @return true on success
277       */
278      final boolean tryIncrementActiveCount() {
279          int c = runControl;
# Line 376 | Line 376 | public class ForkJoinPool extends Abstra
376       * @param parallelism the targeted number of worker threads
377       * @param factory the factory for creating new threads
378       * @throws IllegalArgumentException if parallelism less than or
379 <     * equal to zero, or greater than implementation limit.
379 >     * equal to zero, or greater than implementation limit
380       * @throws NullPointerException if factory is null
381       * @throws SecurityException if a security manager exists and
382       *         the caller is not permitted to modify threads
# Line 719 | Line 719 | public class ForkJoinPool extends Abstra
719       * Sets the target parallelism level of this pool.
720       * @param parallelism the target parallelism
721       * @throws IllegalArgumentException if parallelism less than or
722 <     * equal to zero or greater than maximum size bounds.
722 >     * equal to zero or greater than maximum size bounds
723       * @throws SecurityException if a security manager exists and
724       *         the caller is not permitted to modify threads
725       *         because it does not hold {@link
# Line 782 | Line 782 | public class ForkJoinPool extends Abstra
782       * Setting this value has no effect on current pool size. It
783       * controls construction of new threads.
784       * @throws IllegalArgumentException if negative or greater then
785 <     * internal implementation limit.
785 >     * internal implementation limit
786       */
787      public void setMaximumPoolSize(int newMax) {
788          if (newMax < 0 || newMax > MAX_THREADS)
# Line 822 | Line 822 | public class ForkJoinPool extends Abstra
822       * invocations at other times may be unpredictable.
823       *
824       * @param async if true, use locally FIFO scheduling
825 <     * @return the previous mode.
825 >     * @return the previous mode
826       */
827      public boolean setAsyncMode(boolean async) {
828          boolean oldMode = locallyFifo;
# Line 842 | Line 842 | public class ForkJoinPool extends Abstra
842       * Returns true if this pool uses local first-in-first-out
843       * scheduling mode for forked tasks that are never joined.
844       *
845 <     * @return true if this pool uses async mode.
845 >     * @return true if this pool uses async mode
846       */
847      public boolean getAsyncMode() {
848          return locallyFifo;
# Line 863 | Line 863 | public class ForkJoinPool extends Abstra
863       * Returns an estimate of the number of threads that are currently
864       * stealing or executing tasks. This method may overestimate the
865       * number of active threads.
866 <     * @return the number of active threads.
866 >     * @return the number of active threads
867       */
868      public int getActiveThreadCount() {
869          return activeCountOf(runControl);
# Line 873 | Line 873 | public class ForkJoinPool extends Abstra
873       * Returns an estimate of the number of threads that are currently
874       * idle waiting for tasks. This method may underestimate the
875       * number of idle threads.
876 <     * @return the number of idle threads.
876 >     * @return the number of idle threads
877       */
878      final int getIdleThreadCount() {
879          int c = runningCountOf(workerCounts) - activeCountOf(runControl);
# Line 902 | Line 902 | public class ForkJoinPool extends Abstra
902       * tuning fork/join programs: In general, steal counts should be
903       * high enough to keep threads busy, but low enough to avoid
904       * overhead and contention across threads.
905 <     * @return the number of steals.
905 >     * @return the number of steals
906       */
907      public long getStealCount() {
908          return stealCount.get();
# Line 925 | Line 925 | public class ForkJoinPool extends Abstra
925       * an approximation, obtained by iterating across all threads in
926       * the pool. This method may be useful for tuning task
927       * granularities.
928 <     * @return the number of queued tasks.
928 >     * @return the number of queued tasks
929       */
930      public long getQueuedTaskCount() {
931          long count = 0;
# Line 944 | Line 944 | public class ForkJoinPool extends Abstra
944       * Returns an estimate of the number tasks submitted to this pool
945       * that have not yet begun executing. This method takes time
946       * proportional to the number of submissions.
947 <     * @return the number of queued submissions.
947 >     * @return the number of queued submissions
948       */
949      public int getQueuedSubmissionCount() {
950          return submissionQueue.size();
# Line 953 | Line 953 | public class ForkJoinPool extends Abstra
953      /**
954       * Returns true if there are any tasks submitted to this pool
955       * that have not yet begun executing.
956 <     * @return {@code true} if there are any queued submissions.
956 >     * @return {@code true} if there are any queued submissions
957       */
958      public boolean hasQueuedSubmissions() {
959          return !submissionQueue.isEmpty();
# Line 1717 | Line 1717 | public class ForkJoinPool extends Abstra
1717           * Possibly blocks the current thread, for example waiting for
1718           * a lock or condition.
1719           * @return true if no additional blocking is necessary (i.e.,
1720 <         * if isReleasable would return true).
1720 >         * if isReleasable would return true)
1721           * @throws InterruptedException if interrupted while waiting
1722           * (the method is not required to do so, but is allowed to).
1723           */
# Line 1756 | Line 1756 | public class ForkJoinPool extends Abstra
1756       * attempt to maintain the pool's nominal parallelism; otherwise
1757       * activate a thread only if necessary to avoid complete
1758       * starvation.
1759 <     * @throws InterruptedException if blocker.block did so.
1759 >     * @throws InterruptedException if blocker.block did so
1760       */
1761      public static void managedBlock(ManagedBlocker blocker,
1762                                      boolean maintainParallelism)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines