seq_lock.h 573 B

123456789101112131415161718192021
  1. #ifndef __SND_SEQ_LOCK_H
  2. #define __SND_SEQ_LOCK_H
  3. #include <linux/sched.h>
  4. typedef atomic_t snd_use_lock_t;
  5. /* initialize lock */
  6. #define snd_use_lock_init(lockp) atomic_set(lockp, 0)
  7. /* increment lock */
  8. #define snd_use_lock_use(lockp) atomic_inc(lockp)
  9. /* release lock */
  10. #define snd_use_lock_free(lockp) atomic_dec(lockp)
  11. /* wait until all locks are released */
  12. void snd_use_lock_sync_helper(snd_use_lock_t *lock, const char *file, int line);
  13. #define snd_use_lock_sync(lockp) snd_use_lock_sync_helper(lockp, __BASE_FILE__, __LINE__)
  14. #endif /* __SND_SEQ_LOCK_H */