Class: Smith::Workflow::Parallel::CancellationSignal
- Inherits:
-
Struct
- Object
- Struct
- Smith::Workflow::Parallel::CancellationSignal
- Defined in:
- lib/smith/workflow/parallel/cancellation_signal.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.
7 8 9 |
# File 'lib/smith/workflow/parallel/cancellation_signal.rb', line 7 def initialize super(false, Mutex.new) end |
Instance Attribute Details
#cancelled ⇒ Object
Returns the value of attribute cancelled
6 7 8 |
# File 'lib/smith/workflow/parallel/cancellation_signal.rb', line 6 def cancelled @cancelled end |
#mutex ⇒ Object
Returns the value of attribute mutex
6 7 8 |
# File 'lib/smith/workflow/parallel/cancellation_signal.rb', line 6 def mutex @mutex end |
Instance Method Details
#cancel! ⇒ Object
11 12 13 |
# File 'lib/smith/workflow/parallel/cancellation_signal.rb', line 11 def cancel! mutex.synchronize { self.cancelled = true } end |
#cancelled? ⇒ Boolean
15 16 17 |
# File 'lib/smith/workflow/parallel/cancellation_signal.rb', line 15 def cancelled? mutex.synchronize { cancelled } end |