From 38fdeb066ad1a1cbe18675f3aa55a6494d876878 Mon Sep 17 00:00:00 2001 From: Costin Leau Date: Mon, 24 Sep 2012 20:56:20 +0300 Subject: [PATCH] add concurrency fix --- .../data/redis/cache/RedisCacheTest.java | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/test/java/org/springframework/data/redis/cache/RedisCacheTest.java b/src/test/java/org/springframework/data/redis/cache/RedisCacheTest.java index 527d00270..986fa17d4 100644 --- a/src/test/java/org/springframework/data/redis/cache/RedisCacheTest.java +++ b/src/test/java/org/springframework/data/redis/cache/RedisCacheTest.java @@ -96,25 +96,17 @@ public class RedisCacheTest extends AbstractNativeCacheTest { 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();