All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.core.Thread
java.lang.Object
   |
   +----edu.utah.janos.core.Thread

  Summary

public class  Thread
     extends java.lang.Object
{
          // Fields 3
     private NativeThread nThread;
     private Object obj;
     private final ThreadPool tPool;

          // Constructors 2
     Thread(ThreadPool);
     Thread(ThreadPool, Runnable);

          // Methods 11
     public static Thread currentThread();
     public static void interrupt(Thread);
     public static Thread self();
     public static void sleep(long, int) throws InterruptedException;
     public static void yield();
     public static void yieldTo(Thread);

     public Flow getFlow();
     public Object getObject();
     void run();
     public void setObject(Object);
     public String toString();
}

A Janos Thread. java.lang.Thread is not visible to threads running on the NodeOS.

A Janos thread is never explicitly created by a Protocol, only implicitly by ThreadGroups.


  Cross Reference

Returned By:
Node.threadStart()





  Fields

· nThread

Summary  |  Top
   private NativeThread nThread

The java.lang.Thread this Janos thread is implemented on top of.

This is just a cheap hack until we get the native support working correctly.


· obj

Summary  |  Top
   private Object obj

Per-thread state.

This is part of the NodeOS spec. Probably doesn't need to be part of the Java-level interface (users of this should just subclass Janos Thread).


· tPool

Summary  |  Top
   private final ThreadPool tPool

The ThreadPool this thread is a part of.


  Constructors

· Thread

Summary  |  Top

   Thread(ThreadPool tPool) 

For creating an implicit thread.

All thread constructors are package private.



· Thread

Summary  |  Top
   Thread(ThreadPool tPool, 
          Runnable r) 

For creating an explicit thread.

All thread constructors are package private.



  Methods

· run

Summary  |  Top
   void run() 

Package-private run method that all threads start in (once kicked).



· self

Summary  |  Top
   public static Thread self() 

Return the Thread object associated with the currently executing thread of control.

Returns:
a Thread object associated with the current thread.

See Also: currentThread



· currentThread

Summary  |  Top
   public static Thread currentThread() 

See Also: self



· getFlow

Summary  |  Top
   public Flow getFlow() 


· yieldTo

Summary  |  Top
   public static void yieldTo(Thread yieldTo) 

The mighty directed yield.

The scheduler may honor the argument. Or it may laugh at your suggestion and put the target thread in a black hole just to spite you.

Parameter Description
yieldTo the thread that should be run in deference to the current thread.



· yield

Summary  |  Top
   public static void yield() 

An undirected yield.

Equivalent to yield(null).



· sleep

Summary  |  Top
   public static void sleep(long millis, 
                            int nanos)  throws InterruptedException

Put the current thread to sleep for at least the given amount of time.



· toString

Summary  |  Top
   public String toString() 
Overrides:
toString in class Object


· setObject

Summary  |  Top
   public void setObject(Object obj) 


· getObject

Summary  |  Top
   public Object getObject() 


· interrupt

Summary  |  Top
   public static void interrupt(Thread target) 


All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7