Module: MultiXML::Concurrency Private
- Defined in:
- lib/multi_xml/concurrency.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Catalog of process-wide mutexes used to serialize MultiXML's mutable state. Each mutex protects a distinct piece of state. Callers go through Concurrency.synchronize rather than touching the mutex constants directly so the constants themselves can stay private_constant and the surface of the module is documented in one place.
Class Method Summary collapse
-
.synchronize(name) { ... } ⇒ Object
private
Run a block while holding the named mutex.
Class Method Details
.synchronize(name) { ... } ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Run a block while holding the named mutex
27 28 29 |
# File 'lib/multi_xml/concurrency.rb', line 27 def self.synchronize(name, &) MUTEXES.fetch(name).synchronize(&) end |