0001
0002
0003
0004
0005
0006
0007 #include <linux/export.h>
0008 #include <sound/core.h>
0009 #include "seq_lock.h"
0010
0011
0012 void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line)
0013 {
0014 int warn_count = 5 * HZ;
0015
0016 if (atomic_read(lockp) < 0) {
0017 pr_warn("ALSA: seq_lock: lock trouble [counter = %d] in %s:%d\n", atomic_read(lockp), file, line);
0018 return;
0019 }
0020 while (atomic_read(lockp) > 0) {
0021 if (warn_count-- == 0)
0022 pr_warn("ALSA: seq_lock: waiting [%d left] in %s:%d\n", atomic_read(lockp), file, line);
0023 schedule_timeout_uninterruptible(1);
0024 }
0025 }
0026 EXPORT_SYMBOL(snd_use_lock_sync_helper);