diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-02-27 11:40:40 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-02-27 11:41:47 +0000 |
commit | 89c26cdaf25463c891a8ce915fefa1a181b3ac64 (patch) | |
tree | 1035f989f4a4f3171262a3ae8e438b25a51e3576 /lib | |
parent | 5af56c9047dae680bde185c8a2b82de03b63e032 (diff) | |
download | ruby_posix_mq-89c26cdaf25463c891a8ce915fefa1a181b3ac64.tar.gz |
Cleaner code anyways.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/posix_mq.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/posix_mq.rb b/lib/posix_mq.rb index a059cf8..0048c26 100644 --- a/lib/posix_mq.rb +++ b/lib/posix_mq.rb @@ -51,16 +51,16 @@ class POSIX_MQ block.arity == 1 or raise ArgumentError, "arity of notify block must be 1" r, w = IO.pipe - self.notify_exec(w, Thread.new(r, w, self) do |r, w, mq| + self.notify_exec(w, Thread.new(block) do |blk| begin begin r.read(1) or raise Errno::EINTR rescue Errno::EINTR, Errno::EAGAIN retry end - block.call(mq) + blk.call(self) ensure - mq.notify_cleanup + notify_cleanup r.close rescue nil w.close rescue nil end |