Skip to content

Commit bc2431d

Browse files
author
Mark Kittisopikul
committed
JULIA_COPY_STACKS should not be recommended or asserted on Windows
1 parent 59973a3 commit bc2431d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/JavaCall.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function __init__()
3636
"Either use Julia v1.0.x, or v1.3.0 or higher.\n"*
3737
"For 1.3 onwards, please also set the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`")
3838
end
39-
if VERSION v"1.3-" && ! JULIA_COPY_STACKS
39+
if VERSION v"1.3-" && ! Sys.iswindows() && ! JULIA_COPY_STACKS
4040
@warn("JavaCall needs the environment variable `JULIA_COPY_STACKS` to be `1` or `yes`.\n"*
4141
"Calling the JVM may result in undefined behavior.")
4242
end

src/jvm.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,11 @@ const ROOT_TASK_ERROR = JavaCallError(
168168

169169
# JavaCall must run on the root Task or JULIA_COPY_STACKS is enabled
170170
isroottask() = JULIA_COPY_STACKS || Base.roottask === Base.current_task()
171-
assertroottask() = isroottask() ? nothing : throw(ROOT_TASK_ERROR)
171+
@static if Sys.iswindows()
172+
assertroottask() = nothing
173+
else
174+
assertroottask() = isroottask() ? nothing : throw(ROOT_TASK_ERROR)
175+
end
172176

173177
isloaded() = isdefined(JavaCall, :jnifunc) && isdefined(JavaCall, :penv) && penv != C_NULL
174178

0 commit comments

Comments
 (0)