busy looping for jruby

See https://github.com/jruby/jruby/issues/496