devdraw: use global drawlk instead of per-client

Setting up for a real window system.
This commit is contained in:
Russ Cox 2020-01-25 14:33:20 -05:00
parent 94d381ec9d
commit 587933c161
3 changed files with 20 additions and 18 deletions

View file

@ -56,6 +56,8 @@ struct ClientImpl
void (*rpc_flush)(Client*, Rectangle);
};
extern QLock drawlk;
struct Client
{
int rfd;
@ -69,10 +71,9 @@ struct Client
char* wsysid;
// drawlk protects the draw data structures.
// drawlk protects the draw data structures for all clients.
// It can be acquired by an RPC thread or a graphics thread
// but must not be held on one thread while waiting for the other.
QLock drawlk;
/*Ref r;*/
DImage* dimage[NHASH];
CScreen* cscreen;