Skip to content

Commit 1660579

Browse files
author
Christopher Doris
committed
use :static scheduler for GIL tests
possible fix for CI crashes seen in these tests
1 parent d95ab4f commit 1660579

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/GIL.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# GIL, these can happen in parallel if Julia has at least 2 threads.
44
function threaded_sleep()
55
PythonCall.GIL.unlock() do
6-
Threads.@threads for i = 1:2
6+
Threads.@threads :static for i = 1:2
77
PythonCall.GIL.lock() do
88
pyimport("time").sleep(1)
99
end
@@ -24,7 +24,7 @@ end
2424
# This calls Python's time.sleep(1) twice concurrently. Since sleep() unlocks the
2525
# GIL, these can happen in parallel if Julia has at least 2 threads.
2626
function threaded_sleep()
27-
PythonCall.GIL.@unlock Threads.@threads for i = 1:2
27+
PythonCall.GIL.@unlock Threads.@threads :static for i = 1:2
2828
PythonCall.GIL.@lock pyimport("time").sleep(1)
2929
end
3030
end

0 commit comments

Comments
 (0)