1 #ifndef __SND_SEQ_LOCK_H
2 #define __SND_SEQ_LOCK_H
4 #include <linux/sched.h>
6 #if defined(CONFIG_SMP) || defined(CONFIG_SND_DEBUG)
8 typedef atomic_t snd_use_lock_t
;
11 #define snd_use_lock_init(lockp) atomic_set(lockp, 0)
14 #define snd_use_lock_use(lockp) atomic_inc(lockp)
17 #define snd_use_lock_free(lockp) atomic_dec(lockp)
19 /* wait until all locks are released */
20 void snd_use_lock_sync_helper(snd_use_lock_t
*lock
, const char *file
, int line
);
21 #define snd_use_lock_sync(lockp) snd_use_lock_sync_helper(lockp, __BASE_FILE__, __LINE__)
23 #else /* SMP || CONFIG_SND_DEBUG */
25 typedef spinlock_t snd_use_lock_t
; /* dummy */
26 #define snd_use_lock_init(lockp) /**/
27 #define snd_use_lock_use(lockp) /**/
28 #define snd_use_lock_free(lockp) /**/
29 #define snd_use_lock_sync(lockp) /**/
31 #endif /* SMP || CONFIG_SND_DEBUG */
33 #endif /* __SND_SEQ_LOCK_H */