New Upstream Release - ruby-atomic

Ready changes

Summary

Merged new upstream version: 1.1.101 (was: 1.1.16).

Resulting package

Built on 2022-05-16T01:11 (took 3m0s)

The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:

apt install -t fresh-releases ruby-atomic-dbgsymapt install -t fresh-releases ruby-atomic

Lintian Result

Diff

diff --git a/.coveralls.yml b/.coveralls.yml
new file mode 100644
index 0000000..271b0c9
--- /dev/null
+++ b/.coveralls.yml
@@ -0,0 +1 @@
+repo_token: YHujQy7tqpw5P0TuWjwk6Vd5Vuw8LcGvo
diff --git a/.gitignore b/.gitignore
index 5f3f73d..701b996 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,37 @@
-.*.sw?
-lib/atomic_reference.jar
-/nbproject
-ext/*.bundle
-ext/*.so
-ext/*.jar
+Gemfile.lock
+*.gem
+lib/1.8
+lib/1.9
+lib/2.0
+.rvmrc
+.ruby-version
+.ruby-gemset
+.bundle/*
+.yardoc/*
+yardoc/*
+tmp/*
+man/*
+*.tmproj
+rdoc/*
+*.orig
+*.BACKUP.*
+*.BASE.*
+*.LOCAL.*
+*.REMOTE.*
+git_pull.txt
+coverage
+critic
+.DS_Store
+TAGS
+tmtags
+*.sw?
+.idea
+.rbx/*
+lib/**/*.bundle
+lib/**/*.so
+lib/**/*.jar
+ext/**/*.bundle
+ext/**/*.so
+ext/**/*.jar
 pkg
 *.gem
diff --git a/.travis.yml b/.travis.yml
index 315bff9..6bc5ce2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,10 +1,27 @@
 language: ruby
+
 rvm:
+  - 2.2.0
+  - 2.1.5
+  - 2.1.4
   - 2.0.0
   - 1.9.3
-  - 1.8.7
-  - jruby-18mode # JRuby in 1.8 mode
-  - jruby-19mode # JRuby in 1.9 mode
+  - ruby-head
+  - jruby-1.7.18
+  - jruby-head
   - rbx-2
+
 jdk:
   - oraclejdk8
+
+sudo: false
+
+branches:
+  only:
+    - master
+
+matrix:
+  allow_failures:
+    - rvm: ruby-head
+    - rvm: jruby-head
+    - rvm: 1.9.3
diff --git a/Gemfile b/Gemfile
index 83d71a7..d7e193e 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,4 +1,12 @@
-source "https://rubygems.org"
+source 'https://rubygems.org'
 
-gem 'rake-compiler'
-gem 'minitest', :group => :development
+gemspec
+
+group :development do
+  gem 'rake', '~> 10.3.2'
+  gem 'rake-compiler', '~> 0.9.2'
+end
+
+group :testing do
+  gem 'minitest', '>= 5.0.0', :group => :development
+end
diff --git a/README.md b/README.md
index 6001f9f..ca68f32 100644
--- a/README.md
+++ b/README.md
@@ -1,10 +1,35 @@
-atomic: An atomic reference implementation for JRuby, Rubinius, and MRI.
-========================================================================
+# Ruby Atomic
 
-[![Build Status](https://travis-ci.org/headius/ruby-atomic.png?branch=master)](https://travis-ci.org/headius/ruby-atomic)
+[![Gem Version](https://badge.fury.io/rb/atomic.svg)](http://badge.fury.io/rb/atomic) [![Build Status](https://travis-ci.org/ruby-concurrency/atomic.svg?branch=master)](https://travis-ci.org/ruby-concurrency/atomic) [![Code Climate](https://codeclimate.com/github/ruby-concurrency/atomic.svg)](https://codeclimate.com/github/ruby-concurrency/atomic) [![Dependency Status](https://gemnasium.com/ruby-concurrency/atomic.svg)](https://gemnasium.com/ruby-concurrency/atomic) [![License](https://img.shields.io/badge/license-Apache-green.svg)](http://opensource.org/licenses/Apache-2.0) [![Gitter chat](http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg)](https://gitter.im/ruby-concurrency/concurrent-ruby)
 
-Summary
-=======
+An atomic reference implementation for JRuby, Rubinius, and MRI.
+
+# Deprecated!
+
+*This gem has been deprecated in lieu of [Concurrent Ruby](http://www.concurrent-ruby.com).
+This gem will be retained in GitHub and Rubygems.org indefinitely but no new development
+will occur, including updates to support new versions of Ruby, JRuby, and Java. All users
+of this gem are encouraged to update their projects to use `concurrent-ruby` instead.*
+
+All code from this gem has been merged into `concurrent-ruby` and its companion gems.
+All abstrations in this library are available in `concurrent-ruby` but have been moved
+under the `Concurrent` module to avoid namespace collisions.
+
+```ruby
+# old way
+require 'atomic'
+my_atomic = Atomic.new(0)
+
+# new way
+require 'concurrent'
+my_atomic = Concurrent::Atomic.new(0)
+```
+
+# Old Documentation
+
+*For historic purposes only...*
+
+## Summary
 
 This library provides:
 
@@ -15,10 +40,9 @@ The Atomic class provides accessors for the contained "value" plus two update me
 * update will run the provided block, passing the current value and replacing it with the block result if the value has not been changed in the meantime. It may run the block repeatedly if there are other concurrent updates in progress.
 * try_update will run the provided block, passing the current value and replacing it with the block result. If the value changes before the update can happen, it will throw an Atomic::ConcurrentUpdateError.
 
-The atomic repository is at http://github.com/headius/ruby-atomic.
+The atomic repository is at http://github.com/ruby-concurrency/ruby-atomic.
 
-Usage
-=====
+## Usage
 
 The simplest way to use "atomic" is to call the "update" or "try_update" methods.
 
@@ -47,7 +71,6 @@ my_atomic.compare_and_swap(2, 3) # => true, updated to 3
 my_atomic.compare_and_swap(2, 3) # => false, current is not 2
 ```
 
-Building
-========
+## Building
 
 As of 1.1.0, JDK8 is required to build the atomic gem, since it attempts to use the new atomic Unsafe.getAndSetObject method only in JDK8. The resulting code should still work fine as far back as Java 5.
diff --git a/Rakefile b/Rakefile
index a0e109c..03e5ce5 100644
--- a/Rakefile
+++ b/Rakefile
@@ -13,8 +13,6 @@
 require 'rake'
 require 'rake/testtask'
 
-task :default => :test
-
 desc "Run tests"
 Rake::TestTask.new :test do |t|
   t.libs << "lib"
@@ -61,3 +59,5 @@ end
 
 task :package => :compile
 task :test => :compile
+
+task :default => :test
diff --git a/atomic.gemspec b/atomic.gemspec
index 3f65f94..aecc647 100644
--- a/atomic.gemspec
+++ b/atomic.gemspec
@@ -4,13 +4,13 @@
 
 Gem::Specification.new do |s|
   s.name = %q{atomic}
-  s.version = "1.1.16"
+  s.version = "1.1.101"
   s.authors = ["Charles Oliver Nutter", "MenTaLguY", "Sokolov Yura"]
   s.date = Time.now.strftime('%Y-%m-%d')
   s.summary = "An atomic reference implementation for JRuby, Rubinius, and MRI"
   s.description = s.summary
   s.email = ["headius@headius.com", "mental@rydia.net", "funny.falcon@gmail.com"]
-  s.homepage = "http://github.com/headius/ruby-atomic"
+  s.homepage = "http://github.com/ruby-concurrency/atomic"
   s.require_paths = ["lib"]
   s.licenses = ["Apache-2.0"]
   s.test_files = Dir["test/test*.rb"]
@@ -21,4 +21,5 @@ Gem::Specification.new do |s|
     s.extensions = 'ext/extconf.rb'
   end
   s.files += `git ls-files`.lines.map(&:chomp)
+  s.post_install_message = 'This gem has been deprecated and merged into Concurrent Ruby (http://concurrent-ruby.com).'
 end
diff --git a/checksums.yaml.gz b/checksums.yaml.gz
deleted file mode 100644
index 179d4a6..0000000
Binary files a/checksums.yaml.gz and /dev/null differ
diff --git a/debian/changelog b/debian/changelog
index 2427360..2b19eb3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,12 +1,13 @@
-ruby-atomic (1.1.16-4) UNRELEASED; urgency=medium
+ruby-atomic (1.1.101-1) UNRELEASED; urgency=medium
 
   * Apply multi-arch hints.
     + ruby-atomic: Add Multi-Arch: same.
   * Update watch file format version to 4.
   * Bump debhelper from old 12 to 13.
   * Update standards version to 4.5.1, no changes needed.
+  * New upstream release.
 
- -- Debian Janitor <janitor@jelmer.uk>  Tue, 27 Oct 2020 04:25:05 -0000
+ -- Debian Janitor <janitor@jelmer.uk>  Mon, 16 May 2022 01:09:04 -0000
 
 ruby-atomic (1.1.16-3) unstable; urgency=medium
 
diff --git a/ext/atomic_reference.c b/ext/atomic_reference.c
index 0a09cc6..fbbbca1 100644
--- a/ext/atomic_reference.c
+++ b/ext/atomic_reference.c
@@ -37,18 +37,31 @@ static VALUE ir_initialize(int argc, VALUE* argv, VALUE self) {
 }
 
 static VALUE ir_get(VALUE self) {
+#if HAVE_GCC_SYNC
+    __sync_synchronize();
+#elif defined _MSC_VER
+    MemoryBarrier();
+#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+    OSMemoryBarrier();
+#endif
     return (VALUE) DATA_PTR(self);
 }
 
 static VALUE ir_set(VALUE self, VALUE new_value) {
     DATA_PTR(self) = (void *) new_value;
+#if HAVE_GCC_SYNC
+    __sync_synchronize();
+#elif defined _MSC_VER
+    MemoryBarrier();
+#elif __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050
+    OSMemoryBarrier();
+#endif
     return new_value;
 }
 
 static VALUE ir_get_and_set(VALUE self, VALUE new_value) {
-    VALUE old_value;
-    old_value = (VALUE) DATA_PTR(self);
-    DATA_PTR(self) = (void *) new_value;
+    VALUE old_value = ir_get(self);
+    ir_set(self, new_value);
     return old_value;
 }
 
diff --git a/ext/extconf.rb b/ext/extconf.rb
index 03faf6e..6baa607 100644
--- a/ext/extconf.rb
+++ b/ext/extconf.rb
@@ -37,11 +37,10 @@ if compiler_is_gcc
   end
 end
 
-try_run(<<CODE,$CFLAGS) && ($defs << '-DHAVE_GCC_CAS')
+try_run(<<CODE,$CFLAGS) && ($defs << '-DHAVE_GCC_SYNC')
 int main() {
-  int i = 1;
-  __sync_bool_compare_and_swap(&i, 1, 4);
-  return (i != 4);
+  __sync_synchronize();
+  return 0;
 }
 CODE
 
diff --git a/metadata.yml b/metadata.yml
deleted file mode 100644
index 92e85c1..0000000
--- a/metadata.yml
+++ /dev/null
@@ -1,76 +0,0 @@
---- !ruby/object:Gem::Specification
-name: atomic
-version: !ruby/object:Gem::Version
-  version: 1.1.16
-platform: ruby
-authors:
-- Charles Oliver Nutter
-- MenTaLguY
-- Sokolov Yura
-autorequire: 
-bindir: bin
-cert_chain: []
-date: 2014-03-17 00:00:00.000000000 Z
-dependencies: []
-description: An atomic reference implementation for JRuby, Rubinius, and MRI
-email:
-- headius@headius.com
-- mental@rydia.net
-- funny.falcon@gmail.com
-executables: []
-extensions:
-- ext/extconf.rb
-extra_rdoc_files: []
-files:
-- ".gitignore"
-- ".travis.yml"
-- Gemfile
-- LICENSE
-- README.md
-- Rakefile
-- atomic.gemspec
-- examples/atomic_example.rb
-- examples/bench_atomic.rb
-- examples/bench_atomic_1.rb
-- examples/graph_atomic_bench.rb
-- ext/AtomicReferenceService.java
-- ext/atomic_reference.c
-- ext/extconf.rb
-- ext/org/jruby/ext/atomic/AtomicReferenceLibrary.java
-- lib/atomic.rb
-- lib/atomic/concurrent_update_error.rb
-- lib/atomic/delegated_update.rb
-- lib/atomic/direct_update.rb
-- lib/atomic/fallback.rb
-- lib/atomic/jruby.rb
-- lib/atomic/numeric_cas_wrapper.rb
-- lib/atomic/rbx.rb
-- lib/atomic/ruby.rb
-- test/test_atomic.rb
-homepage: http://github.com/headius/ruby-atomic
-licenses:
-- Apache-2.0
-metadata: {}
-post_install_message: 
-rdoc_options: []
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
-  requirements:
-  - - ">="
-    - !ruby/object:Gem::Version
-      version: '0'
-required_rubygems_version: !ruby/object:Gem::Requirement
-  requirements:
-  - - ">="
-    - !ruby/object:Gem::Version
-      version: '0'
-requirements: []
-rubyforge_project: 
-rubygems_version: 2.2.0
-signing_key: 
-specification_version: 4
-summary: An atomic reference implementation for JRuby, Rubinius, and MRI
-test_files:
-- test/test_atomic.rb
-has_rdoc: 
diff --git a/test/test_atomic.rb b/test/test_atomic.rb
index 79eb315..0e8f62a 100644
--- a/test/test_atomic.rb
+++ b/test/test_atomic.rb
@@ -13,7 +13,7 @@
 require 'minitest/autorun'
 require 'atomic'
 
-class TestAtomic < MiniTest::Test
+class TestAtomic < Minitest::Test
   def test_construct
     atomic = Atomic.new
     assert_equal nil, atomic.value

Debdiff

[The following lists of changes regard files as different if they have different names, permissions or owners.]

Files in second set of .debs but not in first

-rw-r--r--  root/root   /usr/lib/debug/.build-id/e5/7c1fcbcbfd9b3c4caa275366376b9afe2a572e.debug
-rw-r--r--  root/root   /usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/3.0.0/atomic_reference.so
-rw-r--r--  root/root   /usr/share/rubygems-integration/3.0.0/specifications/atomic-1.1.101.gemspec

Files in first set of .debs but not in second

-rw-r--r--  root/root   /usr/lib/debug/.build-id/eb/0a5514848b18e62eaef90549b24dc57fa26c9e.debug
-rw-r--r--  root/root   /usr/lib/x86_64-linux-gnu/ruby/vendor_ruby/3.1.0/atomic_reference.so
-rw-r--r--  root/root   /usr/share/rubygems-integration/3.1.0/specifications/atomic-1.1.16.gemspec

Control files of package ruby-atomic: lines which differ (wdiff format)

  • Depends: ruby | ruby-interpreter, (>= 1:3.0~0), libc6 (>= 2.2.5), libruby3.1 (>= 3.1.0~preview1), libruby libruby3.0 (>= 1:3.1~0), libruby 3.0.0~preview1), ruby (<< 1:3.2~) 1:3.1~)
  • Ruby-Versions: ruby3.0

Control files of package ruby-atomic-dbgsym: lines which differ (wdiff format)

  • Build-Ids: eb0a5514848b18e62eaef90549b24dc57fa26c9e e57c1fcbcbfd9b3c4caa275366376b9afe2a572e
  • Ruby-Versions: ruby3.0

More details

Full run details