Skip to content

Commit 3b6caaa

Browse files
committed
Change explanation to Jameson Nash (vtjnash)'s reasoning
1 parent 943473f commit 3b6caaa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/GIL/GIL.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@ module GIL
99

1010
using ..C: C
1111

12-
# Ensure that only one Julia thread tries to acquire the Python GIL
13-
# PyGILState_Ensure and PyGILState_Release may not be thread safe.
12+
# Ensure that only one Julia task tries to acquire the Python GIL.
13+
# Avoid the potential issue that a task could miscompute whether
14+
# it actually has the GIL simply because a different task that ran
15+
# on the same thread that once had the GIL.
1416
# https://github.com/JuliaPy/PythonCall.jl/issues/627
1517
const _jl_gil_lock = ReentrantLock()
1618

0 commit comments

Comments
 (0)