/** * Get the thread(s) that own the lock this thread is waiting for. */ private Thread[] blockingThreads(Thread current) { //find the lock this thread is waiting for ISchedulingRule lock = (ISchedulingRule) getWaitingLock(current); return getThreadsOwningLock(lock); }
/** * Get the thread(s) that own the lock this thread is waiting for. */ private Thread[] blockingThreads(Thread current) { //find the lock this thread is waiting for ISchedulingRule lock = (ISchedulingRule) getWaitingLock(current); return getThreadsOwningLock(lock); }
/** * Get the thread(s) that own the lock this thread is waiting for. */ private Thread[] blockingThreads(Thread current) { //find the lock this thread is waiting for ISchedulingRule lock = (ISchedulingRule) getWaitingLock(current); return getThreadsOwningLock(lock); }
/** * Get the thread(s) that own the lock this thread is waiting for. */ private Thread[] blockingThreads(Thread current) { //find the lock this thread is waiting for ISchedulingRule lock = (ISchedulingRule) getWaitingLock(current); return getThreadsOwningLock(lock); }
/** * Adds a 'deadlock detected' message to the log with a stack trace. */ private void reportDeadlock(Deadlock deadlock) { String msg = "Deadlock detected. All locks owned by thread " + deadlock.getCandidate().getName() + " will be suspended."; //$NON-NLS-1$ //$NON-NLS-2$ MultiStatus main = new MultiStatus(JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, new IllegalStateException()); Thread[] threads = deadlock.getThreads(); for (int i = 0; i < threads.length; i++) { Object[] ownedLocks = getOwnedLocks(threads[i]); Object waitLock = getWaitingLock(threads[i]); StringBuffer buf = new StringBuffer("Thread "); //$NON-NLS-1$ buf.append(threads[i].getName()); buf.append(" has locks: "); //$NON-NLS-1$ for (int j = 0; j < ownedLocks.length; j++) { buf.append(ownedLocks[j]); buf.append((j < ownedLocks.length - 1) ? ", " : " "); //$NON-NLS-1$ //$NON-NLS-2$ } buf.append("and is waiting for lock "); //$NON-NLS-1$ buf.append(waitLock); Status child = new Status(IStatus.ERROR, JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, buf.toString(), null); main.add(child); } RuntimeLog.log(main); }
/** * Adds a 'deadlock detected' message to the log with a stack trace. */ private void reportDeadlock(Deadlock deadlock) { String msg = "Deadlock detected. All locks owned by thread " + deadlock.getCandidate().getName() + " will be suspended."; //$NON-NLS-1$ //$NON-NLS-2$ MultiStatus main = new MultiStatus(JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, new IllegalStateException()); Thread[] threads = deadlock.getThreads(); for (int i = 0; i < threads.length; i++) { Object[] ownedLocks = getOwnedLocks(threads[i]); Object waitLock = getWaitingLock(threads[i]); StringBuffer buf = new StringBuffer("Thread "); //$NON-NLS-1$ buf.append(threads[i].getName()); buf.append(" has locks: "); //$NON-NLS-1$ for (int j = 0; j < ownedLocks.length; j++) { buf.append(ownedLocks[j]); buf.append((j < ownedLocks.length - 1) ? ", " : " "); //$NON-NLS-1$ //$NON-NLS-2$ } buf.append("and is waiting for lock "); //$NON-NLS-1$ buf.append(waitLock); Status child = new Status(IStatus.ERROR, JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, buf.toString(), null); main.add(child); } RuntimeLog.log(main); }
/** * Adds a 'deadlock detected' message to the log with a stack trace. */ private void reportDeadlock(Deadlock deadlock) { String msg = "Deadlock detected. All locks owned by thread " + deadlock.getCandidate().getName() + " will be suspended."; //$NON-NLS-1$ //$NON-NLS-2$ MultiStatus main = new MultiStatus(JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, new IllegalStateException()); Thread[] threads = deadlock.getThreads(); for (int i = 0; i < threads.length; i++) { Object[] ownedLocks = getOwnedLocks(threads[i]); Object waitLock = getWaitingLock(threads[i]); StringBuffer buf = new StringBuffer("Thread "); //$NON-NLS-1$ buf.append(threads[i].getName()); buf.append(" has locks: "); //$NON-NLS-1$ for (int j = 0; j < ownedLocks.length; j++) { buf.append(ownedLocks[j]); buf.append((j < ownedLocks.length - 1) ? ", " : " "); //$NON-NLS-1$ //$NON-NLS-2$ } buf.append("and is waiting for lock "); //$NON-NLS-1$ buf.append(waitLock); Status child = new Status(IStatus.ERROR, JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, buf.toString(), null); main.add(child); } RuntimeLog.log(main); }
/** * Adds a 'deadlock detected' message to the log with a stack trace. */ private void reportDeadlock(Deadlock deadlock) { String msg = "Deadlock detected. All locks owned by thread " + deadlock.getCandidate().getName() + " will be suspended."; //$NON-NLS-1$ //$NON-NLS-2$ MultiStatus main = new MultiStatus(JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, msg, new IllegalStateException()); Thread[] threads = deadlock.getThreads(); for (int i = 0; i < threads.length; i++) { Object[] ownedLocks = getOwnedLocks(threads[i]); Object waitLock = getWaitingLock(threads[i]); StringBuffer buf = new StringBuffer("Thread "); //$NON-NLS-1$ buf.append(threads[i].getName()); buf.append(" has locks: "); //$NON-NLS-1$ for (int j = 0; j < ownedLocks.length; j++) { buf.append(ownedLocks[j]); buf.append((j < ownedLocks.length - 1) ? ", " : " "); //$NON-NLS-1$ //$NON-NLS-2$ } buf.append("and is waiting for lock "); //$NON-NLS-1$ buf.append(waitLock); Status child = new Status(IStatus.ERROR, JobManager.PI_JOBS, JobManager.PLUGIN_ERROR, buf.toString(), null); main.add(child); } RuntimeLog.log(main); }