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

[ruby/etc] Check blocking variables at release

f017bdfedf
This commit is contained in:
Nobuyoshi Nakada 2021-01-11 11:14:28 +09:00
parent d8c8b79d24
commit f6e2c41db3

View file

@ -253,7 +253,9 @@ static VALUE
passwd_ensure(VALUE _)
{
endpwent();
passwd_blocking = 0;
if (RUBY_ATOMIC_EXCHANGE(passwd_blocking, 0) != 1) {
rb_raise(rb_eRuntimeError, "unexpected passwd_blocking");
}
return Qnil;
}
@ -495,7 +497,9 @@ static VALUE
group_ensure(VALUE _)
{
endgrent();
group_blocking = 0;
if (RUBY_ATOMIC_EXCHANGE(group_blocking, 0) != 1) {
rb_raise(rb_eRuntimeError, "unexpected group_blocking");
}
return Qnil;
}