Permalink
Browse files

add concurrency fix

  • Loading branch information...
1 parent d5e99d6 commit 38fdeb066ad1a1cbe18675f3aa55a6494d876878 Costin Leau committed Sep 24, 2012
Showing with 2 additions and 10 deletions.
  1. +2 −10 src/test/java/org/springframework/data/redis/cache/RedisCacheTest.java
@@ -96,25 +96,17 @@ public void testConcurrentRead() throws Exception {
cache.put(key1, value1);
cache.put(key2, value2);
- final Object monitor = new Object();
-
Thread th = new Thread(new Runnable() {
public void run() {
- synchronized (monitor) {
- monitor.notify();
- }
cache.clear();
cache.put(value1, key1);
cache.put(value2, key2);
}
}, "concurrent-cache-access");
- th.run();
-
- synchronized (monitor) {
- monitor.wait(TimeUnit.MILLISECONDS.convert(1, TimeUnit.SECONDS));
- }
+ th.start();
+ th.join();
final Object key3 = getObject();
final Object value3 = getObject();

0 comments on commit 38fdeb0

Please sign in to comment.