summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorara.t.howard <ara.t.howard@gmail.com>2014-03-04 12:30:29 -0700
committerara.t.howard <ara.t.howard@gmail.com>2014-03-04 12:30:29 -0700
commitcc74bfe538ad8b041ffb86cd22d9d1b32a6898ef (patch)
treef58d58e88e60aa5f9c105237c54adb9d1885f0d6
parent076ef54e839e7ea0a70126dfe1f6c0ef5ed30859 (diff)
parent6f910ee619f4ad6f05f55eaf42289d7691debf20 (diff)
downloadsystemu-cc74bfe538ad8b041ffb86cd22d9d1b32a6898ef.tar.gz
Merge pull request #22 from damphyr/jruby-block
use the block in a thread in the jruby monkeypatch
-rw-r--r--lib/systemu.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/systemu.rb b/lib/systemu.rb
index e4dd7e7..c32b9bc 100644
--- a/lib/systemu.rb
+++ b/lib/systemu.rb
@@ -286,10 +286,11 @@ if defined? JRUBY_VERSION
StreamReader.new(stream)
end
- exit_code = process.wait_for
field = process.get_class.get_declared_field("pid")
field.set_accessible(true)
pid = field.get(process)
+ thread = new_thread pid, @block if @block
+ exit_code = process.wait_for
[
RubyProcess::RubyStatus.new_process_status(JRuby.runtime, exit_code, pid),
stdout.join,