devdraw: use QLock to serialize sleep on refresh to prevent double sleep
parent
e992808e49
commit
5b07f6238b
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue