lib/0mq/poll_interruptible.rb in 0mq-0.5.0 vs lib/0mq/poll_interruptible.rb in 0mq-0.5.1
- old
+ new
@@ -41,11 +41,15 @@
# Call the user block of #run
block.call nil, nil if block
socket.send_array ["OKAY"]
- @int_sock_rep.close if kill
+
+ if kill
+ @int_sock_rep.close
+ @dead = true
+ end
else
block.call socket, revents if block
end
end.tap { |hash| hash.delete @int_sock_rep }
end
@@ -76,12 +80,13 @@
def kill
return nil if @dead
@int_sock_req.send_array ["KILL"]
@int_sock_req.recv_array
+
@int_sock_req.close
- @dead = true
+ true
end
# Permanently kill the Poll object
# This should be run once, when the Poll object is no longer needed.
# This should only be accessed when there is no poll thread running.