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

ruby-changes:31725

From: tarui <ko1@a...>
Date: Sat, 23 Nov 2013 03:23:08 +0900 (JST)
Subject: [ruby-changes:31725] tarui:r43804 (trunk): * test/ruby/test_settracefunc.rb (test_tracepoint_thread): bugfix.

tarui	2013-11-23 03:22:57 +0900 (Sat, 23 Nov 2013)

  New Revision: 43804

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43804

  Log:
    * test/ruby/test_settracefunc.rb (test_tracepoint_thread): bugfix.
      Take care about the thread switch between Thread.new and let to
      create_thread.
      TracePoint's block is sometimes run with create_thread == nil,
      so we have to perform Thread check later.

  Modified files:
    trunk/test/ruby/test_settracefunc.rb
Index: test/ruby/test_settracefunc.rb
===================================================================
--- test/ruby/test_settracefunc.rb	(revision 43803)
+++ test/ruby/test_settracefunc.rb	(revision 43804)
@@ -786,7 +786,6 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L786
     thread_self = nil
     created_thread = nil
     TracePoint.new(:thread_begin, :thread_end){|tp|
-      next if Thread.current != created_thread
       events << [Thread.current,
                  tp.event,
                  tp.lineno,  #=> 0
@@ -799,6 +798,7 @@ class TestSetTraceFunc < Test::Unit::Tes https://github.com/ruby/ruby/blob/trunk/test/ruby/test_settracefunc.rb#L798
       created_thread = Thread.new{thread_self = self}
       created_thread.join
     }
+    events.reject!{|i| i[0] != created_thread}
     assert_equal(self, thread_self)
     assert_equal([created_thread, :thread_begin, 0, nil, nil, nil, Thread], events[0])
     assert_equal([created_thread, :thread_end, 0, nil, nil, nil, Thread], events[1])

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

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