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

ruby-changes:72671

From: Nobuyoshi <ko1@a...>
Date: Mon, 25 Jul 2022 18:50:59 +0900 (JST)
Subject: [ruby-changes:72671] f61dd38e5c (master): Wait the test thread to sleep

https://git.ruby-lang.org/ruby.git/commit/?id=f61dd38e5c

From f61dd38e5c85abc8c403851b1cbc3d3b04b67dbb Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Mon, 25 Jul 2022 18:43:27 +0900
Subject: Wait the test thread to sleep

Revert "Synchronize the test thread sleep"

This reverts commit 307835fe314fea6e946a8c9b25bb3912680ed7d1.
---
 test/ruby/test_thread.rb | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index afcf1fb463..881c4d102d 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -30,23 +30,17 @@ class TestThread < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_thread.rb#L30
 
   def test_inspect
     m = Thread::Mutex.new
-    cv1 = Thread::ConditionVariable.new
-    cv2 = Thread::ConditionVariable.new
     m.lock
     line = __LINE__+1
     th = Module.new {break module_eval("class C\u{30b9 30ec 30c3 30c9} < Thread; self; end")}.start do
-      m.synchronize do
-        cv2.signal
-        cv1.wait(m)
-      end
+      m.synchronize {}
     end
-    cv2.wait(m)
+    Thread.pass until th.stop?
     s = th.inspect
     assert_include(s, "::C\u{30b9 30ec 30c3 30c9}:")
     assert_include(s, " #{__FILE__}:#{line} ")
     assert_equal(s, th.to_s)
   ensure
-    cv1.signal
     m.unlock
     th.join
   end
-- 
cgit v1.2.1


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

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