lejos.nxt.debug
Class DebugThreads

java.lang.Object
  extended by lejos.nxt.debug.DebugThreads

public class DebugThreads
extends Object

This class provides access to the VM threads structures. The VM holds the thread structures as a set of circular linked lists of threads. There is one list for each thread priority level and the head of the list is referred to from the threads array.

Author:
andy

Constructor Summary
DebugThreads(DebugInterface info)
          Initialise access to the VM structures
 
Method Summary
 int enumerate(DebugThread[] curThreads)
          Return the currently exsiting threads as an array.
protected static void resumeThread(Object thread)
          Resume a thread.
protected static void suspendThread(Object thread)
          Suspend a thread.
static Thread toThread(DebugThread dt)
          Convert a DebugThread into a Thread to allow access to the normal Thread interface.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

DebugThreads

public DebugThreads(DebugInterface info)
Initialise access to the VM structures

Parameters:
info - the interface to the VM
Method Detail

enumerate

public int enumerate(DebugThread[] curThreads)
Return the currently exsiting threads as an array. The threads are returned in priority order with the highest priority thread being first. This call should probably not be used if other threads are active.

Parameters:
curThreads - array to store the threads
Returns:
the number of threads returned.

toThread

public static Thread toThread(DebugThread dt)
Convert a DebugThread into a Thread to allow access to the normal Thread interface.

Parameters:
dt - the DebugThread
Returns:
the Thread

suspendThread

protected static final void suspendThread(Object thread)
Suspend a thread. This places the specified thread into a suspended state. If thread is null all threads except for the current thread will be suspended.

Parameters:
thread -

resumeThread

protected static final void resumeThread(Object thread)
Resume a thread. A suspended thread will be resumed to it's previous state. If thread is null all suspended threads will be resumed.

Parameters:
thread -