Skip to content

Commit

Permalink
Randomize segment name generated for SharedArray.
Browse files Browse the repository at this point in the history
Compensates for the lack of an analog of `shm_unlink` in Windows.

Addresses JuliaLang#10773.
  • Loading branch information
twadleigh committed Apr 19, 2015
1 parent 8f69307 commit 3dbc6cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/sharedarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function SharedArray(T::Type, dims::NTuple; init=false, pids=Int[])
local shmmem_create_pid
try
# On OSX, the shm_seg_name length must be < 32 characters
shm_seg_name = string("/jl", getpid(), round(Int64,time() * 10^9))
shm_seg_name = @sprintf("/jl%06u%s", getpid() % 10^6, randstring(20))
if onlocalhost
shmmem_create_pid = myid()
s = shm_mmap_array(T, dims, shm_seg_name, JL_O_CREAT | JL_O_RDWR)
Expand Down

0 comments on commit 3dbc6cc

Please sign in to comment.