9fans / plan9port

Plan 9 from User Space
https://9fans.github.io/plan9port/
Other
1.64k stars 326 forks source link

reorder X11 and clipboard locks #443

Closed ghost closed 4 years ago

ghost commented 4 years ago

It should fix https://github.com/9fans/plan9port/issues/434

rsc commented 4 years ago

It seems like instead of dropping and reclaiming the xlock, which may invalidate whatever invariants the xlock protects, we should swap the other lock orders in rpc_getsnarf and __xputsnarf, since those are just grabbing both locks at the same time and it is clearly safe as far as invariants to flip the order. And I think those (along with _xselect) are the only acquisitions of clip.lk that interact with xlock.