ref: af0307960d035da73e651e0b5357c29ea081c1fa
parent: b68b2cd425a4ab62b6fb62d5906d2f1de5a8f1a6
author: aiju <aiju@phicode.de>
date: Sat Aug 25 18:33:51 EDT 2012
games/gb: set audioproc priority
--- a/sys/src/games/gb/audio.c
+++ b/sys/src/games/gb/audio.c
@@ -196,10 +196,25 @@
}
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)
--
⑨