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-yamux
Commits
4e665e89
Unverified
Commit
4e665e89
authored
Feb 17, 2021
by
Marten Seemann
Committed by
GitHub
Feb 17, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #41 from libp2p/remove-send-lock
remove the sendLock in the stream
parents
fc8d53ba
f2c2ce6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
stream.go
stream.go
+2
-7
No files found.
stream.go
View file @
4e665e89
...
...
@@ -40,8 +40,6 @@ type Stream struct {
recvLock
sync
.
Mutex
recvBuf
segmentedBuffer
sendLock
sync
.
Mutex
recvNotifyCh
chan
struct
{}
sendNotifyCh
chan
struct
{}
...
...
@@ -120,11 +118,8 @@ START:
}
// Write is used to write to the stream
func
(
s
*
Stream
)
Write
(
b
[]
byte
)
(
n
int
,
err
error
)
{
s
.
sendLock
.
Lock
()
defer
s
.
sendLock
.
Unlock
()
total
:=
0
func
(
s
*
Stream
)
Write
(
b
[]
byte
)
(
int
,
error
)
{
var
total
int
for
total
<
len
(
b
)
{
n
,
err
:=
s
.
write
(
b
[
total
:
])
total
+=
n
...
...
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