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

Comparing jsr166/src/test/loops/RLMap.java (file contents):
Revision 1.5 by jsr166, Tue Mar 15 19:47:05 2011 UTC vs.
Revision 1.7 by jsr166, Thu Jan 15 18:34:19 2015 UTC

# Line 8 | Line 8 | import java.util.*;
8   import java.util.concurrent.*;
9   import java.util.concurrent.locks.*;
10  
11
11   /**
12   * This is an incomplete implementation of a wrapper class
13   * that places read-write locks around unsynchronized Maps.
14   * Exists as a sample input for MapLoops test.
15   */
17
16   public class RLMap implements Map {
17      private final Map m;
18      private final ReentrantLock rl = new ReentrantLock();
# Line 47 | Line 45 | public class RLMap implements Map {
45          rl.lock(); try {return m.containsValue(value);} finally { rl.unlock(); }
46      }
47  
50
48      public Set keySet() { // Not implemented
49          return m.keySet();
50      }
# Line 70 | Line 67 | public class RLMap implements Map {
67          rl.lock(); try {return m.toString();} finally { rl.unlock(); }
68      }
69  
73
74
70      public Object put(Object key, Object value) {
71          rl.lock(); try {return m.put(key, value);} finally { rl.unlock(); }
72      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines