diff options
author | Janak Ramakrishnan <janakr@google.com> | 2015-04-29 19:50:26 +0000 |
---|---|---|
committer | John Field <jfield@google.com> | 2015-04-30 18:41:21 +0000 |
commit | 0e24c69ff69c4d9f2dd1cc05eba9ca71a842dca8 (patch) | |
tree | 3542aa53404b59b4692ff616658c6d4a3e7c1774 /src/main/java/com/google/devtools/build/lib/concurrent | |
parent | e8f664780e3089b0af8b267effdec0f3242843ad (diff) |
Change getBatch signature from Set to Iterable since Iterable is all that's needed. Also clean up some lint warnings/unresolved references.
--
MOS_MIGRATED_REVID=92380618
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/concurrent')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/concurrent/BatchedKeyedLocker.java | 5 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/concurrent/RefCountedMultisetKeyedLocker.java | 3 |
2 files changed, 2 insertions, 6 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/concurrent/BatchedKeyedLocker.java b/src/main/java/com/google/devtools/build/lib/concurrent/BatchedKeyedLocker.java index d65b3c165d..748262a6fe 100644 --- a/src/main/java/com/google/devtools/build/lib/concurrent/BatchedKeyedLocker.java +++ b/src/main/java/com/google/devtools/build/lib/concurrent/BatchedKeyedLocker.java @@ -13,10 +13,7 @@ // limitations under the License. package com.google.devtools.build.lib.concurrent; -import com.google.devtools.build.lib.concurrent.KeyedLocker.AutoUnlocker; - import java.util.Comparator; -import java.util.Set; /** A {@link KeyedLocker} that additionally offers batched locking functionality. */ public interface BatchedKeyedLocker<K> extends KeyedLocker<K> { @@ -42,5 +39,5 @@ public interface BatchedKeyedLocker<K> extends KeyedLocker<K> { * * <p>Note that use of this method avoids the concerns described in {@link #lock}. */ - AutoUnlocker lockBatch(Set<K> keys); + AutoUnlocker lockBatch(Iterable<K> keys); } diff --git a/src/main/java/com/google/devtools/build/lib/concurrent/RefCountedMultisetKeyedLocker.java b/src/main/java/com/google/devtools/build/lib/concurrent/RefCountedMultisetKeyedLocker.java index 5cab307e4e..a2e089f6e2 100644 --- a/src/main/java/com/google/devtools/build/lib/concurrent/RefCountedMultisetKeyedLocker.java +++ b/src/main/java/com/google/devtools/build/lib/concurrent/RefCountedMultisetKeyedLocker.java @@ -21,7 +21,6 @@ import com.google.common.util.concurrent.Striped; import java.util.ArrayList; import java.util.Comparator; import java.util.List; -import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.atomic.AtomicBoolean; @@ -156,7 +155,7 @@ public class RefCountedMultisetKeyedLocker<K> implements BatchedKeyedLocker<K> { } @Override - public AutoUnlocker lockBatch(Set<K> keys) { + public AutoUnlocker lockBatch(Iterable<K> keys) { // This indicates the client did some unsafe casting - not our problem. Preconditions.checkNotNull(comparator); // We acquire locks in a consistent order. This prevents a deadlock that would otherwise occur |