1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
parent e3dcb6204d
commit 42b6dc84d3

View file

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