Class: ReentrantMutex
- Defined in:
- lib/gems/logging-0.9.4/lib/logging/utils.rb
Instance Method Summary collapse
-
#initialize ⇒ ReentrantMutex
constructor
A new instance of ReentrantMutex.
- #original_synchronize ⇒ Object
- #synchronize ⇒ Object
Constructor Details
#initialize ⇒ ReentrantMutex
Returns a new instance of ReentrantMutex.
107 108 109 110 |
# File 'lib/gems/logging-0.9.4/lib/logging/utils.rb', line 107 def initialize super @locker = nil end |
Instance Method Details
#original_synchronize ⇒ Object
112 |
# File 'lib/gems/logging-0.9.4/lib/logging/utils.rb', line 112 alias :original_synchronize :synchronize |
#synchronize ⇒ Object
114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/gems/logging-0.9.4/lib/logging/utils.rb', line 114 def synchronize if @locker == Thread.current yield else original_synchronize { begin @locker = Thread.current yield ensure @locker = nil end } end end |