aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/query2
diff options
context:
space:
mode:
authorGravatar dbabkin <dbabkin@google.com>2018-04-10 07:23:11 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-04-10 07:24:51 -0700
commit9f58c5058d576563e9edcb1c156f711bbf9ef753 (patch)
treeec8f53836ea92902290b8fbf51b8be52321e96d5 /src/main/java/com/google/devtools/build/lib/query2
parentcb5d236c9be2e9cb13b0284ae1e54861b5e2cb0d (diff)
Remove lock around DiGraph in BlazeQueryEnvironment
- New lock introduced around Node.succs and Node.preds. These locks always hold in direction Node.succs -> Node.preds that's why reordering deadlock never happens. - All logic related to changing collection implementation from ArrayList to CompactHasSet and vise versa encapsulated in dedicated class ConcurrentCollectionWrapper. - Remove some code related to removing node from DiGraph to Node. RELNOTES:none PiperOrigin-RevId: 192282628
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/query2')
-rw-r--r--src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java b/src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java
index 3c5bf30491..68ab117f37 100644
--- a/src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java
+++ b/src/main/java/com/google/devtools/build/lib/query2/BlazeQueryEnvironment.java
@@ -348,7 +348,7 @@ public class BlazeQueryEnvironment extends AbstractBlazeQueryEnvironment<Target>
private class GraphBuildingObserver implements TargetEdgeObserver {
@Override
- public synchronized void edge(Target from, Attribute attribute, Target to) {
+ public void edge(Target from, Attribute attribute, Target to) {
Preconditions.checkState(attribute == null ||
dependencyFilter.apply(((Rule) from), attribute),
"Disallowed edge from LabelVisitor: %s --> %s", from, to);
@@ -356,7 +356,7 @@ public class BlazeQueryEnvironment extends AbstractBlazeQueryEnvironment<Target>
}
@Override
- public synchronized void node(Target node) {
+ public void node(Target node) {
graph.createNode(node);
}