From 79b77658938b7b4e5d35d3cb655636fd127b7260 Mon Sep 17 00:00:00 2001 From: Tracy Wadleigh Date: Sat, 18 Apr 2015 07:44:37 -0400 Subject: [PATCH] Randomize segment name generated for `SharedArray`. Compensates for the lack of an analog of `shm_unlink` in Windows. Addresses #10773. --- base/sharedarray.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/sharedarray.jl b/base/sharedarray.jl index 73b179f4fab59..24669ba032581 100644 --- a/base/sharedarray.jl +++ b/base/sharedarray.jl @@ -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)