11using Test
2- using Distributed, Base . Threads
2+ using Distributed
33using Base. Iterators: product
44
55exeflags = (" --startup-file=no" ,
@@ -12,7 +12,7 @@ function call_on(f, wid, tid)
1212 t = Task (f)
1313 ccall (:jl_set_task_tid , Cvoid, (Any, Cint), t, tid - 1 )
1414 schedule (t)
15- @assert threadid (t) == tid
15+ @assert Threads . threadid (t) == tid
1616 t
1717 end
1818end
@@ -27,12 +27,12 @@ isfailed(rr) = fetch_from_owner(istaskfailed, rr)
2727
2828@testset " RemoteChannel allows put!/take! from thread other than 1" begin
2929 ws = ts = product (1 : 2 , 1 : 2 )
30+
31+ # We want (the default) laziness, so that we wait for `Worker.c_state`!
32+ procs_added = addprocs (2 ; exeflags, lazy= true )
33+
3034 @testset " from worker $w1 to $w2 via 1" for (w1, w2) in ws
3135 @testset " from thread $w1 .$t1 to $w2 .$t2 " for (t1, t2) in ts
32- # We want (the default) laziness, so that we wait for `Worker.c_state`!
33- procs_added = addprocs (2 ; exeflags, lazy= true )
34- @everywhere procs_added using Base. Threads
35-
3636 p1 = procs_added[w1]
3737 p2 = procs_added[w2]
3838 chan_id = first (procs_added)
@@ -57,8 +57,8 @@ isfailed(rr) = fetch_from_owner(istaskfailed, rr)
5757
5858 @test ! isfailed (send)
5959 @test ! isfailed (recv)
60-
61- rmprocs (procs_added)
6260 end
6361 end
62+
63+ rmprocs (procs_added)
6464end
0 commit comments