Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __SND_SEQ_LOCK_H
0003 #define __SND_SEQ_LOCK_H
0004 
0005 #include <linux/sched.h>
0006 
0007 typedef atomic_t snd_use_lock_t;
0008 
0009 /* initialize lock */
0010 #define snd_use_lock_init(lockp) atomic_set(lockp, 0)
0011 
0012 /* increment lock */
0013 #define snd_use_lock_use(lockp) atomic_inc(lockp)
0014 
0015 /* release lock */
0016 #define snd_use_lock_free(lockp) atomic_dec(lockp)
0017 
0018 /* wait until all locks are released */
0019 void snd_use_lock_sync_helper(snd_use_lock_t *lock, const char *file, int line);
0020 #define snd_use_lock_sync(lockp) snd_use_lock_sync_helper(lockp, __BASE_FILE__, __LINE__)
0021 
0022 #endif /* __SND_SEQ_LOCK_H */