Home | History | Annotate | Download | only in ticketpool

Lines Matching defs:ticket

47  * as soon as possible, which may depend on consumers of this ticket pool
71 * Wraps tickets from the parent ticket pool with logic to either release
75 private class TicketImpl implements Ticket {
76 private final Ticket mParentTicket;
79 private TicketImpl(Ticket parentTicket) {
93 // and return the ticket to the parent by closing it.
134 private final ArrayDeque<Ticket> mParentTickets;
172 public Collection<Ticket> acquire(int tickets) throws InterruptedException,
174 Collection<Ticket> acquiredParentTickets = acquireParentTickets(tickets);
176 List<Ticket> wrappedTicketList = new ArrayList<>();
177 for (Ticket parentTicket : acquiredParentTickets) {
190 public Ticket tryAcquire() {
191 Ticket parentTicket;
215 Collection<Ticket> tickets = mParentPool.acquire(additionalCapacity);
221 for (Ticket ticket : tickets) {
222 mParentTickets.add(ticket);
234 * Releases the capacity to the parent ticket pool. Note that the tickets
245 List<Ticket> parentTicketsToRelease = new ArrayList<>();
266 for (Ticket ticket : parentTicketsToRelease) {
267 ticket.close();
274 * Releases all remaining capacity to the parent ticket pool.
296 private Collection<Ticket> acquireParentTickets(int tickets) throws InterruptedException,
301 List<Ticket> acquiredParentTickets = null;
330 * @return The tickets acquired from the parent ticket pool, or null if they
335 private List<Ticket> tryAcquireAtomically(int tickets) throws NoCapacityAvailableException {
336 List<Ticket> acquiredParentTickets = new ArrayList<>();