Skip to content

Commit 45ccf87

Browse files
authored
make at-sync thread safe (JuliaLang/julia#35641)
fixes JuliaLang/julia#34666
1 parent db339ce commit 45ccf87

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/macros.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ macro spawn(expr)
4949
quote
5050
local ref = spawn_somewhere($thunk)
5151
if $(Expr(:islocal, var))
52-
push!($var, ref)
52+
put!($var, ref)
5353
end
5454
ref
5555
end
@@ -94,7 +94,7 @@ macro spawnat(p, expr)
9494
quote
9595
local ref = $spawncall
9696
if $(Expr(:islocal, var))
97-
push!($var, ref)
97+
put!($var, ref)
9898
end
9999
ref
100100
end
@@ -346,7 +346,7 @@ macro distributed(args...)
346346
return quote
347347
local ref = pfor($(make_pfor_body(var, body)), $(esc(r)))
348348
if $(Expr(:islocal, syncvar))
349-
push!($syncvar, ref)
349+
put!($syncvar, ref)
350350
end
351351
ref
352352
end

0 commit comments

Comments
 (0)