shutdown()
click to toggle source
def shutdown
@finish = true
@mutex.synchronize {
@cond.signal
}
Thread.pass
@thread.join
end
start()
click to toggle source
def start
@mutex = Mutex.new
@cond = ConditionVariable.new
@thread = Thread.new(&method(:run))
end
submit_flush()
click to toggle source
def submit_flush
@mutex.synchronize {
@next_time = 0
@cond.signal
}
Thread.pass
end