ejb3/src/main/java/org/jboss/as/ejb3/component/singleton/EJBReadWriteLock.java
private void checkLoopback() {
        Integer current = readLockCount.get();
        if (current != null) {
            assert current.intValue() > 0 : "readLockCount is set, but to 0";
            throw EjbLogger.ROOT_LOGGER.failToUpgradeToWriteLock();
        }
    }
private void checkLoopback() {
        Integer current = readLockCount.get();
        if (current != null) {
            assert current.intValue() > 0 : "readLockCount is set, but to 0";
            throw EjbLogger.ROOT_LOGGER.failToUpgradeToWriteLock();
        }
    }
Ensures that the current thread doesn't hold any read locks. If
the thread holds any read locks, this method throws a {@link javax.ejb.IllegalLoopbackException}.