swh:1:snp:a72e953ecd624a7df6e6196bbdd05851996c5e40
Raw File
Tip revision: a04936e3e040fbe5fe0c3fa64ef1ffffd0a2f8f8 authored by Alex Arslan on 12 September 2019, 19:49:35 UTC
Set VERSION to 1.3.0-rc2 (#33200)
Tip revision: a04936e
threads.jl
# This file is a part of Julia. License is MIT: https://julialang.org/license

using Test, Base.Threads

let p, cmd = `$(Base.julia_cmd()) --depwarn=error --startup-file=no threads_exec.jl`
    # test both nthreads==1 and nthreads>1. spawn a process to test whichever
    # case we are not running currently.
    other_nthreads = nthreads() == 1 ? 4 : 1
    p = run(pipeline(setenv(cmd, "JULIA_NUM_THREADS" => other_nthreads), stdout = stdout, stderr = stderr),
            wait = false)
    include("threads_exec.jl")
    if !success(p)
        error("threads test failed with nthreads == $other_nthreads")
    end
end
back to top