Home | History | Annotate | Download | only in m_scheduler

Lines Matching defs:ticket

3 /*--- Linux ticket lock implementation         ticket-lock-linux.c ---*/
73 return "ticket lock";
107 * Acquire ticket lock. Increment the tail of the queue and use the original
108 * value as the ticket value. Wait until the head of the queue equals the
109 * ticket value. The futex used to wait depends on the ticket value in order
110 * to avoid that all threads get woken up every time a ticket lock is
114 * See also Nick Piggin, x86: FIFO ticket spinlocks, Linux kernel mailing list
119 unsigned ticket, futex_value;
123 ticket = __sync_fetch_and_add(&p->tail, 1);
124 futex = &p->futex[ticket & TL_FUTEX_MASK];
126 VG_(printf)("[%d/%d] acquire: ticket %d\n", VG_(getpid)(),
127 VG_(gettid)(), ticket);
131 if (ticket == p->head)
134 VG_(printf)("[%d/%d] acquire: ticket %d - waiting until"
136 VG_(gettid)(), ticket, (long)(futex - p->futex),
153 * Release a ticket lock by incrementing the head of the queue. Only generate
175 VG_(printf)("[%d/%d] release: waking up ticket %d (futex[%ld] = %d)"
184 VG_(printf)("[%d/%d] release: no thread is waiting for ticket %d\n",