mirror of
https://github.com/corda/corda.git
synced 2025-01-09 06:23:04 +00:00
Add Collections#synchronizedSet
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
parent
526dd574d9
commit
86c735e649
@ -245,6 +245,10 @@ public class Collections {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static <V> Set<V> synchronizedSet(Set<V> set) {
|
||||||
|
return new SynchronizedSet<V> (new Object(), set);
|
||||||
|
}
|
||||||
|
|
||||||
static class SynchronizedIterator<T> implements Iterator<T> {
|
static class SynchronizedIterator<T> implements Iterator<T> {
|
||||||
private final Object lock;
|
private final Object lock;
|
||||||
private final Iterator<T> it;
|
private final Iterator<T> it;
|
||||||
|
Loading…
Reference in New Issue
Block a user