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:
parent
e3dcb6204d
commit
42b6dc84d3
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue