lib/celluloid/task/threaded.rb in celluloid-0.18.0.pre vs lib/celluloid/task/threaded.rb in celluloid-0.18.0.pre2
- old
+ new
@@ -16,11 +16,11 @@
def create
# TODO: move this to ActorSystem#get_thread (ThreadHandle inside Group::Pool)
thread = Internals::ThreadHandle.new(Thread.current[:celluloid_actor_system], :task) do
begin
ex = @resume_queue.pop
- fail ex if ex.is_a?(TaskTerminated)
+ raise ex if ex.is_a?(TaskTerminated)
yield
rescue ::Exception => ex
@exception_queue << ex
ensure
@@ -38,15 +38,15 @@
end
@resume_queue.pop
end
def deliver(value)
- fail DeadTaskError, "cannot resume a dead task" unless @thread.alive?
+ raise DeadTaskError, "cannot resume a dead task" unless @thread.alive?
@yield_mutex.synchronize do
@resume_queue.push(value)
@yield_cond.wait(@yield_mutex)
- fail @exception_queue.pop while @exception_queue.size > 0
+ raise @exception_queue.pop until @exception_queue.empty?
end
rescue ThreadError
raise DeadTaskError, "cannot resume a dead task"
end