Class: Qs::Daemon::Signal
- Inherits:
-
Object
- Object
- Qs::Daemon::Signal
- Defined in:
- lib/qs/daemon.rb
Instance Method Summary collapse
- #halt? ⇒ Boolean
-
#initialize(value) ⇒ Signal
constructor
A new instance of Signal.
- #set(value) ⇒ Object
- #start? ⇒ Boolean
- #stop? ⇒ Boolean
Constructor Details
#initialize(value) ⇒ Signal
367 368 369 370 |
# File 'lib/qs/daemon.rb', line 367 def initialize(value) @value = value @mutex = Mutex.new end |
Instance Method Details
#halt? ⇒ Boolean
384 385 386 |
# File 'lib/qs/daemon.rb', line 384 def halt? @mutex.synchronize{ @value == :halt } end |
#set(value) ⇒ Object
372 373 374 |
# File 'lib/qs/daemon.rb', line 372 def set(value) @mutex.synchronize{ @value = value } end |
#start? ⇒ Boolean
376 377 378 |
# File 'lib/qs/daemon.rb', line 376 def start? @mutex.synchronize{ @value == :start } end |
#stop? ⇒ Boolean
380 381 382 |
# File 'lib/qs/daemon.rb', line 380 def stop? @mutex.synchronize{ @value == :stop } end |