Package-level declarations
Types
Wait your turn for a slot. A build farm has four agents and two lanes, web and mobile; a program handing them out wants to say "run this in web's lane when it is web's turn" and have that one line wait. A FairSharePool holds a LocalHeddle, which knows whose turn it is, and a count of slots. withSlot suspends until fair share grants the caller's leaf a slot, runs the work, and charges the lane the time the work took, however it ends. acquire is the same wait on its own: the caller hands the slot back with complete or cancel.
What a FairSharePool holds at one moment: who is queued for which lane, how many slots are in use, and how many there are. A status page that shows "who goes next" reads it rather than keeping its own count beside the pool's, which would race it.
What FairSharePool.acquire answered: a slot, or the reason none can be granted to that leaf as the tree stands now.
What FairSharePool.withSlot throws where FairSharePool.acquire would answer SlotOutcome.Refused: no lease can be granted to the leaf as the tree stands now, so the block never runs.