public static int getQueuedTaskCount ( ) { Thread t ; ForkJoinPool . WorkQueue q ; if ( ( t = Thread . currentThread ( ) ) instanceof ForkJoinWorkerThread ) q = ( ( ForkJoinWorkerThread ) t ) . workQueue ; else q = ForkJoinPool . commonSubmitterQueue ( ) ; return ( q == null ) ? 0 : q . queueSize ( ) ; }
Returns an estimate of the number of tasks that have been forked by the current worker thread but not yet executed . This value may be useful for heuristic decisions about whether to fork other tasks .