[ALSA] schedule_timeout() fix for core/seq/seq_instr.c
authorRene Herman <rene.herman@gmail.com>
Tue, 18 Sep 2007 16:33:15 +0000 (18:33 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 16 Oct 2007 14:50:55 +0000 (16:50 +0200)
Replace schedule_timeout() with schedule_timeout_uninterruptible()
to avoid signals in loop.

Signed-off-by: Rene Herman <rene.herman@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/core/seq/seq_instr.c

index 5efe6523a589ee228456be47b63223e6febd0d00..08bed008fb7e28cc883d997f3a01dad77c82e2fc 100644 (file)
@@ -109,7 +109,7 @@ void snd_seq_instr_list_free(struct snd_seq_kinstr_list **list_ptr)
                        spin_lock_irqsave(&list->lock, flags);
                        while (instr->use) {
                                spin_unlock_irqrestore(&list->lock, flags);
-                               schedule_timeout(1);
+                               schedule_timeout_uninterruptible(1);
                                spin_lock_irqsave(&list->lock, flags);
                        }                               
                        spin_unlock_irqrestore(&list->lock, flags);
@@ -198,8 +198,10 @@ int snd_seq_instr_list_free_cond(struct snd_seq_kinstr_list *list,
                while (flist) {
                        instr = flist;
                        flist = instr->next;
-                       while (instr->use)
-                               schedule_timeout(1);
+                       while (instr->use) {
+                               schedule_timeout_uninterruptible(1);
+                               barrier();
+                       }
                        if (snd_seq_instr_free(instr, atomic)<0)
                                snd_printk(KERN_WARNING "instrument free problem\n");
                        instr = next;
@@ -555,7 +557,7 @@ static int instr_free(struct snd_seq_kinstr_ops *ops,
                                           SNDRV_SEQ_INSTR_NOTIFY_REMOVE);
                while (instr->use) {
                        spin_unlock_irqrestore(&list->lock, flags);
-                       schedule_timeout(1);
+                       schedule_timeout_uninterruptible(1);
                        spin_lock_irqsave(&list->lock, flags);
                }                               
                spin_unlock_irqrestore(&list->lock, flags);