Permalink
Browse files

ETimerTask: Using ConcurrentHashMap instead of WeakHashMap (which did…

…n't make sense anyway) for global ref->timer map.
  • Loading branch information...
1 parent d41a031 commit 495f9d338d992879c2f485f93049b563e3f211e3 Erik Søe Sørensen committed Nov 21, 2010
Showing with 3 additions and 5 deletions.
  1. +3 −5 src/main/java/erjang/ETimerTask.java
@@ -21,7 +21,7 @@
import java.util.Timer;
import java.util.TimerTask;
-import java.util.WeakHashMap;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.Collections;
import java.util.Map;
@@ -35,10 +35,8 @@
// TODO: implement a Kilim timer, that allows Pausable in on_timeout.
// for now, we will live with the risk of having a
// blocking send in a timer...
-
- // TODO: consider using ConcurrentMap instead? (Or a weak equivalent)
- static Map<ERef, ETimerTask> timer_refs =
- Collections.synchronizedMap(new WeakHashMap<ERef, ETimerTask>());
+
+ static ConcurrentHashMap<ERef, ETimerTask> timer_refs = new ConcurrentHashMap();
static Timer send_timer = new Timer();
final ERef ref;

0 comments on commit 495f9d3

Please sign in to comment.