nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/allocator/concurrency/AtomicState.java
public void releaseToe() {
        if (getCurrentState() == AccessState.TOE) {
            if (1 > 0) {
                //if (toeThread.get() == Thread.currentThread().getId()) {
                if (toeRequests.decrementAndGet() == 0) {
                    tickRequests.set(0);
                    tackRequests.set(0);

                    currentState.set(AccessState.TACK.ordinal());
                }
            } else
                throw new IllegalStateException("releaseToe() is called from different thread.");
        } else
            throw new IllegalStateException("Object is NOT in Toe state!");
    }
public void releaseToe() {
        if (getCurrentState() == AccessState.TOE) {
            if (1 > 0) {
                //if (toeThread.get() == Thread.currentThread().getId()) {
                if (toeRequests.decrementAndGet() == 0) {
                    tickRequests.set(0);
                    tackRequests.set(0);

                    currentState.set(AccessState.TACK.ordinal());
                }
            } else
                throw new IllegalStateException("releaseToe() is called from different thread.");
        } else
            throw new IllegalStateException("Object is NOT in Toe state!");
    }
public void releaseToe ( ) { if ( getCurrentState ( ) == AccessState . TOE ) { if ( 1 > 0 ) { //if (toeThread.get() == Thread.currentThread().getId()) { if ( toeRequests . decrementAndGet ( ) == 0 ) { tickRequests . set ( 0 ) ; tackRequests . set ( 0 ) ; currentState . set ( AccessState . TACK . ordinal ( ) ) ; } } else throw new IllegalStateException ( "releaseToe() is called from different thread." ) ; } else throw new IllegalStateException ( "Object is NOT in Toe state!" ) ; }
This method requests release Toe status back to Tack.

PLEASE NOTE: only the thread originally entered Toe state is able to release it.
This method requests release Toe status back to Tack .