Class: Smith::Workflow::Parallel::CancellationSignal
- Inherits:
-
Struct
- Object
- Struct
- Smith::Workflow::Parallel::CancellationSignal
- Defined in:
- lib/smith/workflow/parallel.rb
Instance Attribute Summary collapse
-
#cancelled ⇒ Object
Returns the value of attribute cancelled.
-
#mutex ⇒ Object
Returns the value of attribute mutex.
Instance Method Summary collapse
- #cancel! ⇒ Object
- #cancelled? ⇒ Boolean
-
#initialize ⇒ CancellationSignal
constructor
A new instance of CancellationSignal.
Constructor Details
#initialize ⇒ CancellationSignal
Returns a new instance of CancellationSignal.
9 10 11 |
# File 'lib/smith/workflow/parallel.rb', line 9 def initialize super(false, Mutex.new) end |
Instance Attribute Details
#cancelled ⇒ Object
Returns the value of attribute cancelled
8 9 10 |
# File 'lib/smith/workflow/parallel.rb', line 8 def cancelled @cancelled end |
#mutex ⇒ Object
Returns the value of attribute mutex
8 9 10 |
# File 'lib/smith/workflow/parallel.rb', line 8 def mutex @mutex end |
Instance Method Details
#cancel! ⇒ Object
13 14 15 |
# File 'lib/smith/workflow/parallel.rb', line 13 def cancel! mutex.synchronize { self.cancelled = true } end |
#cancelled? ⇒ Boolean
17 18 19 |
# File 'lib/smith/workflow/parallel.rb', line 17 def cancelled? mutex.synchronize { cancelled } end |