Class: MGit::Lock
- Inherits:
-
Object
- Object
- MGit::Lock
- Defined in:
- lib/m-git/foundation/lock.rb
Class Method Summary collapse
-
.mutex_exec ⇒ Object
mutex_exec do exec..
-
.mutex_puts ⇒ Object
mutex_puts do exec..
Class Method Details
.mutex_exec ⇒ Object
mutex_exec do
exec..
end
11 12 13 14 15 16 |
# File 'lib/m-git/foundation/lock.rb', line 11 def mutex_exec @mutex = Mutex.new if @mutex.nil? @mutex.lock yield if block_given? @mutex.unlock end |
.mutex_puts ⇒ Object
mutex_puts do
exec..
end
23 24 25 26 27 28 |
# File 'lib/m-git/foundation/lock.rb', line 23 def mutex_puts @mutex_puts = Mutex.new if @mutex_puts.nil? @mutex_puts.lock yield if block_given? @mutex_puts.unlock end |