• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ruby-concurrency / concurrent-ruby / #2835

05 Oct 2014 10:16PM UTC coverage: 45.201% (-49.6%) from 94.81%
#2835

push

jdantonio
Merge pull request #158 from obrok/promise-composition

Promise composition

2 of 15 new or added lines in 1 file covered. (13.33%)

1514 existing lines in 84 files now uncovered.

1375 of 3042 relevant lines covered (45.2%)

0.66 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

33.33
/lib/concurrent/atomic_reference/numeric_cas_wrapper.rb
1
module Concurrent
1✔
2

3
  # Special "compare and set" handling of numeric values.
4
  module AtomicNumericCompareAndSetWrapper
1✔
5

6
    # @!macro atomic_reference_method_compare_and_set
7
    def compare_and_set(old_value, new_value)
1✔
UNCOV
8
      if old_value.kind_of? Numeric
×
UNCOV
9
        while true
×
UNCOV
10
          old = get
×
11

UNCOV
12
          return false unless old.kind_of? Numeric
×
13

UNCOV
14
          return false unless old == old_value
×
15

UNCOV
16
          result = _compare_and_set(old, new_value)
×
UNCOV
17
          return result if result
×
18
        end
19
      else
UNCOV
20
        _compare_and_set(old_value, new_value)
×
21
      end
22
    end
23
    alias_method :compare_and_swap, :compare_and_set
1✔
24
  end
25
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc