ReentrantMutex

A simple gem that implements a reentrant mutex.

Installation

  1. Install it gem install reentrant_lock
  2. Require it require 'reentrant_lock'
  3. Use it

Usage

This works exactly like a normal mutex except that you can lock a mutex you already have locked.

require 'reentrant_mutex'

mutex = ReentrantMutex.new
mutex.synchronize do
  # . . .
end