aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/skyframe/ThinNodeEntry.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/skyframe/ThinNodeEntry.java')
-rw-r--r--src/main/java/com/google/devtools/build/skyframe/ThinNodeEntry.java26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/skyframe/ThinNodeEntry.java b/src/main/java/com/google/devtools/build/skyframe/ThinNodeEntry.java
index 566bc504f0..55ec6cb493 100644
--- a/src/main/java/com/google/devtools/build/skyframe/ThinNodeEntry.java
+++ b/src/main/java/com/google/devtools/build/skyframe/ThinNodeEntry.java
@@ -89,11 +89,29 @@ public interface ThinNodeEntry {
* the caller will only ever want to call {@code markDirty()} a second time if a transition from a
* dirty-unchanged state to a dirty-changed state is required.
*
- * @return true if the node was previously clean, and false if it was already dirty. If it was
- * already dirty, the caller should abort its handling of this node, since another thread is
- * already dealing with it.
+ * @return A {@link ThinNodeEntry.MarkedDirtyResult} if the node was previously clean, and
+ * {@code null} if it was already dirty. If it was already dirty, the caller should abort its
+ * handling of this node, since another thread is already dealing with it.
*/
@Nullable
@ThreadSafe
- boolean markDirty(boolean isChanged);
+ MarkedDirtyResult markDirty(boolean isChanged);
+
+ /**
+ * Returned by {@link #markDirty} if that call changed the node from clean to dirty. Contains an
+ * iterable of the node's reverse deps for efficiency, because the single use case for {@link
+ * #markDirty} is during invalidation, and if such an invalidation call wins, the invalidator
+ * must immediately afterwards schedule the invalidation of the node's reverse deps.
+ */
+ class MarkedDirtyResult {
+ private final Iterable<SkyKey> reverseDepsUnsafe;
+
+ public MarkedDirtyResult(Iterable<SkyKey> reverseDepsUnsafe) {
+ this.reverseDepsUnsafe = reverseDepsUnsafe;
+ }
+
+ public Iterable<SkyKey> getReverseDepsUnsafe() {
+ return reverseDepsUnsafe;
+ }
+ }
}