home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Shareware / Comunicatii / advwebrank / awr.msi / disk1.cab / bsh_1.2b6.jar / bsh / commands / bg.bsh < prev    next >
Encoding:
Text File  |  2002-05-24  |  478 b   |  23 lines

  1. /**
  2.     Source a command in its own thread in the caller's namespace
  3.     <p>
  4.  
  5.     This is like run() except that it runs the command in its own thread.  
  6.     Returns the Thread object control.
  7.     @method Thread bg( String filename )
  8. */
  9.  
  10. bsh.help.run= "usage: Thread bg( filename )";
  11.  
  12. Thread bg( String filename ) {
  13.  
  14.     callerNameSpace = this.caller.namespace;
  15.     run() {
  16.         this.interpreter.source( filename, callerNameSpace );
  17.     }
  18.  
  19.     thread = new Thread( this );
  20.     thread.start();
  21.     return thread;
  22. }
  23.