Class: Mutex

Inherits:
Object show all
Defined in:
lib/mongo/util/core_ext.rb

Instance Method Summary collapse

Instance Method Details

#lock_with_hackObject Also known as: lock



92
93
94
95
96
97
98
99
100
101
# File 'lib/mongo/util/core_ext.rb', line 92

def lock_with_hack
  lock_without_hack
  rescue ThreadError => e
  if e.message != "deadlock; recursive locking"
    raise
  else
    unlock
    lock_without_hack
  end
end