Top Level Namespace

Defined Under Namespace

Modules: Concurrent

Instance Method Summary collapse

Instance Method Details

#compare_and_setBoolean

Atomically sets the value to the given updated value if the current value == the expected value.

that the actual value was not equal to the expected value.

Parameters:

  • old_value (Object)

    the expected value

  • new_value (Object)

    the new value

Returns:

  • (Boolean)

    ‘true` if successful. A `false` return indicates



44
# File 'lib/concurrent/atomics.rb', line 44

require 'concurrent/atomic/atomic_reference'

#getObject

Gets the current value.

Returns:

  • (Object)

    the current value



44
# File 'lib/concurrent/atomics.rb', line 44

require 'concurrent/atomic/atomic_reference'

#get_and_setObject

Atomically sets to the given value and returns the old value.

Parameters:

  • new_value (Object)

    the new value

Returns:

  • (Object)

    the old value



44
# File 'lib/concurrent/atomics.rb', line 44

require 'concurrent/atomic/atomic_reference'

#initializeObject

Parameters:

  • value (Object)

    The initial value.



44
# File 'lib/concurrent/atomics.rb', line 44

require 'concurrent/atomic/atomic_reference'

#setObject

Sets to the given value.

Parameters:

  • new_value (Object)

    the new value

Returns:

  • (Object)

    the new value



44
# File 'lib/concurrent/atomics.rb', line 44

require 'concurrent/atomic/atomic_reference'