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 |