devdraw: use QLock to serialize sleep on refresh to prevent double sleep
parent
e992808e49
commit
5b07f6238b
|
@ -73,6 +73,7 @@ struct Client
|
||||||
CScreen* cscreen;
|
CScreen* cscreen;
|
||||||
Refresh* refresh;
|
Refresh* refresh;
|
||||||
Rendez refrend;
|
Rendez refrend;
|
||||||
|
QLock refq;
|
||||||
uchar* readdata;
|
uchar* readdata;
|
||||||
int nreaddata;
|
int nreaddata;
|
||||||
int busy;
|
int busy;
|
||||||
|
@ -1227,11 +1228,18 @@ drawread(Chan *c, void *a, long n, vlong off)
|
||||||
break;
|
break;
|
||||||
dunlock();
|
dunlock();
|
||||||
if(waserror()){
|
if(waserror()){
|
||||||
dlock(); /* restore lock for waserror() above */
|
dlock();
|
||||||
|
nexterror();
|
||||||
|
}
|
||||||
|
eqlock(&cl->refq);
|
||||||
|
if(waserror()){
|
||||||
|
qunlock(&cl->refq);
|
||||||
nexterror();
|
nexterror();
|
||||||
}
|
}
|
||||||
sleep(&cl->refrend, drawrefactive, cl);
|
sleep(&cl->refrend, drawrefactive, cl);
|
||||||
poperror();
|
poperror();
|
||||||
|
qunlock(&cl->refq);
|
||||||
|
poperror();
|
||||||
dlock();
|
dlock();
|
||||||
}
|
}
|
||||||
p = a;
|
p = a;
|
||||||
|
|
Loading…
Reference in New Issue