summaryrefslogtreecommitdiff
path: root/test/-ext-/gvl/test_last_thread.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/-ext-/gvl/test_last_thread.rb')
-rw-r--r--test/-ext-/gvl/test_last_thread.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/-ext-/gvl/test_last_thread.rb b/test/-ext-/gvl/test_last_thread.rb
new file mode 100644
index 00000000000..df25165b4b5
--- /dev/null
+++ b/test/-ext-/gvl/test_last_thread.rb
@@ -0,0 +1,22 @@
+class TestLastThread < Test::Unit::TestCase
+
+ # [Bug #11237]
+ def test_last_thread
+
+ assert_separately([], <<-"end;") #do
+ require '-test-/gvl/call_without_gvl'
+
+ Thread.new {
+ sleep 0.2
+ }
+
+ t0 = Time.now
+ Thread.current.__runnable_sleep__ 1
+ t1 = Time.now
+ t = t1 - t0
+
+ assert_operator(t, :>=, 1)
+ end;
+ end
+end
+