# File lib/posix_mq.rb, line 50 def notify(&block) block.arity == 1 or raise ArgumentError, "arity of notify block must be 1" r, w = IO.pipe notify_exec(w, Thread.new(block) do |blk| begin begin r.read(1) or raise Errno::EINTR rescue Errno::EINTR, Errno::EAGAIN retry end blk.call(self) ensure notify_cleanup r.close rescue nil w.close rescue nil end end) nil end