Module: Concurrent::Synchronization

Included in:
Actor::Core, SerializedExecution
Defined in:
lib/concurrent/atomic/synchronization.rb

Overview

Note:

synchronized needs to be called in #initialize for this module to work properly

Safe synchronization under JRuby, prevents reading uninitialized @mutex variable.

Examples:

usage

class AClass
  include Synchronized

  def initialize
    synchronize do
      # body of the constructor ...
    end
  end

  def a_method
    synchronize do
      # body of a_method ...
    end
  end
end