Class: Dramatis::Runtime::ThreadPool::PoolThread

Inherits:
Thread
  • Object
show all
Defined in:
lib/dramatis/runtime/thread_pool.rb,
lib/dramatis/runtime/thread_pool.rb

Overview

:nodoc: all

Instance Method Summary collapse

Constructor Details

#initialize(pool) ⇒ PoolThread

Returns a new instance of PoolThread.



74
75
76
77
78
79
80
81
82
83
# File 'lib/dramatis/runtime/thread_pool.rb', line 74

def initialize pool
  @pool = pool
  @mutex = Mutex.new
  @wait = ConditionVariable.new
  @state = :running
  super() do
    self.abort_on_exception = true
    target
  end
end

Instance Method Details

#joinObject



87
88
89
90
91
92
93
94
# File 'lib/dramatis/runtime/thread_pool.rb', line 87

def join
  # I've thought about this. It would be cool to implement join. It's not
  # too hard to do it when threads aren't reused ... which is kinda dumb.
  # It's possible to do it when threads are reused, by coding an allocation
  # counter in the "thread" object (but not the native thread). It'd be
  # cool, but I don't need it, so, oh well.
  raise "not implemented"
end

#true_joinObject



85
# File 'lib/dramatis/runtime/thread_pool.rb', line 85

alias true_join join