summaryrefslogtreecommitdiff
path: root/src/pkg/net/sendfile_linux.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/net/sendfile_linux.go')
-rw-r--r--src/pkg/net/sendfile_linux.go6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/pkg/net/sendfile_linux.go b/src/pkg/net/sendfile_linux.go
index 6f1323b3d..5e117636a 100644
--- a/src/pkg/net/sendfile_linux.go
+++ b/src/pkg/net/sendfile_linux.go
@@ -36,12 +36,10 @@ func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) {
return 0, nil, false
}
- c.wio.Lock()
- defer c.wio.Unlock()
- if err := c.incref(false); err != nil {
+ if err := c.writeLock(); err != nil {
return 0, err, true
}
- defer c.decref()
+ defer c.writeUnlock()
dst := c.sysfd
src := int(f.Fd())