You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GC.gc(false) # stress test the GC-safepoint mechanics of jl_delete_thread
415
435
nothing
416
436
end
@@ -431,19 +451,35 @@ let e = Base.Event(true),
431
451
err ==0|| Base.uv_error("uv_thread_join", err)
432
452
end
433
453
end
434
-
# let them finish in 5 batches of 10
435
-
for i =1:length(tids) ÷10
436
-
for i =1:10
437
-
@testtake!(started) !=threadid()
454
+
try
455
+
# let them finish in batches of 10
456
+
for i =1:length(tids) ÷10
457
+
for i =1:10
458
+
newid =take!(started)
459
+
@test newid !=threadid()
460
+
end
461
+
for i =1:10
462
+
push!(finish, nothing)
463
+
end
438
464
end
439
-
for i =1:10
440
-
notify(e)
465
+
@testisempty(started)
466
+
# now run the second part of the test where they all try to access the other threads elements
467
+
notify(starttest2)
468
+
finally
469
+
for _ =1:length(tids)
470
+
# run IO loop until all threads are close to exiting
471
+
take!(exiting)
441
472
end
473
+
waitallthreads(tids)
442
474
end
443
475
@testisempty(started)
444
-
waitallthreads(tids)
445
-
@testisempty(started)
476
+
@testisempty(finish)
446
477
@testlength(IdSet{eltype(onces)}(onces)) ==length(onces) # make sure every object is unique
478
+
allexpected = Vector{Nothing}[alls[tid] for tid in newthreads]
479
+
@testlength(IdSet{eltype(allexpected)}(allexpected)) ==length(allexpected) # make sure every object is unique
480
+
@testall(i -> allonces[i] !== allexpected &&all(j -> allonces[i][j] === allexpected[j], eachindex(allexpected)), eachindex(allonces)) # make sure every thread saw the same elements
0 commit comments