lib/thread/pool.rb in thread-0.0.1.1 vs lib/thread/pool.rb in thread-0.0.2
- old
+ new
@@ -16,13 +16,17 @@
Asked = Class.new(Exception)
attr_reader :pool, :timeout, :exception, :thread, :started_at
def initialize (pool, *args, &block)
- @pool = pool
- @arguments = args
- @block = block
+ @pool = pool
+ @arguments = args
+ @block = block
+ @running = false
+ @finished = false
+ @timedout = false
+ @terminated = false
end
def running?; @running; end
def finished?; @finished; end
def timeout?; @timedout; end
@@ -219,10 +223,10 @@
self
end
def wake_up_timeout
- if @pipes
+ if defined? @pipes
@pipes.last.write_nonblock 'x' rescue nil
end
end
private