PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/jEdit/tags/jedit-4-5-pre1/org/gjt/sp/jedit/bsh/commands/bg.bsh

#
Unknown | 22 lines | 18 code | 4 blank | 0 comment | 0 complexity | 3fe36fe0d3cabb06fd5bf378755915ed MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  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. }