History

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

cinap_lenrek committed 10 years ago

Commit 6703a451 parent cdcc2bf2 files · +2 −1Browse files

Unified · Split

2 files
  1. kern/devaudio-win32.c +1 −1
  2. kern/fns.h +1 −0
kern/devaudio-win32.c+1−1
@@ -84,7 +84,7 @@ audiodevwrite(void *v, int n) · 83 unmodified lines
8484 b = &blk[blkidx++ % nelem(blk)];
8585 if(b->h.dwFlags & WHDR_PREPARED){
8686 while(waveOutUnprepareHeader(waveout, &b->h, sizeof(b->h)) == WAVERR_STILLPLAYING)
87− osyield();
87+ osmsleep(50);
8888 }
8989 memmove(b->s, v, n);
9090 b->h.lpData = (void*)b->s;
kern/fns.h+1−0
@@ -368,6 +368,7 @@ int xmerge(void*, void*); · 367 unmodified lines
368368 void* xspanalloc(ulong, int, ulong);
369369 void xsummary(void);
370370 void osyield(void);
371+void osmsleep(int);
371372 Segment* data2txt(Segment*);
372373 Segment* dupseg(Segment**, int, int);
373374 Segment* newseg(int, ulong, ulong);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t