[前][次][番号順一覧][スレッド一覧]

ruby-changes:48049

From: ko1 <ko1@a...>
Date: Wed, 11 Oct 2017 16:49:09 +0900 (JST)
Subject: [ruby-changes:48049] ko1:r60163 (trunk): check a thread on TracePoint.

ko1	2017-10-11 16:49:03 +0900 (Wed, 11 Oct 2017)

  New Revision: 60163

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60163

  Log:
    check a thread on TracePoint.
    
    * test/ruby/test_settracefunc.rb: skip if TracePoint probes are invoked by
      non-main thread.

  Modified files:
    trunk/test/ruby/test_settracefunc.rb
Index: test/ruby/test_settracefunc.rb
===================================================================
--- test/ruby/test_settracefunc.rb	(revision 60162)
+++ test/ruby/test_settracefunc.rb	(revision 60163)
@@ -925,6 +925,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L925
     bug7774 = '[ruby-dev:46908]'
     src = %q{
       tp = TracePoint.new(:raise) do |tp|
+        next unless target_thread?g
         tp.binding
       end
       tp.enable do
@@ -1492,6 +1493,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L1493
   def test_tracepoint_callee_id
     events = []
     capture_events = Proc.new{|tp|
+      next unless target_thread?
       events << [tp.event, tp.method_id, tp.callee_id]
     }
 
@@ -1748,6 +1750,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L1750
       define_method(:m) {}
 
       tp = TracePoint.new(:call) do
+        next unless target_thread?
         raise ''
       end
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]