add concurrency fix

This commit is contained in:
Costin Leau
2012-09-24 20:56:20 +03:00
parent d5e99d6afc
commit 38fdeb066a

View File

@@ -96,25 +96,17 @@ public class RedisCacheTest extends AbstractNativeCacheTest<RedisTemplate> {
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();