class Jekyll::Utils::ThreadEvent
emptysqua.re/blog/an-event-synchronization-primitive-for-ruby/
Based on the pattern and code from
def initialize
def initialize @lock = Mutex.new @cond = ConditionVariable.new @flag = false end
def set
def set @lock.synchronize do yield if block_given? @flag = true @cond.broadcast end end
def wait
def wait @lock.synchronize do @cond.wait(@lock) unless @flag end end