about summary refs log tree commit homepage
path: root/test/test_poll.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_poll.rb')
-rw-r--r--test/test_poll.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/test_poll.rb b/test/test_poll.rb
index 3aa8c1f..13f5f2a 100644
--- a/test/test_poll.rb
+++ b/test/test_poll.rb
@@ -89,11 +89,13 @@ class TestPoll < Test::Unit::TestCase
 
   def test_poll_EINTR_changed
     ok = false
-    orig = trap(:USR1) { ok = true }
     pollset = { @rd => Kgio::POLLIN }
+    orig = trap(:USR1) do
+      pollset[@wr] = Kgio::POLLOUT
+      ok = true
+    end
     thr = Thread.new do
       sleep 0.100
-      pollset[@wr] = Kgio::POLLOUT
       Process.kill(:USR1, $$)
     end
     t0 = Time.now