Sha256: 80037211f1b86725d9ec8982252aadae4e671be01e93e29300ed9dc9b8f06a7f
Contents?: true
Size: 534 Bytes
Versions: 8
Compression:
Stored size: 534 Bytes
Contents
module Concurrent module AtomicNumericCompareAndSetWrapper #alias _compare_and_set compare_and_set def compare_and_set(expected, new) if expected.kind_of? Numeric while true old = get return false unless old.kind_of? Numeric return false unless old == expected result = _compare_and_set(old, new) return result if result end else _compare_and_set(expected, new) end end alias compare_and_swap compare_and_set end end
Version data entries
8 entries across 8 versions & 1 rubygems