File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change 1
1
using Test, StableTasks
2
2
using StableTasks: @spawn , @spawnat , @fetch , @fetchfrom
3
3
4
- if isdefinded (Threads, :maxthreadid )
5
- maxthreadid () = Threads. maxthreadid ()
6
- else
7
- maxthreadid () = Threads. nthreads ()
8
- end
9
-
10
4
@testset " Type stability" begin
5
+ t = @eval Threads. @spawn inv ([1 2 ; 3 4 ])
6
+ fetch (t)
7
+
11
8
@test 2 == @inferred fetch (@spawn 1 + 1 )
12
9
t = @eval @spawn inv ([1 2 ; 3 4 ])
13
10
@test inv ([1 2 ; 3 4 ]) == @inferred fetch (t)
22
19
@test inv ([1 2 ; 3 4 ]) == @inferred fetch (t)
23
20
24
21
@test 2 == @inferred fetch (@spawnat 1 1 + 1 )
25
- t = @eval @spawnat maxthreadid () inv ([ 1 2 ; 3 4 ])
26
- @test inv ([ 1 2 ; 3 4 ]) == @inferred fetch (t)
22
+ t = @eval @spawnat 1 1 + 1
23
+ @test 2 == @inferred fetch (t)
27
24
end
28
25
29
26
@testset " API funcs" begin
You can’t perform that action at this time.
0 commit comments