public int awaitAdvance ( int phase ) { final Phaser root = this . root ; long s = ( root == this ) ? state : reconcileState ( ) ; int p = ( int ) ( s >>> PHASE_SHIFT ) ; if ( phase < 0 ) return phase ; if ( p == phase ) return root . internalAwaitAdvance ( phase , null ) ; return p ; }
Awaits the phase of this phaser to advance from the given phase value returning immediately if the current phase is not equal to the given phase value or this phaser is terminated .