/jEdit/tags/jedit-4-2-pre4/bsh/commands/bg.bsh

# · Unknown · 22 lines · 18 code · 4 blank · 0 comment · 0 complexity · 3fe36fe0d3cabb06fd5bf378755915ed MD5 · raw file

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