Skip to content

Commit

Permalink
Stop using rb_str_locktmp_ensure publicly
Browse files Browse the repository at this point in the history
rb_str_locktmp_ensure is a private API.
  • Loading branch information
peterzhu2118 committed Feb 23, 2024
1 parent 8a6740c commit ce8531f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ext/socket/init.c
Expand Up @@ -204,7 +204,8 @@ rsock_s_recvfrom(VALUE socket, int argc, VALUE *argv, enum sock_recv_type from)
rb_io_wait(fptr->self, RB_INT2NUM(RUBY_IO_READABLE), Qnil);
#endif

slen = (long)rb_str_locktmp_ensure(str, recvfrom_locktmp, (VALUE)&arg);
rb_str_locktmp(str);
slen = (long)rb_ensure(recvfrom_locktmp, (VALUE)&arg, rb_str_unlocktmp, str);

if (slen == 0 && !rsock_is_dgram(fptr)) {
return Qnil;
Expand Down
2 changes: 1 addition & 1 deletion string.c
Expand Up @@ -3097,7 +3097,7 @@ rb_str_unlocktmp(VALUE str)
return str;
}

RUBY_FUNC_EXPORTED VALUE
VALUE
rb_str_locktmp_ensure(VALUE str, VALUE (*func)(VALUE), VALUE arg)
{
rb_str_locktmp(str);
Expand Down

0 comments on commit ce8531f

Please sign in to comment.