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

ruby-concurrency / concurrent-ruby / #2727

25 Jun 2014 01:41PM UTC coverage: 91.488% (-4.8%) from 96.27%
#2727

push

jdantonio
Merge pull request #121 from ruby-concurrency/refactor/executors

Refactor executors

72 of 78 new or added lines in 6 files covered. (92.31%)

2343 of 2561 relevant lines covered (91.49%)

475.08 hits per line

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

91.67
/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✔
8
      if old_value.kind_of? Numeric
54✔
9
        while true
54✔
10
          old = get
54✔
11

12
          return false unless old.kind_of? Numeric
54✔
13

14
          return false unless old == old_value
54✔
15

16
          result = _compare_and_set(old, new_value)
50✔
17
          return result if result
50✔
18
        end
19
      else
NEW
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