Skip to content

Commit

Permalink
Remove broken errormonitor implementation, just don't use it on 1.6. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored Feb 17, 2022
1 parent c38ae98 commit 0d0c316
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/pool.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,6 @@ function stream_ordered(dev::CuDevice)
end::Bool
end

if VERSION < v"1.7-"
function errormonitor(task)
Base.Threads.@spawn try
wait(task)
catch err
bt = catch_backtrace()
showerror(stderr, err, bt)
rethrow()
end
end
end

# per-device flag indicating the status of a pool
const _pool_status = PerDevice{Base.RefValue{Union{Nothing,Bool}}}()
pool_status(dev::CuDevice) = get!(_pool_status, dev) do
Expand All @@ -101,7 +89,11 @@ function pool_mark(dev::CuDevice)

# launch a task to periodically trim the pool
if isinteractive() && !isassigned(__pool_cleanup)
__pool_cleanup[] = errormonitor(Threads.@spawn pool_cleanup())
__pool_cleanup[] = if VERSION < v"1.7"
Threads.@spawn pool_cleanup()
else
errormonitor(Threads.@spawn pool_cleanup())
end
end
end
status[] = true
Expand Down

0 comments on commit 0d0c316

Please sign in to comment.