ruby/internal/concurrent_set.h
Jean Boussier 0bb44f291e Rename ractor_safe_set into concurrent_set
There's nothing ractor related in them, and the classic terminology
for these sort of data structures is `concurrent-*`, e.g.
concurrent hash.
2025-07-07 15:12:39 +02:00

21 lines
791 B
C

#ifndef RUBY_RACTOR_SAFE_TABLE_H
#define RUBY_RACTOR_SAFE_TABLE_H
#include "ruby/ruby.h"
typedef VALUE (*rb_concurrent_set_hash_func)(VALUE key);
typedef bool (*rb_concurrent_set_cmp_func)(VALUE a, VALUE b);
typedef VALUE (*rb_concurrent_set_create_func)(VALUE key, void *data);
struct rb_concurrent_set_funcs {
rb_concurrent_set_hash_func hash;
rb_concurrent_set_cmp_func cmp;
rb_concurrent_set_create_func create;
};
VALUE rb_concurrent_set_new(struct rb_concurrent_set_funcs *funcs, int capacity);
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);
#endif