/jEdit/tags/jedit-4-0-pre5/bsh/commands/bg.bsh

# · Unknown · 24 lines · 20 code · 4 blank · 0 comment · 0 complexity · 28118884e16a538c7fd9aed0600f0eff MD5 · raw file

  1. bsh.help.run= "usage: Thread bg( filename )";
  2. //import bsh.NameSpace;
  3. /**
  4. Source a command in its own thread in the caller's namespace
  5. */
  6. Thread bg( String filename ) {
  7. callerNameSpace = this.caller.namespace;
  8. run() {
  9. /*
  10. used to be subordinate namespace
  11. ns = new NameSpace(
  12. this.caller.namespace,
  13. "Running command: "+filename, super.interpreter );
  14. */
  15. this.interpreter.source( filename, callerNameSpace );
  16. }
  17. thread = new Thread( this );
  18. thread.start();
  19. return thread;
  20. }