1
1
using Test
2
- using DistributedNext, Base . Threads
2
+ using DistributedNext
3
3
using Base. Iterators: product
4
4
5
5
exeflags = (" --startup-file=no" ,
@@ -12,7 +12,7 @@ function call_on(f, wid, tid)
12
12
t = Task (f)
13
13
ccall (:jl_set_task_tid , Cvoid, (Any, Cint), t, tid - 1 )
14
14
schedule (t)
15
- @assert threadid (t) == tid
15
+ @assert Threads . threadid (t) == tid
16
16
t
17
17
end
18
18
end
@@ -27,12 +27,12 @@ isfailed(rr) = fetch_from_owner(istaskfailed, rr)
27
27
28
28
@testset " RemoteChannel allows put!/take! from thread other than 1" begin
29
29
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
+
30
34
@testset " from worker $w1 to $w2 via 1" for (w1, w2) in ws
31
35
@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
-
36
36
p1 = procs_added[w1]
37
37
p2 = procs_added[w2]
38
38
chan_id = first (procs_added)
@@ -57,8 +57,8 @@ isfailed(rr) = fetch_from_owner(istaskfailed, rr)
57
57
58
58
@test ! isfailed (send)
59
59
@test ! isfailed (recv)
60
-
61
- rmprocs (procs_added)
62
60
end
63
61
end
62
+
63
+ rmprocs (procs_added)
64
64
end
0 commit comments