Class: LightIO::Library::ThreadGroup

Inherits:
Object
  • Object
show all
Includes:
Base, Wrap::Wrapper
Defined in:
lib/lightio/library/thread.rb

Instance Method Summary collapse

Methods included from Wrap::Wrapper

included

Methods included from Base

included, #initialize

Instance Method Details

#add(thread) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/lightio/library/thread.rb', line 10

def add(thread)
  if @obj.enclosed?
    raise ThreadError, "can't move from the enclosed thread group"
  elsif thread.is_a?(LightIO::Library::Thread)
    # let thread decide how to add to group
    thread.send(:add_to_group, self)
  else
    @obj.add(thread)
  end
  self
end

#listObject



22
23
24
# File 'lib/lightio/library/thread.rb', line 22

def list
  @obj.list + threads
end