1262 |
|
null; |
1263 |
|
} |
1264 |
|
|
1265 |
+ |
/** |
1266 |
+ |
* If the current thread is operating in a ForkJoinPool, |
1267 |
+ |
* unschedules and returns, without executing, a task externally |
1268 |
+ |
* submitted to the pool, if one is available. Availability may be |
1269 |
+ |
* transient, so a {@code null} result does not necessarily imply |
1270 |
+ |
* quiescence of the pool. This method is designed primarily to |
1271 |
+ |
* support extensions, and is unlikely to be useful otherwise. |
1272 |
+ |
* |
1273 |
+ |
* @return a task, or {@code null} if none are available |
1274 |
+ |
* @since 1.9 |
1275 |
+ |
*/ |
1276 |
+ |
protected static ForkJoinTask<?> pollSubmission() { |
1277 |
+ |
Thread t; ForkJoinWorkerThread wt; |
1278 |
+ |
return ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) ? |
1279 |
+ |
(wt = (ForkJoinWorkerThread)t).pool.pollSubmission() : |
1280 |
+ |
null; |
1281 |
+ |
} |
1282 |
+ |
|
1283 |
|
// tag operations |
1284 |
|
|
1285 |
|
/** |