aux/wacom: fix race in read queue

this fixes `no concurrent reads, please' errors when using
aux/wacom with aux/tablet on eg. x61t
This commit is contained in:
qwx 2021-12-14 23:54:05 +00:00
parent 7efbea82c6
commit af561602ea

View file

@ -303,11 +303,13 @@ tabletread(Req* req)
reply(req, m); reply(req, m);
msgdecref(m); msgdecref(m);
} else { } else {
lock(&readers);
if(r->req) { if(r->req) {
respond(req, "no concurrent reads, please"); respond(req, "no concurrent reads, please");
} else { } else {
r->req = req; r->req = req;
} }
unlock(&readers);
} }
} }