Class Slot

All Implemented Interfaces:
BoundedChannel, Channel, Puttable, Takable

public class Slot extends SemaphoreControlledChannel
A one-slot buffer, using semaphores to control access. Slots are usually more efficient and controllable than using other bounded buffers implementations with capacity of 1.

Among other applications, Slots can be convenient in token-passing designs: Here. the Slot holds a some object serving as a token, that can be obtained and returned by various threads.

[ Introduction to this package. ]