BurntSushi/xgb — pull request #26 by bmatsuo (2014-12-05 02:32:42+00:00)
Title: fix race condition in xgb.go

The xgb package has a data race exercised by the xproto tests and several example programs. The cookie sequence id is set concurrently with it being checked in an xproto Check call.

To resolve the race I've made the Conn.NewRequest method block until the request has been assigned a sequence id. I did that by adding a channel to the struct that is closed after a sequence id is assigned. It's a little bit of a hack but it seemed like the cleanest thing to do, due to the type being unexpected.

What do you think @BurntSushi?