java.lang.Object
net.i2p.router.tunnel.pool.TestJob.InstanceClaims
Enclosing class:
TestJob

static final class TestJob.InstanceClaimsextends Object
The instance slots one TestJob owns: the total counter (memory bound), the per-pool claim, and the running-test registration. Built when the slots are taken and handed to the instance, so every release goes through one CAS-gated object instead of ad-hoc decrements — a path that runs twice (drop racing completion) becomes a no-op, and the pool id is captured once rather than recomputed from possibly-changed pool settings at release time.
  • Field Details

    • poolId

      final String poolId
      Pool identity captured when the claim was taken; null when there is no pool.
    • totalHeld

      final AtomicBoolean totalHeld
      True until the total counter has been released.
    • poolHeld

      final AtomicBoolean poolHeld
      True while the per-pool claim is outstanding.
    • runningHeld

      final AtomicBoolean runningHeld
      True once the running-test registration succeeded.
  • Constructor Details

    • InstanceClaims

      InstanceClaims(String poolId)
      Claim a pool's slot, which is held only when the job actually has a pool.
      Parameters:
      poolId - pool identity captured when the claim was taken, or null
  • Method Details

    • releaseTotal

      void releaseTotal(TestJob.BatchState state)
      Release the total counter once.
      Parameters:
      state - the context's batch state
    • releasePool

      void releasePool(TestJob.BatchState state)
      Release the per-pool claim once, under the id captured at claim time.
      Parameters:
      state - the context's batch state
    • releaseAll

      void releaseAll(TestJob.BatchState state, TestJob instance, Long tunnelKey)
      Release whatever this object still holds: the running-test registration, the pool claim, and the total counter. Used by the constructor's invalidation paths, where no single one of the three is known to have been taken.
      Parameters:
      state - the context's batch state
      instance - the registered instance, or null when registration never happened
      tunnelKey - the running-test key, or null when none exists