Module: ActiveRecord::Bogacs::ThreadSafe::Synchronized

Included in:
FalsePool
Defined in:
lib/active_record/bogacs/thread_safe/synchronized.rb,
lib/active_record/bogacs/thread_safe/synchronized.rb

Instance Method Summary collapse

Instance Method Details

#synchronizeObject

Use Java’s native synchronized (this) { wait(); notifyAll(); } to avoid the overhead of the extra Mutex objects



9
10
11
12
13
14
15
16
# File 'lib/active_record/bogacs/thread_safe/synchronized.rb', line 9

def synchronize
  ::Rubinius.lock(self)
  begin
    yield
  ensure
    ::Rubinius.unlock(self)
  end
end