class Thread::Task::Counter
Public Class Methods
new()
click to toggle source
# File lib/thread/task/base.rb, line 89 def initialize @count = 0 @mutex = Mutex.new end
Public Instance Methods
decr()
click to toggle source
# File lib/thread/task/base.rb, line 100 def decr @mutex.synchronize do @count -= 1 if @count > 0 @count end end
incr()
click to toggle source
# File lib/thread/task/base.rb, line 94 def incr @mutex.synchronize do @count += 1 end end
reset()
click to toggle source
# File lib/thread/task/base.rb, line 107 def reset @mutex.synchronize do @count = 0 end end