ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ForkJoinTask.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ForkJoinTask.java (file contents):
Revision 1.93 by jsr166, Sun Mar 1 03:45:18 2015 UTC vs.
Revision 1.94 by dl, Mon Aug 3 15:08:08 2015 UTC

# Line 1262 | Line 1262 | public abstract class ForkJoinTask<V> im
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      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines