14 #define GET_CONDVAR_WAITERS(cv) get_array((cv), CONDVAR_WAITERS)
16 #define GET_QUEUE_QUE(q) get_array((q), QUEUE_QUE)
17 #define GET_QUEUE_WAITERS(q) get_array((q), QUEUE_WAITERS)
18 #define GET_SZQUEUE_WAITERS(q) get_array((q), SZQUEUE_WAITERS)
19 #define GET_SZQUEUE_MAX(q) RSTRUCT_GET((q), SZQUEUE_MAX)
20 #define GET_SZQUEUE_ULONGMAX(q) NUM2ULONG(GET_SZQUEUE_MAX(q))
282 if (!(
int)should_block) {
544 #define UNDER_THREAD 1
558 #define ALIAS_GLOBAL_CONST(name) do { \
559 ID id = rb_intern_const(#name); \
560 if (!rb_const_defined_at(rb_cObject, id)) { \
561 rb_const_set(rb_cObject, id, rb_c##name); \
564 #define OUTER rb_cThread
566 #define ALIAS_GLOBAL_CONST(name) do { } while (0)
577 "que",
"waiters",
NULL);
581 "que",
"waiters",
"queue_waiters",
"size",
NULL);
VALUE rb_struct_define_without_accessor_under(VALUE outer, const char *class_name, VALUE super, rb_alloc_func_t alloc,...)
#define RB_TYPE_P(obj, type)
static VALUE queue_do_pop(VALUE self, VALUE should_block)
static VALUE rb_condvar_broadcast(VALUE self)
rb_funcall2(argv[0], id_yield, argc-1, argv+1)
static int max(int a, int b)
static VALUE rb_queue_push(VALUE self, VALUE obj)
#define GET_CONDVAR_WAITERS(cv)
static VALUE rb_queue_empty_p(VALUE self)
static VALUE do_sleep(VALUE args)
VALUE rb_ary_shift(VALUE ary)
VALUE rb_ary_push(VALUE ary, VALUE item)
static VALUE rb_szqueue_num_waiting(VALUE self)
VALUE rb_ary_tmp_new(long capa)
void rb_raise(VALUE exc, const char *fmt,...)
static VALUE rb_queue_initialize(VALUE self)
VALUE rb_obj_class(VALUE)
VALUE rb_ary_clear(VALUE ary)
void rb_thread_sleep_deadly(void)
static VALUE rb_szqueue_push(VALUE self, VALUE obj)
static VALUE rb_condvar_initialize(VALUE self)
static void wakeup_all_threads(VALUE list)
void rb_undef_method(VALUE klass, const char *name)
static VALUE queue_pop_should_block(int argc, VALUE *argv)
void rb_provide(const char *)
#define RARRAY_AREF(a, i)
VALUE rb_define_class(const char *name, VALUE super)
Defines a top-level class.
static void wakeup_first_thread(VALUE list)
#define GET_SZQUEUE_WAITERS(q)
static VALUE rb_szqueue_max_set(VALUE self, VALUE vmax)
static unsigned long queue_num_waiting(VALUE self)
#define RSTRUCT_SET(st, idx, v)
static VALUE queue_do_push(VALUE self, VALUE obj)
#define GET_QUEUE_WAITERS(q)
void rb_define_alias(VALUE klass, const char *name1, const char *name2)
Defines an alias of a method.
static VALUE rb_szqueue_max_get(VALUE self)
VALUE rb_thread_current(void)
VALUE rb_ary_delete(VALUE ary, VALUE item)
int rb_scan_args(int argc, const VALUE *argv, const char *fmt,...)
static VALUE szqueue_do_pop(VALUE self, VALUE should_block)
static VALUE undumpable(VALUE obj)
VALUE rb_thread_wakeup_alive(VALUE)
VALUE rb_ensure(VALUE(*b_proc)(ANYARGS), VALUE data1, VALUE(*e_proc)(ANYARGS), VALUE data2)
static VALUE rb_queue_pop(int argc, VALUE *argv, VALUE self)
#define GET_SZQUEUE_ULONGMAX(q)
static VALUE ary_buf_new(void)
#define GET_SZQUEUE_MAX(q)
static VALUE rb_szqueue_initialize(VALUE self, VALUE vmax)
static VALUE rb_szqueue_clear(VALUE self)
static VALUE rb_queue_length(VALUE self)
static VALUE delete_current_thread(VALUE ary)
RUBY_EXTERN VALUE rb_cObject
static VALUE queue_sleep(VALUE arg)
static Bigint * diff(Bigint *a, Bigint *b)
struct rb_encoding_entry * list
static VALUE rb_condvar_signal(VALUE self)
static VALUE get_array(VALUE obj, int idx)
static VALUE rb_condvar_wait(int argc, VALUE *argv, VALUE self)
#define ALIAS_GLOBAL_CONST(name)
static VALUE rb_szqueue_pop(int argc, VALUE *argv, VALUE self)
static VALUE rb_queue_clear(VALUE self)
static VALUE rb_queue_num_waiting(VALUE self)
void rb_define_method(VALUE klass, const char *name, VALUE(*func)(ANYARGS), int argc)
static unsigned long queue_length(VALUE self)
VALUE rb_struct_alloc_noinit(VALUE)
static VALUE queue_delete_from_waiting(struct waiting_delete *p)
#define RSTRUCT_GET(st, idx)