- evrec_t *p;
-
- spin_lock_irqsave(&q->lock, *rflags);
- if (q->qlen == 0) {
- if (blocking) {
- spin_unlock(&q->lock);
- interruptible_sleep_on_timeout(&q->midi_sleep,
- q->pre_event_timeout);
- spin_lock(&q->lock);
- }
- if (q->qlen == 0) {
- spin_unlock_irqrestore(&q->lock, *rflags);
- return NULL;
- }
- }
- p = q->q + q->head;
-
- return p;