1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Solaris does not provide atomic_sub family

This commit is contained in:
Nobuyoshi Nakada 2020-04-26 22:39:36 +09:00
parent 1760c60174
commit 257e01b61d
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -117,7 +117,7 @@ rb_atomic_fetch_add(volatile rb_atomic_t *var, rb_atomic_t val)
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)