summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Harris <git@peter.is-a-geek.org>2010-12-28 20:10:38 -0500
committerPeter Harris <git@peter.is-a-geek.org>2010-12-28 20:30:07 -0500
commite76358414010b587db5d2e0a7e3775a2232edf89 (patch)
treeb70d2102aaadc3cd353a84c6ceb67acdc32b7e35
parent8a31a4fcff4840b3dbb3ecb74991df42eab50263 (diff)
Take write lock in Flush()
-rw-r--r--xgob.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/xgob.go b/xgob.go
index 8c8e4e5..3f06855 100644
--- a/xgob.go
+++ b/xgob.go
@@ -409,6 +409,9 @@ func (c *Connection) Flush () {
return
}
+ c.writeMutex.Lock()
+ defer c.writeMutex.Unlock()
+
c.out.Flush()
}