From 86c735e649cd94b8c2c7d1d4dd39b4bfef826356 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 25 Oct 2013 13:27:09 -0500 Subject: [PATCH] Add Collections#synchronizedSet Signed-off-by: Johannes Schindelin --- classpath/java/util/Collections.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/classpath/java/util/Collections.java b/classpath/java/util/Collections.java index c57c190a06..c820ad20d0 100644 --- a/classpath/java/util/Collections.java +++ b/classpath/java/util/Collections.java @@ -245,6 +245,10 @@ public class Collections { } } + public static Set synchronizedSet(Set set) { + return new SynchronizedSet (new Object(), set); + } + static class SynchronizedIterator implements Iterator { private final Object lock; private final Iterator it;