Implementation of a Mutex for Active Record