Class: MGit::Lock

Inherits:
Object
  • Object
show all
Defined in:
lib/m-git/foundation/lock.rb

Class Method Summary collapse

Class Method Details

.mutex_execObject

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_putsObject

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