https://github.com/JuliaLang/julia
Raw File
Tip revision: 3cfbc6829b9ebf975f28e4d113ddc51269db585d authored by Kristoffer Carlsson on 08 February 2024, 13:14:49 UTC
use explicit `Base.` prefix for method overloading in conversion section in the manual
Tip revision: 3cfbc68
channel_threadpool.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test
using Base.Threads

@testset "Task threadpools" begin
    c = Channel{Symbol}() do c; put!(c, threadpool(current_task())); end
    @test take!(c) === threadpool(current_task())
    c = Channel{Symbol}(spawn = true) do c; put!(c, threadpool(current_task())); end
    @test take!(c) === :default
    c = Channel{Symbol}(threadpool = :interactive) do c; put!(c, threadpool(current_task())); end
    @test take!(c) === :interactive
    @test_throws ArgumentError Channel{Symbol}(threadpool = :foo) do c; put!(c, :foo); end
end
back to top