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
dms3
go-dms3
Commits
47701aaa
Commit
47701aaa
authored
Jan 14, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #566 from jbenet/races
race fixes
parents
4af5d85f
16690d4a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
9 deletions
+9
-9
importer/importer_test.go
importer/importer_test.go
+2
-2
merkledag/merkledag_test.go
merkledag/merkledag_test.go
+2
-2
pin/pin.go
pin/pin.go
+3
-3
pin/pin_test.go
pin/pin_test.go
+2
-2
No files found.
importer/importer_test.go
View file @
47701aaa
...
...
@@ -137,8 +137,8 @@ type dagservAndPinner struct {
}
func
getDagservAndPinner
(
t
*
testing
.
T
)
dagservAndPinner
{
db
:=
ds
.
NewMapDatastore
()
bs
:=
bstore
.
NewBlockstore
(
dssync
.
MutexWrap
(
db
)
)
db
:=
dssync
.
MutexWrap
(
ds
.
NewMapDatastore
()
)
bs
:=
bstore
.
NewBlockstore
(
db
)
blockserv
,
err
:=
bserv
.
New
(
bs
,
offline
.
Exchange
(
bs
))
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
merkledag/merkledag_test.go
View file @
47701aaa
...
...
@@ -28,8 +28,8 @@ type dagservAndPinner struct {
}
func
getDagservAndPinner
(
t
*
testing
.
T
)
dagservAndPinner
{
db
:=
ds
.
NewMapDatastore
()
bs
:=
bstore
.
NewBlockstore
(
dssync
.
MutexWrap
(
db
)
)
db
:=
dssync
.
MutexWrap
(
ds
.
NewMapDatastore
()
)
bs
:=
bstore
.
NewBlockstore
(
db
)
blockserv
,
err
:=
bserv
.
New
(
bs
,
offline
.
Exchange
(
bs
))
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
pin/pin.go
View file @
47701aaa
...
...
@@ -53,11 +53,11 @@ type pinner struct {
directPin
set
.
BlockSet
indirPin
*
indirectPin
dserv
mdag
.
DAGService
dstore
ds
.
Datastore
dstore
ds
.
ThreadSafe
Datastore
}
// NewPinner creates a new pinner using the given datastore as a backend
func
NewPinner
(
dstore
ds
.
Datastore
,
serv
mdag
.
DAGService
)
Pinner
{
func
NewPinner
(
dstore
ds
.
ThreadSafe
Datastore
,
serv
mdag
.
DAGService
)
Pinner
{
// Load set from given datastore...
rcds
:=
nsds
.
Wrap
(
dstore
,
recursePinDatastoreKey
)
...
...
@@ -176,7 +176,7 @@ func (p *pinner) IsPinned(key util.Key) bool {
}
// LoadPinner loads a pinner and its keysets from the given datastore
func
LoadPinner
(
d
ds
.
Datastore
,
dserv
mdag
.
DAGService
)
(
Pinner
,
error
)
{
func
LoadPinner
(
d
ds
.
ThreadSafe
Datastore
,
dserv
mdag
.
DAGService
)
(
Pinner
,
error
)
{
p
:=
new
(
pinner
)
{
// load recursive set
...
...
pin/pin_test.go
View file @
47701aaa
...
...
@@ -21,8 +21,8 @@ func randNode() (*mdag.Node, util.Key) {
}
func
TestPinnerBasic
(
t
*
testing
.
T
)
{
dstore
:=
ds
.
NewMapDatastore
()
bstore
:=
blockstore
.
NewBlockstore
(
dssync
.
MutexWrap
(
dstore
)
)
dstore
:=
dssync
.
MutexWrap
(
ds
.
NewMapDatastore
()
)
bstore
:=
blockstore
.
NewBlockstore
(
dstore
)
bserv
,
err
:=
bs
.
New
(
bstore
,
offline
.
Exchange
(
bstore
))
if
err
!=
nil
{
t
.
Fatal
(
err
)
...
...
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