Skip to content

Commit

Permalink
Merge pull request #12465 from JuliaLang/amitm/rr_fetch
Browse files Browse the repository at this point in the history
added empty [] definition for remoteref
  • Loading branch information
amitmurthy committed Aug 6, 2015
2 parents b78659e + ea93736 commit cc83bde
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions base/multi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1653,6 +1653,7 @@ function terminate_all_workers()
end
end

getindex(r::RemoteRef) = fetch(r)
function getindex(r::RemoteRef, args...)
if r.where == myid()
return getindex(fetch(r), args...)
Expand Down
2 changes: 2 additions & 0 deletions test/parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ rr=RemoteRef()
a = rand(5,5)
put!(rr, a)
@test rr[2,3] == a[2,3]
@test rr[] == a

rr=RemoteRef(workers()[1])
a = rand(5,5)
put!(rr, a)
@test rr[1,5] == a[1,5]
@test rr[] == a

dims = (20,20,20)

Expand Down

0 comments on commit cc83bde

Please sign in to comment.