java.lang.Object
net.i2p.router.tunnel.pool.TestJob.InstanceClaims
- Enclosing class:
TestJob
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 Summary
FieldsModifier and TypeFieldDescription(package private) final AtomicBooleanTrue while the per-pool claim is outstanding.(package private) final StringPool identity captured when the claim was taken; null when there is no pool.(package private) final AtomicBooleanTrue once the running-test registration succeeded.(package private) final AtomicBooleanTrue until the total counter has been released.Constructor Summary
ConstructorsConstructorDescriptionInstanceClaims(String poolId) Claim a pool's slot, which is held only when the job actually has a pool.Method Summary
All MethodsModifier and TypeMethodDescription(package private) voidreleaseAll(TestJob.BatchState state, TestJob instance, Long tunnelKey) Release whatever this object still holds: the running-test registration, the pool claim, and the total counter.(package private) voidreleasePool(TestJob.BatchState state) Release the per-pool claim once, under the id captured at claim time.(package private) voidreleaseTotal(TestJob.BatchState state) Release the total counter once.
Field Details
poolId
Pool identity captured when the claim was taken; null when there is no pool.totalHeld
True until the total counter has been released.poolHeld
True while the per-pool claim is outstanding.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
Release the total counter once.- Parameters:
state- the context's batch state
releasePool
Release the per-pool claim once, under the id captured at claim time.- Parameters:
state- the context's batch state
releaseAll
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 stateinstance- the registered instance, or null when registration never happenedtunnelKey- the running-test key, or null when none exists