summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraiju <aiju@phicode.de>2012-08-25 22:33:51 +0200
committeraiju <aiju@phicode.de>2012-08-25 22:33:51 +0200
commit9cab16b4269a531fde38d797285ccde21cfe60fb (patch)
tree2105737bf5f1df2d4a1741dcbd3feb70d5a03f22
parentd7c21149e4af020215f2dde0a9d99c134c5aa4f1 (diff)
downloadplan9front-9cab16b4269a531fde38d797285ccde21cfe60fb.tar.xz
games/gb: set audioproc priority
-rw-r--r--sys/src/games/gb/audio.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/sys/src/games/gb/audio.c b/sys/src/games/gb/audio.c
index 898437446..0af1c0418 100644
--- a/sys/src/games/gb/audio.c
+++ b/sys/src/games/gb/audio.c
@@ -196,11 +196,26 @@ dosample(short *smp)
}
void
+setpri(int pri)
+{
+ char buf[64];
+ int fd;
+
+ snprint(buf, sizeof(buf), "/proc/%d/ctl", getpid());
+ if((fd = open(buf, OWRITE)) >= 0){
+ fprint(fd, "pri %d\n", pri);
+ close(fd);
+ }
+}
+
+void
audioproc(void *)
{
short samples[10 * 2];
int i;
+ setpri(13);
+
for(;;){
if(paused)
memset(samples, 0, sizeof samples);