summaryrefslogtreecommitdiff
path: root/src/pkg/net/sendfile_windows.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/pkg/net/sendfile_windows.go')
-rw-r--r--src/pkg/net/sendfile_windows.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/net/sendfile_windows.go b/src/pkg/net/sendfile_windows.go
index f5a6d8804..2d64f2f5b 100644
--- a/src/pkg/net/sendfile_windows.go
+++ b/src/pkg/net/sendfile_windows.go
@@ -48,12 +48,12 @@ 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 {
return 0, err, true
}
defer c.decref()
+ c.wio.Lock()
+ defer c.wio.Unlock()
var o sendfileOp
o.Init(c, 'w')