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
3921d263
Commit
3921d263
authored
Jan 21, 2011
by
Anschel Schaffer-Cohen
Committed by
Adam Langley
Jan 21, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use defer to unlock mutex in crypto/rand.
R=agl1 CC=golang-dev
https://golang.org/cl/3991045
parent
49e2888a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
src/pkg/crypto/rand/rand_unix.go
src/pkg/crypto/rand/rand_unix.go
+1
-2
No files found.
src/pkg/crypto/rand/rand_unix.go
View file @
3921d263
...
...
@@ -29,15 +29,14 @@ type devReader struct {
func
(
r
*
devReader
)
Read
(
b
[]
byte
)
(
n
int
,
err
os
.
Error
)
{
r
.
mu
.
Lock
()
defer
r
.
mu
.
Unlock
()
if
r
.
f
==
nil
{
f
,
err
:=
os
.
Open
(
r
.
name
,
os
.
O_RDONLY
,
0
)
if
f
==
nil
{
r
.
mu
.
Unlock
()
return
0
,
err
}
r
.
f
=
f
}
r
.
mu
.
Unlock
()
return
r
.
f
.
Read
(
b
)
}
...
...
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