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

Comparing jsr166/src/jsr166y/ForkJoinWorkerThread.java (file contents):
Revision 1.3 by dl, Wed Jan 7 19:12:36 2009 UTC vs.
Revision 1.4 by dl, Wed Jan 7 20:51:36 2009 UTC

# Line 227 | Line 227 | public class ForkJoinWorkerThread extend
227      // public access methods
228  
229      /**
230 <     * Returns the pool hosting the current task execution.
230 >     * Returns the pool hosting this thread
231       * @return the pool
232       */
233 <    public static ForkJoinPool getPool() {
234 <        return ((ForkJoinWorkerThread)(Thread.currentThread())).pool;
233 >    public ForkJoinPool getPool() {
234 >        return pool;
235      }
236  
237      /**
238 <     * Returns the index number of the current worker thread in its
239 <     * pool.  The returned value ranges from zero to the maximum
240 <     * number of threads (minus one) that have ever been created in
241 <     * the pool.  This method may be useful for applications that
242 <     * track status or collect results on a per-worker basis.
238 >     * Returns the index number of this thread in its pool.  The
239 >     * returned value ranges from zero to the maximum number of
240 >     * threads (minus one) that have ever been created in the pool.
241 >     * This method may be useful for applications that track status or
242 >     * collect results on a per-worker basis.
243       * @return the index number.
244       */
245 <    public static int getPoolIndex() {
246 <        return ((ForkJoinWorkerThread)(Thread.currentThread())).poolIndex;
245 >    public int getPoolIndex() {
246 >        return poolIndex;
247      }
248  
249      //  Access methods used by Pool

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines