Skip to content

Commit

Permalink
fix multiq_check_empty to only look at the caller's pool (#49065)
Browse files Browse the repository at this point in the history
Co-authored-by: Jameson Nash <vtjnash@gmail.com>
(cherry picked from commit 1323d2f)
  • Loading branch information
JeffBezanson authored and KristofferC committed Mar 24, 2023
1 parent 59c2003 commit 8912c53
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions base/partr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,12 @@ function multiq_deletemin()
return task
end


function multiq_check_empty()
for j = UInt32(1):length(heaps)
for i = UInt32(1):length(heaps[j])
if heaps[j][i].ntasks != 0
return false
end
tid = Threads.threadid()
tp = ccall(:jl_threadpoolid, Int8, (Int16,), tid-1) + 1
for i = UInt32(1):length(heaps[tp])
if heaps[tp][i].ntasks != 0
return false
end
end
return true
Expand Down

0 comments on commit 8912c53

Please sign in to comment.