Fix actor receiver to use private attr getters instead of ivars

* Ivars lead to typos being caught late. Typos on send get caught early.
This commit is contained in:
Markus Schirp 2014-12-02 03:11:36 +00:00
parent 4ff4d65939
commit 95a20bdeae

View file

@ -31,14 +31,14 @@ module Mutant
# @api private
#
def try_blocking_receive
@mutex.lock
if @mailbox.empty?
@mutex.unlock
mutex.lock
if mailbox.empty?
mutex.unlock
Thread.stop
Undefined
else
@mailbox.shift.tap do
@mutex.unlock
mailbox.shift.tap do
mutex.unlock
end
end
end