Module: Libis::Tools::ThreadSafe
- Included in:
- MetsFile, MetsFile::Div
- Defined in:
- lib/libis/tools/thread_safe.rb
Overview
Module to safely create a mutex for creating thread safe classes.
Usage: include this module in a class or extend a module with this one.
Instance Method Summary collapse
-
#mutex ⇒ Object
Access the instance mutex.
Instance Method Details
#mutex ⇒ Object
Access the instance mutex
12 13 14 15 16 |
# File 'lib/libis/tools/thread_safe.rb', line 12 def mutex self.class.class_mutex.synchronize do @mutex ||= Monitor.new end end |