devdraw: use QLock to serialize sleep on refresh to prevent double sleep

front
cinap_lenrek 2012-02-20 10:49:14 +01:00
parent e992808e49
commit 5b07f6238b
1 changed files with 9 additions and 1 deletions

View File

@ -73,6 +73,7 @@ struct Client
CScreen* cscreen;
Refresh* refresh;
Rendez refrend;
QLock refq;
uchar* readdata;
int nreaddata;
int busy;
@ -1227,11 +1228,18 @@ drawread(Chan *c, void *a, long n, vlong off)
break;
dunlock();
if(waserror()){
dlock(); /* restore lock for waserror() above */
dlock();
nexterror();
}
eqlock(&cl->refq);
if(waserror()){
qunlock(&cl->refq);
nexterror();
}
sleep(&cl->refrend, drawrefactive, cl);
poperror();
qunlock(&cl->refq);
poperror();
dlock();
}
p = a;