Revision 015874c61815a72531c66709867630c9fa2b1526 authored by Sosuke on 12 October 2022, 10:04:19 UTC, committed by GitHub on 12 October 2022, 10:04:19 UTC
1 parent a7d446b
Raw File
threadpool_use.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test
using Base.Threads

@test nthreadpools() == 2
@test threadpool() === :default
@test threadpool(2) === :interactive
dtask() = @test threadpool(current_task()) === :default
itask() = @test threadpool(current_task()) === :interactive
dt1 = @spawn dtask()
dt2 = @spawn :default dtask()
it = @spawn :interactive itask()
wait(dt1)
wait(dt2)
wait(it)
back to top