diff options
author | ache <ache@FreeBSD.org> | 1995-02-03 10:19:38 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-02-03 10:19:38 +0000 |
commit | 2eeae6e888aa41690bf18fe7cb34dadbb5832ccc (patch) | |
tree | 645c7d9c16ca26adb5536b72cb9d4dbf86cf5323 | |
parent | 8bb9dc4a89bd5956706b5498bcf5eb47c44489e5 (diff) | |
download | FreeBSD-src-2eeae6e888aa41690bf18fe7cb34dadbb5832ccc.zip FreeBSD-src-2eeae6e888aa41690bf18fe7cb34dadbb5832ccc.tar.gz |
Fix hanging while playing very short notes.
-rw-r--r-- | sys/dev/speaker/spkr.c | 8 | ||||
-rw-r--r-- | sys/i386/isa/spkr.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/speaker/spkr.c b/sys/dev/speaker/spkr.c index aff7052..70e50a9 100644 --- a/sys/dev/speaker/spkr.c +++ b/sys/dev/speaker/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 <ache@astral.msk.su> * - * $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 ********************** 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 <ache@astral.msk.su> * - * $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 ********************** |