Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-msgio
Commits
373c219f
Commit
373c219f
authored
Dec 11, 2017
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
also avoid locking while closing the varint reader/writers
parent
47494676
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
6 deletions
+0
-6
varint.go
varint.go
+0
-6
No files found.
varint.go
View file @
373c219f
...
@@ -49,9 +49,6 @@ func (s *varintWriter) WriteMsg(msg []byte) error {
...
@@ -49,9 +49,6 @@ func (s *varintWriter) WriteMsg(msg []byte) error {
}
}
func
(
s
*
varintWriter
)
Close
()
error
{
func
(
s
*
varintWriter
)
Close
()
error
{
s
.
lock
.
Lock
()
defer
s
.
lock
.
Unlock
()
if
c
,
ok
:=
s
.
W
.
(
io
.
Closer
);
ok
{
if
c
,
ok
:=
s
.
W
.
(
io
.
Closer
);
ok
{
return
c
.
Close
()
return
c
.
Close
()
}
}
...
@@ -162,9 +159,6 @@ func (s *varintReader) ReleaseMsg(msg []byte) {
...
@@ -162,9 +159,6 @@ func (s *varintReader) ReleaseMsg(msg []byte) {
}
}
func
(
s
*
varintReader
)
Close
()
error
{
func
(
s
*
varintReader
)
Close
()
error
{
s
.
lock
.
Lock
()
defer
s
.
lock
.
Unlock
()
if
c
,
ok
:=
s
.
R
.
(
io
.
Closer
);
ok
{
if
c
,
ok
:=
s
.
R
.
(
io
.
Closer
);
ok
{
return
c
.
Close
()
return
c
.
Close
()
}
}
...
...
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