Permalink
Browse files

use ConcurrentHashMap instead of Hashtable

  • Loading branch information...
1 parent 64e7635 commit 61d5f02808cc9786bb8dfe909a2006c6ea21ec20 @charliesome committed Jun 11, 2013
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/org/jruby/Ruby.java
View
@@ -135,6 +135,7 @@
import java.security.SecureRandom;
import java.util.*;
import java.util.concurrent.Callable;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.SynchronousQueue;
import java.util.concurrent.ThreadPoolExecutor;
@@ -4462,7 +4463,11 @@ public CallbackFactory callbackFactory(Class<?> type) {
throw new RuntimeException("callback-style handles are no longer supported in JRuby");
}
- private final Hashtable<String, Invalidator> constantNameInvalidators = new Hashtable<String, Invalidator>();
+ private final ConcurrentHashMap<String, Invalidator> constantNameInvalidators =
+ new ConcurrentHashMap<String, Invalidator>(
+ 16 /* default initial capacity */,
+ 0.75f /* default load factory */,
+ 1 /* concurrency level - mostly reads here so this can be 1 */);
private final Invalidator checkpointInvalidator;
private final ThreadService threadService;

0 comments on commit 61d5f02

Please sign in to comment.