summaryrefslogtreecommitdiffstats
path: root/bootstraptest
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-15 15:10:49 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-15 15:10:49 +0000
commit7af79074d6c961fd3ec4ab3c9c643f149d15c1f1 (patch)
tree6a466ccdf4cef83298c1be1dc6d29240a72cb4d8 /bootstraptest
parent4c757a94b238100a0a08412c3068750e88541756 (diff)
downloadruby-7af79074d6c961fd3ec4ab3c9c643f149d15c1f1.tar.gz
ruby-7af79074d6c961fd3ec4ab3c9c643f149d15c1f1.tar.xz
ruby-7af79074d6c961fd3ec4ab3c9c643f149d15c1f1.zip
* thread.c (thread_cleanup_func): delete locking_mutex when thread
object become dummy because of fork. [ruby-core:26744] [ruby-core:26745] * bootstraptest/test_thread.rb: add a test for above. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bootstraptest')
-rw-r--r--bootstraptest/test_thread.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 0e7d03d43..4b715a154 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -385,3 +385,26 @@ assert_equal 'ok', %q{
end
:ok
}
+
+assert_equal 'ok', %{
+ open("zzz.rb", "w") do |f|
+ f.puts <<-END
+ begin
+ m = Mutex.new
+ Thread.new { m.lock; sleep 1 }
+ sleep 0.3
+ Thread.new do
+ sleep 0.3
+ fork { GC.start }
+ end
+ m.lock
+ pid, status = Process.wait2
+ $result = status.success? ? :ok : :ng
+ rescue NotImplementedError
+ $result = :ok
+ end
+ END
+ end
+ require "./zzz.rb"
+ $result
+}