From 2eeae6e888aa41690bf18fe7cb34dadbb5832ccc Mon Sep 17 00:00:00 2001 From: ache Date: Fri, 3 Feb 1995 10:19:38 +0000 Subject: Fix hanging while playing very short notes. --- sys/i386/isa/spkr.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/i386/isa/spkr.c') diff --git a/sys/i386/isa/spkr.c b/sys/i386/isa/spkr.c index aff7052..70e50a9 100644 --- a/sys/i386/isa/spkr.c +++ b/sys/i386/isa/spkr.c @@ -4,7 +4,7 @@ * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 * modified for FreeBSD by Andrew A. Chernov * - * $Id: spkr.c,v 1.9 1994/08/13 03:50:14 wollman Exp $ + * $Id: spkr.c,v 1.10 1994/10/14 16:37:58 ache Exp $ */ #include "speaker.h" @@ -90,7 +90,8 @@ unsigned int thz, ticks; * This is so other processes can execute while the tone is being * emitted. */ - (void) tsleep((caddr_t)&endtone, SPKRPRI | PCATCH, "spkrtn", ticks); + if (ticks > 0) + tsleep((caddr_t)&endtone, SPKRPRI | PCATCH, "spkrtn", ticks); outb(IO_PPI, inb(IO_PPI) & ~PPI_SPKR); release_timer2(); } @@ -107,7 +108,8 @@ int ticks; #ifdef DEBUG (void) printf("rest: %d\n", ticks); #endif /* DEBUG */ - (void) tsleep((caddr_t)&endrest, SPKRPRI | PCATCH, "spkrrs", ticks); + if (ticks > 0) + tsleep((caddr_t)&endrest, SPKRPRI | PCATCH, "spkrrs", ticks); } /**************** PLAY STRING INTERPRETER BEGINS HERE ********************** -- cgit v1.1