lib/celluloid/tasks/task_thread.rb in celluloid-0.14.1 vs lib/celluloid/tasks/task_thread.rb in celluloid-0.15.0.pre
- old
+ new
@@ -1,20 +1,19 @@
module Celluloid
# Tasks with a Thread backend
class TaskThread < Task
# Run the given block within a task
- def initialize(type)
+ def initialize(type, meta)
@resume_queue = Queue.new
@exception_queue = Queue.new
@yield_mutex = Mutex.new
@yield_cond = ConditionVariable.new
super
end
def create
- @thread = Celluloid.internal_pool.get do
- Thread.current.role = :task
+ @thread = Celluloid::ThreadHandle.new(:task) do
begin
ex = @resume_queue.pop
raise ex if ex.is_a?(Task::TerminatedError)
yield