add some lines to delete unused TracePoint

`TracePoint.stat` returns the "to be deleted" TP numbers, and
http://rubyci.s3.amazonaws.com/graviton2/ruby-master/log/20210810T030003Z.fail.html.gz
shows there is a "to be deleted" TP.

This patch uses only :line event and add some lines to allow MRI
deletes "to be deleted" TPs.
This commit is contained in:
Koichi Sasada 2021-08-10 15:32:20 +09:00
Родитель e3dcb6204d
Коммит 42b6dc84d3
1 изменённых файлов: 6 добавлений и 2 удалений

Просмотреть файл

@ -982,20 +982,24 @@ class TestSetTraceFunc < Test::Unit::TestCase
def test_tracepoint_with_multithreads
assert_nothing_raised do
TracePoint.new{
TracePoint.new(:line){
10.times{
Thread.pass
}
}.enable do
(1..10).map{
Thread.new{
1000.times{
1_000.times{|i|
_a = i
}
}
}.each{|th|
th.join
}
end
_a = 1
_b = 2
_c = 3 # to make sure the deletion of unused TracePoints
end
end