Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
krynju committed Sep 8, 2021
1 parent dba8a08 commit df137dd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions stdlib/Distributed/src/Distributed.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,15 +84,15 @@ function _require_callback(mod::Base.PkgId)
end
end

const REF_ID = Ref(1)
next_ref_id() = (id = REF_ID[]; REF_ID[] = id+1; id)
const REF_ID = Threads.Atomic{Int}(1)
next_ref_id() = Threads.atomic_add!(REF_ID, 1)

struct RRID
whence::Int
id::Int

RRID() = RRID(myid(),next_ref_id())
RRID(whence, id) = new(whence,id)
RRID() = RRID(myid(), next_ref_id())
RRID(whence, id) = new(whence, id)
end

hash(r::RRID, h::UInt) = hash(r.whence, hash(r.id, h))
Expand Down

0 comments on commit df137dd

Please sign in to comment.