mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Add rb_concurrent_set_size
This commit is contained in:
parent
5d44f2917f
commit
9ef482bd13
2 changed files with 9 additions and 0 deletions
|
@ -61,6 +61,14 @@ rb_concurrent_set_new(const struct rb_concurrent_set_funcs *funcs, int capacity)
|
|||
return obj;
|
||||
}
|
||||
|
||||
rb_atomic_t
|
||||
rb_concurrent_set_size(VALUE set_obj)
|
||||
{
|
||||
struct concurrent_set *set = RTYPEDDATA_GET_DATA(set_obj);
|
||||
|
||||
return RUBY_ATOMIC_LOAD(set->size);
|
||||
}
|
||||
|
||||
struct concurrent_set_probe {
|
||||
int idx;
|
||||
int d;
|
||||
|
|
|
@ -14,6 +14,7 @@ struct rb_concurrent_set_funcs {
|
|||
};
|
||||
|
||||
VALUE rb_concurrent_set_new(const struct rb_concurrent_set_funcs *funcs, int capacity);
|
||||
rb_atomic_t rb_concurrent_set_size(VALUE set_obj);
|
||||
VALUE rb_concurrent_set_find_or_insert(VALUE *set_obj_ptr, VALUE key, void *data);
|
||||
VALUE rb_concurrent_set_delete_by_identity(VALUE set_obj, VALUE key);
|
||||
void rb_concurrent_set_foreach_with_replace(VALUE set_obj, int (*callback)(VALUE *key, void *data), void *data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue