mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Assert the GVL is held when performing various rb_
functions.
[Feature #20877]
This commit is contained in:
parent
4e970c5d5a
commit
c13ac4d615
Notes:
git
2025-04-14 09:28:26 +00:00
3 changed files with 20 additions and 0 deletions
5
array.c
5
array.c
|
@ -27,6 +27,7 @@
|
|||
#include "probes.h"
|
||||
#include "ruby/encoding.h"
|
||||
#include "ruby/st.h"
|
||||
#include "ruby/thread.h"
|
||||
#include "ruby/util.h"
|
||||
#include "vm_core.h"
|
||||
#include "builtin.h"
|
||||
|
@ -521,6 +522,8 @@ rb_ary_set_shared(VALUE ary, VALUE shared_root)
|
|||
static inline void
|
||||
rb_ary_modify_check(VALUE ary)
|
||||
{
|
||||
RUBY_ASSERT(ruby_thread_has_gvl_p());
|
||||
|
||||
rb_check_frozen(ary);
|
||||
ary_verify(ary);
|
||||
}
|
||||
|
@ -705,6 +708,8 @@ empty_ary_alloc(VALUE klass)
|
|||
static VALUE
|
||||
ary_new(VALUE klass, long capa)
|
||||
{
|
||||
RUBY_ASSERT(ruby_thread_has_gvl_p());
|
||||
|
||||
VALUE ary;
|
||||
|
||||
if (capa < 0) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue