/**
 * Un mensaje.  Derive de esta clase los mensajes que necesite
 * intercambiar entre threads.
 */
public class Msg
{
  private Thread sender;

  public synchronized void send(Port port)
  {
    sender= Thread.currentThread();
    port.simplePort.send(this);
    try { wait(); }
    catch ( InterruptedException I ) { throw new Error("Interrupcion"); }
  }

  public synchronized void reply()
  {
    notify();
  }

  public Thread getSender() { return sender; }
}
