Skip to content

Commit db1f07f

Browse files
authored
make spawn faster by fixing the sync context check (JuliaLang/julia#33885)
1 parent a698f66 commit db1f07f

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
@@ -48,7 +48,7 @@ macro spawn(expr)
4848
var = esc(Base.sync_varname)
4949
quote
5050
local ref = spawn_somewhere($thunk)
51-
if $(Expr(:isdefined, var))
51+
if $(Expr(:islocal, var))
5252
push!($var, ref)
5353
end
5454
ref
@@ -93,7 +93,7 @@ macro spawnat(p, expr)
9393
end
9494
quote
9595
local ref = $spawncall
96-
if $(Expr(:isdefined, var))
96+
if $(Expr(:islocal, var))
9797
push!($var, ref)
9898
end
9999
ref
@@ -346,7 +346,7 @@ macro distributed(args...)
346346
syncvar = esc(Base.sync_varname)
347347
return quote
348348
local ref = pfor($(make_pfor_body(var, body)), $(esc(r)))
349-
if $(Expr(:isdefined, syncvar))
349+
if $(Expr(:islocal, syncvar))
350350
push!($syncvar, ref)
351351
end
352352
ref

0 commit comments

Comments
 (0)