about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2014-05-09 01:35:49 +0000
committerEric Wong <e@80x24.org>2014-05-09 01:39:59 +0000
commitdc55ac157cd8f7e55339e8b1e36d2a3978934a15 (patch)
tree38aeeef52479dd8a5fee1d2c2c6b4e849342088f
parent0c78a8bf48dfb6fc260bfee03fecd394e399edb1 (diff)
downloadyahns-dc55ac157cd8f7e55339e8b1e36d2a3978934a15.tar.gz
There's almost no chance of blocking here, but better to
be safe than sorry inside signal handlers.  We would
get the wakeup even if the pipe/event fd blocks.
-rw-r--r--lib/yahns/sigevent_efd.rb2
-rw-r--r--lib/yahns/sigevent_pipe.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/yahns/sigevent_efd.rb b/lib/yahns/sigevent_efd.rb
index 8f10ad6..c65e13f 100644
--- a/lib/yahns/sigevent_efd.rb
+++ b/lib/yahns/sigevent_efd.rb
@@ -8,7 +8,7 @@ class Yahns::Sigevent < SleepyPenguin::EventFD # :nodoc:
   end
 
   def sev_signal
-    incr(1) # eventfd_write
+    incr(1, true) # eventfd_write
   end
 
   def yahns_step
diff --git a/lib/yahns/sigevent_pipe.rb b/lib/yahns/sigevent_pipe.rb
index ee0f14e..32cfbae 100644
--- a/lib/yahns/sigevent_pipe.rb
+++ b/lib/yahns/sigevent_pipe.rb
@@ -13,7 +13,7 @@ class Yahns::Sigevent # :nodoc:
   end
 
   def sev_signal
-    @wr.kgio_write(".")
+    @wr.kgio_trywrite(".")
   end
 
   def yahns_step