2 |
|
/* |
3 |
|
* Written by Doug Lea with assistance from members of JCP JSR-166 |
4 |
|
* Expert Group and released to the public domain, as explained at |
5 |
< |
* http://creativecommons.org/licenses/publicdomain |
5 |
> |
* http://creativecommons.org/publicdomain/zero/1.0/ |
6 |
|
*/ |
7 |
|
|
8 |
|
// Stand-alone version of java.util.Collections.synchronizedCollection |
10 |
|
import java.io.*; |
11 |
|
|
12 |
|
public final class SynchronizedCollection<E> implements Collection<E>, Serializable { |
13 |
< |
final Collection<E> c; // Backing Collection |
14 |
< |
final Object mutex; // Object on which to synchronize |
13 |
> |
final Collection<E> c; // Backing Collection |
14 |
> |
final Object mutex; // Object on which to synchronize |
15 |
|
|
16 |
|
public SynchronizedCollection(Collection<E> c) { |
17 |
|
if (c==null) |