ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/loops/SynchronizedCollection.java
(Generate patch)

Comparing jsr166/src/test/loops/SynchronizedCollection.java (file contents):
Revision 1.1 by dl, Tue Oct 4 20:09:41 2005 UTC vs.
Revision 1.2 by dl, Mon Feb 19 00:46:06 2007 UTC

# Line 1 | Line 1
1 +
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
6 + */
7 +
8   // Stand-alone version of java.util.Collections.synchronizedCollection
9   import java.util.*;
10   import java.io.*;
11  
12   public final class SynchronizedCollection<E> implements Collection<E>, Serializable {
6    // use serialVersionUID from JDK 1.2.2 for interoperability
7    private static final long serialVersionUID = 3053995032091335093L;
8
13      final Collection<E> c;         // Backing Collection
14      final Object           mutex;  // Object on which to synchronize
15  
# Line 41 | Line 45 | public final class SynchronizedCollectio
45      }
46  
47      public final Iterator<E> iterator() {
48 <        return c.iterator(); // Must be manually synched by user!
48 >        return c.iterator();
49      }
50  
51      public final boolean add(E e) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines