Wed Jun 5 06:33:35 PDT 1996 Class SemiThread

Class SemiThread

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----SemiThread

class SemiThread
extends Thread
A SemiThread has a parent that creates it. When it runs the parent is suspended and vice versa. In this case a single integer is sent with each switch.

Variable Index

n
Input buffer
parent
The Thread that made me

Constructor Index

SemiThread(Thread)

Method Index

run()
sent(int)
Place data into buffer and restarts child in place of parent
wait_for_number()
Resume parent and suspend oneself


Variables

parent
  protected Thread parent
The Thread that made me
n
  protected int n
Input buffer


Constructors

SemiThread
  public SemiThread(Thread parent)


Methods

sent
  public void sent(int n)
Place data into buffer and restarts child in place of parent
wait_for_number
  protected void wait_for_number()
Resume parent and suspend oneself
run
  public abstract void run()
Overrides:
run in class Thread