File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,13 @@ function Base.pop!(task_stack::TaskStack)::Task
6262
6363 C. PyGILState_Release (gil_state)
6464
65- # Restore sticky state after releasing the GIL
66- task. sticky = sticky
67-
6865 Base. lock (task_stack. condvar) do
6966 notify (task_stack. condvar)
7067 end
7168
69+ # Restore sticky state after releasing the GIL
70+ task. sticky = sticky
71+
7272 return task
7373end
7474Base. in (task:: Task , task_stack:: TaskStack ) = haskey (task_stack. count)
@@ -146,7 +146,9 @@ function Base.unlock(gil::GlobalInterpreterLock)
146146 else
147147 # This task does not own the GIL. Wait to unlock the GIL until
148148 # another task successfully unlocks the GIL.
149- wait (lock_owner. condvar)
149+ Base. lock (lock_owner. condvar) do
150+ wait (lock_owner. condvar)
151+ end
150152 end
151153 last_owner = if isempty (lock_owner)
152154 current_task ()
You can’t perform that action at this time.
0 commit comments