Permalink
Browse files

Fix JRUBY-6603

To avoid attempting to read the ENV hash while it might be updated
elsewhere, I added a dup call. This is not 100% perfect if dup is
not threadsafe (unsure) but it was able to pass the given
contrived example.
  • Loading branch information...
headius committed May 16, 2012
1 parent 8fecee7 commit 5032adeb443cf3116b05d97e99143ff91ded7067
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/org/jruby/util/ShellLauncher.java
@@ -215,7 +215,7 @@ private void closeStreams() {
}
private static String[] getCurrentEnv(Ruby runtime, Map mergeEnv) {
- RubyHash hash = (RubyHash)runtime.getObject().getConstant("ENV");
+ RubyHash hash = (RubyHash)runtime.getObject().getConstant("ENV").dup();
String[] ret;
if (mergeEnv != null && !mergeEnv.isEmpty()) {

0 comments on commit 5032ade

Please sign in to comment.