Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
ab9ccede
Commit
ab9ccede
authored
Jul 27, 2012
by
Dmitriy Vyukov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os: fix data race in epipecheck()
Fixes #3860. R=golang-dev, adg CC=golang-dev
https://golang.org/cl/6443051
parent
c49af2cc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
5 deletions
+4
-5
src/pkg/os/file_posix.go
src/pkg/os/file_posix.go
+3
-3
src/pkg/os/file_unix.go
src/pkg/os/file_unix.go
+1
-1
src/pkg/os/file_windows.go
src/pkg/os/file_windows.go
+0
-1
No files found.
src/pkg/os/file_posix.go
View file @
ab9ccede
...
...
@@ -7,6 +7,7 @@
package
os
import
(
"sync/atomic"
"syscall"
"time"
)
...
...
@@ -15,12 +16,11 @@ func sigpipe() // implemented in package runtime
func
epipecheck
(
file
*
File
,
e
error
)
{
if
e
==
syscall
.
EPIPE
{
file
.
nepipe
++
if
file
.
nepipe
>=
10
{
if
atomic
.
AddInt32
(
&
file
.
nepipe
,
1
)
>=
10
{
sigpipe
()
}
}
else
{
file
.
nepipe
=
0
atomic
.
StoreInt32
(
&
file
.
nepipe
,
0
)
}
}
...
...
src/pkg/os/file_unix.go
View file @
ab9ccede
...
...
@@ -24,7 +24,7 @@ type file struct {
fd
int
name
string
dirinfo
*
dirInfo
// nil unless directory being read
nepipe
int
// number of consecutive EPIPE in Write
nepipe
int
32
// number of consecutive EPIPE in Write
}
// Fd returns the integer Unix file descriptor referencing the open file.
...
...
src/pkg/os/file_windows.go
View file @
ab9ccede
...
...
@@ -25,7 +25,6 @@ type file struct {
fd
syscall
.
Handle
name
string
dirinfo
*
dirInfo
// nil unless directory being read
nepipe
int
// number of consecutive EPIPE in Write
l
sync
.
Mutex
// used to implement windows pread/pwrite
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment