Skip to content

Commit

Permalink
Clarify thread-safety guarantees
Browse files Browse the repository at this point in the history
  • Loading branch information
martint committed Aug 26, 2024
1 parent 1d5510c commit 8347f3c
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import com.google.common.collect.ImmutableSet;
import com.google.errorprone.annotations.ThreadSafe;
import com.google.errorprone.annotations.concurrent.GuardedBy;

import java.util.HashSet;
import java.util.Set;
Expand All @@ -35,6 +36,8 @@
final class Reservation<T>
{
private final Semaphore semaphore;

@GuardedBy("this")
private final Set<T> reservations = new HashSet<>();
private final int slots;

Expand Down

0 comments on commit 8347f3c

Please sign in to comment.