File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -482,9 +482,10 @@ static jl_module_t *jl_new_module__(jl_sym_t *name, jl_module_t *parent)
482482 m -> parent = parent ? parent : m ;
483483 m -> istopmod = 0 ;
484484 m -> uuid = uuid_zero ;
485- static unsigned int mcounter ; // simple counter backup, in case hrtime is not incrementing
485+ static _Atomic (unsigned int ) mcounter ; // simple counter backup, in case hrtime is not incrementing
486+ unsigned int count = jl_atomic_fetch_add_relaxed (& mcounter , 1 );
486487 // TODO: this is used for ir decompression and is liable to hash collisions so use more of the bits
487- m -> build_id .lo = bitmix (jl_hrtime () + ( ++ mcounter ) , jl_rand ());
488+ m -> build_id .lo = bitmix (jl_hrtime () + count , jl_rand ());
488489 if (!m -> build_id .lo )
489490 m -> build_id .lo ++ ; // build id 0 is invalid
490491 m -> build_id .hi = ~(uint64_t )0 ;
You can’t perform that action at this time.
0 commit comments