Lines Matching defs:ref
182 void snd_refcount_init(struct snd_refcount *ref)
184 atomic_set(&ref->count, 0);
185 init_waitqueue_head(&ref->waiter);
186 spin_lock_init(&ref->lock);
190 void snd_refcount_put(struct snd_refcount *ref)
192 guard(spinlock_irqsave)(&ref->lock);
193 if (atomic_dec_and_test(&ref->count))
194 wake_up(&ref->waiter);
198 void snd_refcount_sync(struct snd_refcount *ref)
200 guard(spinlock_irq)(&ref->lock);
201 wait_event_lock_irq(ref->waiter, !atomic_read(&ref->count), ref->lock);