/** scan lock queues for thread and report its state */ @Interruptible public static String getThreadState(RVMThread t) { for (int i = 0; i < numLocks(); i++) { Lock l = getLock(i); if (l == null || !l.active) continue; if (l.isBlocked(t)) return ("waitingForLock(blocked)" + i); if (l.isWaiting(t)) return "waitingForNotification(waiting)"; } return null; }