Class: RubyVPI::SchedulerClass::Task

Inherits:
Struct
  • Object
show all
Defined in:
lib/ruby-vpi/core/scheduler.rb,
lib/ruby-vpi/core/scheduler.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#stateObject

Returns the value of attribute state

Returns:

  • (Object)

    the current value of state



15
16
17
# File 'lib/ruby-vpi/core/scheduler.rb', line 15

def state
  @state
end

#threadObject

Returns the value of attribute thread

Returns:

  • (Object)

    the current value of thread



15
16
17
# File 'lib/ruby-vpi/core/scheduler.rb', line 15

def thread
  @thread
end

Instance Method Details

#runObject



18
19
20
21
# File 'lib/ruby-vpi/core/scheduler.rb', line 18

def run
  self.state = :run
  self.thread.wakeup
end

#stopObject



23
24
25
26
# File 'lib/ruby-vpi/core/scheduler.rb', line 23

def stop
  self.state = :wait
  Thread.stop
end

#stop?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/ruby-vpi/core/scheduler.rb', line 28

def stop?
  self.thread.stop? and self.state == :wait
end