diff --git a/base/partr.jl b/base/partr.jl index c5bb6603d53af..a02272ceab202 100644 --- a/base/partr.jl +++ b/base/partr.jl @@ -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