class Concurrent::MutexAtomicBoolean
@!macro internal_implementation_note
@!visibility private
@!macro atomic_boolean
def false?
def false? synchronize { !@value } end
def initialize(initial = false)
def initialize(initial = false) super() @Lock = ::Mutex.new @value = !!initial end
def make_false
def make_false synchronize { ns_make_value(false) } end
def make_true
def make_true synchronize { ns_make_value(true) } end
def ns_make_value(value)
def ns_make_value(value) old = @value @value = value old != @value end
def synchronize
def synchronize if @Lock.owned? yield else @Lock.synchronize { yield } end end
def true?
def true? synchronize { @value } end
def value
def value synchronize { @value } end
def value=(value)
def value=(value) synchronize { @value = !!value } end