nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/concurrency/AtomicState.java
public boolean tryRequestToe() {
        scheduleToe();
        if (isToeWaiting.get() || getCurrentState() == AccessState.TOE) {
            //System.out.println("discarding TOE");
            discardScheduledToe();
            return false;
        } else {
            //System.out.println("requesting TOE");
            discardScheduledToe();
            requestToe();
            return true;
        }
    }
public boolean tryRequestToe() {
        scheduleToe();
        if (isToeWaiting.get() || getCurrentState() == AccessState.TOE) {
            //System.out.println("discarding TOE");
            discardScheduledToe();
            return false;
        } else {
            //System.out.println("requesting TOE");
            discardScheduledToe();
            requestToe();
            return true;
        }
    }
public boolean tryRequestToe ( ) { scheduleToe ( ) ; if ( isToeWaiting . get ( ) || getCurrentState ( ) == AccessState . TOE ) { //System.out.println("discarding TOE"); discardScheduledToe ( ) ; return false ; } else { //System.out.println("requesting TOE"); discardScheduledToe ( ) ; requestToe ( ) ; return true ; } }
This method requests to change state to Toe

PLEASE NOTE: this method is non-blocking, if Toe request is impossible atm, it will return false.

@return TRUE, if Toe state entered, FALSE otherwise
This method requests to change state to Toe