summaryrefslogtreecommitdiff
path: root/libgo/go/exp/draw/x11/conn.go
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/exp/draw/x11/conn.go')
-rw-r--r--libgo/go/exp/draw/x11/conn.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/libgo/go/exp/draw/x11/conn.go b/libgo/go/exp/draw/x11/conn.go
index da2181536fb..e28fb217065 100644
--- a/libgo/go/exp/draw/x11/conn.go
+++ b/libgo/go/exp/draw/x11/conn.go
@@ -122,10 +122,13 @@ func (c *conn) writeSocket() {
func (c *conn) Screen() draw.Image { return c.img }
func (c *conn) FlushImage() {
- // We do the send (the <- operator) in an expression context, rather than in
- // a statement context, so that it does not block, and fails if the buffered
- // channel is full (in which case there already is a flush request pending).
- _ = c.flush <- false
+ select {
+ case c.flush <- false:
+ // Flush notification sent.
+ default:
+ // Could not send.
+ // Flush notification must be pending already.
+ }
}
func (c *conn) Close() os.Error {