Method: Mutant::Variable#initialize

Defined in:
lib/mutant/variable.rb

#initialize(condition_variable:, mutex:, value: EMPTY) ⇒ undefined

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initialize object

Parameters:

  • value (Object) (defaults to: EMPTY)

    the initial value



83
84
85
86
87
# File 'lib/mutant/variable.rb', line 83

def initialize(condition_variable:, mutex:, value: EMPTY)
  @full  = condition_variable.new
  @mutex = mutex.new
  @value = value
end