private int doJoin ( ) { int s ; Thread t ; ForkJoinWorkerThread wt ; ForkJoinPool . WorkQueue w ; if ( ( s = status ) >= 0 ) { if ( ( ( t = Thread . currentThread ( ) ) instanceof ForkJoinWorkerThread ) ) { if ( ! ( w = ( wt = ( ForkJoinWorkerThread ) t ) . workQueue ) . tryUnpush ( this ) || ( s = doExec ( ) ) >= 0 ) s = wt . pool . awaitJoin ( w , this ) ; } else s = externalAwaitDone ( ) ; } return s ; }
Implementation for join get quietlyJoin . Directly handles only cases of already - completed external wait and unfork + exec . Others are relayed to ForkJoinPool . awaitJoin .