shithub: riscv

Download patch

ref: 9cab16b4269a531fde38d797285ccde21cfe60fb
parent: d7c21149e4af020215f2dde0a9d99c134c5aa4f1
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)
--