ruby-changes:60913
From: Nobuyoshi <ko1@a...>
Date: Sun, 26 Apr 2020 22:40:28 +0900 (JST)
Subject: [ruby-changes:60913] 257e01b61d (master): Solaris does not provide atomic_sub family
https://git.ruby-lang.org/ruby.git/commit/?id=257e01b61d From 257e01b61db90ecf3a53957281770b5f3db3f919 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 26 Apr 2020 22:39:36 +0900 Subject: Solaris does not provide atomic_sub family diff --git a/ruby_atomic.h b/ruby_atomic.h index eaa9fcd..fa888a1 100644 --- a/ruby_atomic.h +++ b/ruby_atomic.h @@ -117,7 +117,7 @@ rb_atomic_fetch_add(volatile rb_atomic_t *var, rb_atomic_t val) https://github.com/ruby/ruby/blob/trunk/ruby_atomic.h#L117 static inline rb_atomic_t rb_atomic_fetch_sub(volatile rb_atomic_t *var, rb_atomic_t val) { - return atomic_sub_int_nv(var, val) + val; + return atomic_add_int_nv(var, (rb_atomic_t)(-(int)val)) + val; } # if defined(_LP64) || defined(_I32LPx) -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/