shithub: drawterm

Download patch

ref: 6703a4556c348ee8e60b28cebd656e80c79d45fe
parent: cdcc2bf6944fa9f0765a5c3c990eb6b0b12b605d
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Mon Feb 29 00:00:15 EST 2016

devaudio-win32: dont burn cpu when wave block is busy

--- a/kern/devaudio-win32.c
+++ b/kern/devaudio-win32.c
@@ -84,7 +84,7 @@
 	b = &blk[blkidx++ % nelem(blk)];
 	if(b->h.dwFlags & WHDR_PREPARED){
 		while(waveOutUnprepareHeader(waveout, &b->h, sizeof(b->h)) == WAVERR_STILLPLAYING)
-			osyield();
+			osmsleep(50);
 	}
 	memmove(b->s, v, n);
 	b->h.lpData = (void*)b->s;
--- a/kern/fns.h
+++ b/kern/fns.h
@@ -368,6 +368,7 @@
 void*		xspanalloc(ulong, int, ulong);
 void		xsummary(void);
 void		osyield(void);
+void		osmsleep(int);
 Segment*	data2txt(Segment*);
 Segment*	dupseg(Segment**, int, int);
 Segment*	newseg(int, ulong, ulong);