Ruby
2.1.10p492(2016-04-01revision54464)
|
#include <ruby.h>
Go to the source code of this file.
Data Structures | |
struct | sleep_call |
struct | waiting_delete |
Macros | |
#define | GET_CONDVAR_WAITERS(cv) get_array((cv), CONDVAR_WAITERS) |
#define | GET_QUEUE_QUE(q) get_array((q), QUEUE_QUE) |
#define | GET_QUEUE_WAITERS(q) get_array((q), QUEUE_WAITERS) |
#define | GET_SZQUEUE_WAITERS(q) get_array((q), SZQUEUE_WAITERS) |
#define | GET_SZQUEUE_MAX(q) RSTRUCT_GET((q), SZQUEUE_MAX) |
#define | GET_SZQUEUE_ULONGMAX(q) NUM2ULONG(GET_SZQUEUE_MAX(q)) |
#define | UNDER_THREAD 1 |
#define | ALIAS_GLOBAL_CONST(name) |
#define | OUTER rb_cThread |
Enumerations | |
enum | { CONDVAR_WAITERS = 0 } |
enum | { QUEUE_QUE = 0, QUEUE_WAITERS = 1, SZQUEUE_WAITERS = 2, SZQUEUE_MAX = 3 } |
Variables | |
static ID | id_sleep |
#define ALIAS_GLOBAL_CONST | ( | name | ) |
Referenced by Init_thread().
#define GET_CONDVAR_WAITERS | ( | cv | ) | get_array((cv), CONDVAR_WAITERS) |
Definition at line 14 of file thread.c.
Referenced by rb_condvar_broadcast(), rb_condvar_signal(), and rb_condvar_wait().
Definition at line 16 of file thread.c.
Referenced by queue_do_pop(), queue_do_push(), queue_length(), rb_queue_clear(), and rb_szqueue_clear().
#define GET_QUEUE_WAITERS | ( | q | ) | get_array((q), QUEUE_WAITERS) |
Definition at line 17 of file thread.c.
Referenced by queue_do_pop(), queue_do_push(), and queue_num_waiting().
#define GET_SZQUEUE_MAX | ( | q | ) | RSTRUCT_GET((q), SZQUEUE_MAX) |
Definition at line 19 of file thread.c.
Referenced by rb_szqueue_max_get().
#define GET_SZQUEUE_ULONGMAX | ( | q | ) | NUM2ULONG(GET_SZQUEUE_MAX(q)) |
Definition at line 20 of file thread.c.
Referenced by rb_szqueue_max_set(), rb_szqueue_push(), and szqueue_do_pop().
#define GET_SZQUEUE_WAITERS | ( | q | ) | get_array((q), SZQUEUE_WAITERS) |
Definition at line 18 of file thread.c.
Referenced by rb_szqueue_clear(), rb_szqueue_max_set(), rb_szqueue_num_waiting(), rb_szqueue_push(), and szqueue_do_pop().
#define OUTER rb_cThread |
Referenced by Init_thread().
anonymous enum |
Definition at line 33 of file thread.c.
References rb_ary_tmp_new().
Referenced by rb_condvar_initialize(), rb_queue_initialize(), and rb_szqueue_initialize().
Definition at line 119 of file thread.c.
References rb_ary_delete(), and rb_thread_current().
Referenced by rb_condvar_wait().
Definition at line 112 of file thread.c.
References id_sleep, sleep_call::mutex, p, rb_funcall2(), and sleep_call::timeout.
Referenced by rb_condvar_wait().
Definition at line 23 of file thread.c.
References ary, PRIsVALUE, rb_eTypeError, rb_raise(), RB_TYPE_P, RSTRUCT_GET, and T_ARRAY.
Definition at line 555 of file thread.c.
References ALIAS_GLOBAL_CONST, id_sleep, NULL, OUTER, rb_cObject, rb_condvar_broadcast(), rb_condvar_initialize(), rb_condvar_signal(), rb_condvar_wait(), rb_define_alias(), rb_define_class(), rb_define_method(), rb_intern, rb_provide(), rb_queue_clear(), rb_queue_empty_p(), rb_queue_initialize(), rb_queue_length(), rb_queue_num_waiting(), rb_queue_pop(), rb_queue_push(), rb_struct_alloc_noinit(), rb_struct_define_without_accessor_under(), rb_szqueue_clear(), rb_szqueue_initialize(), rb_szqueue_max_get(), rb_szqueue_max_set(), rb_szqueue_num_waiting(), rb_szqueue_pop(), rb_szqueue_push(), rb_undef_method(), and undumpable().
|
static |
Definition at line 261 of file thread.c.
References Qnil, rb_ary_delete(), waiting_delete::th, and waiting_delete::waiting.
Referenced by queue_do_pop(), and rb_szqueue_push().
Definition at line 275 of file thread.c.
References GET_QUEUE_QUE, GET_QUEUE_WAITERS, queue_delete_from_waiting(), queue_length(), queue_sleep(), rb_ary_push(), rb_ary_shift(), rb_ensure(), rb_eThreadError, rb_raise(), rb_thread_current(), waiting_delete::th, and waiting_delete::waiting.
Referenced by rb_queue_pop(), and szqueue_do_pop().
Definition at line 220 of file thread.c.
References GET_QUEUE_QUE, GET_QUEUE_WAITERS, rb_ary_push(), and wakeup_first_thread().
Referenced by rb_queue_push(), and rb_szqueue_push().
|
static |
Definition at line 244 of file thread.c.
References GET_QUEUE_QUE, and RARRAY_LEN.
Referenced by queue_do_pop(), rb_queue_empty_p(), rb_queue_length(), rb_szqueue_push(), and szqueue_do_pop().
|
static |
Definition at line 250 of file thread.c.
References GET_QUEUE_WAITERS, and RARRAY_LEN.
Referenced by rb_queue_num_waiting(), and rb_szqueue_num_waiting().
Definition at line 293 of file thread.c.
References Qfalse, Qtrue, rb_eArgError, rb_raise(), and RTEST.
Referenced by rb_queue_pop(), and rb_szqueue_pop().
Definition at line 268 of file thread.c.
References Qnil, and rb_thread_sleep_deadly().
Referenced by queue_do_pop().
Definition at line 171 of file thread.c.
References GET_CONDVAR_WAITERS, and wakeup_all_threads().
Referenced by Init_thread().
Definition at line 98 of file thread.c.
References ary_buf_new(), CONDVAR_WAITERS, and RSTRUCT_SET.
Referenced by Init_thread().
Definition at line 158 of file thread.c.
References GET_CONDVAR_WAITERS, and wakeup_first_thread().
Referenced by Init_thread().
Definition at line 135 of file thread.c.
References delete_current_thread(), do_sleep(), GET_CONDVAR_WAITERS, sleep_call::mutex, rb_ary_push(), rb_ensure(), rb_scan_args(), rb_thread_current(), and sleep_call::timeout.
Referenced by Init_thread().
Definition at line 349 of file thread.c.
References GET_QUEUE_QUE, and rb_ary_clear().
Referenced by Init_thread().
Definition at line 337 of file thread.c.
References Qfalse, Qtrue, and queue_length().
Referenced by Init_thread().
Definition at line 212 of file thread.c.
References ary_buf_new(), QUEUE_QUE, QUEUE_WAITERS, and RSTRUCT_SET.
Referenced by Init_thread().
Definition at line 365 of file thread.c.
References len, queue_length(), and ULONG2NUM.
Referenced by Init_thread().
Definition at line 378 of file thread.c.
References len, queue_num_waiting(), and ULONG2NUM.
Referenced by Init_thread().
Definition at line 323 of file thread.c.
References queue_do_pop(), and queue_pop_should_block().
Referenced by Init_thread().
Definition at line 522 of file thread.c.
References GET_QUEUE_QUE, GET_SZQUEUE_WAITERS, rb_ary_clear(), and wakeup_all_threads().
Referenced by Init_thread().
Definition at line 401 of file thread.c.
References ary_buf_new(), max(), NUM2LONG, QUEUE_QUE, QUEUE_WAITERS, rb_eArgError, rb_raise(), RSTRUCT_SET, SZQUEUE_MAX, and SZQUEUE_WAITERS.
Referenced by Init_thread().
Definition at line 438 of file thread.c.
References diff(), GET_SZQUEUE_ULONGMAX, GET_SZQUEUE_WAITERS, max(), NIL_P(), NUM2LONG, rb_ary_shift(), rb_eArgError, rb_raise(), rb_thread_wakeup_alive(), RSTRUCT_SET, SZQUEUE_MAX, and t.
Referenced by Init_thread().
Definition at line 536 of file thread.c.
References GET_SZQUEUE_WAITERS, len, queue_num_waiting(), RARRAY_LEN, and ULONG2NUM.
Referenced by Init_thread().
Definition at line 509 of file thread.c.
References queue_pop_should_block(), and szqueue_do_pop().
Referenced by Init_thread().
Definition at line 469 of file thread.c.
References GET_SZQUEUE_ULONGMAX, GET_SZQUEUE_WAITERS, queue_delete_from_waiting(), queue_do_push(), queue_length(), rb_ary_push(), rb_ensure(), rb_thread_current(), rb_thread_sleep_deadly(), waiting_delete::th, and waiting_delete::waiting.
Referenced by Init_thread().
Definition at line 483 of file thread.c.
References GET_SZQUEUE_ULONGMAX, GET_SZQUEUE_WAITERS, queue_do_pop(), queue_length(), retval, and wakeup_first_thread().
Referenced by rb_szqueue_pop().
Definition at line 548 of file thread.c.
References PRIsVALUE, rb_eTypeError, rb_obj_class(), rb_raise(), and UNREACHABLE.
Referenced by Init_thread().
Definition at line 49 of file thread.c.
References i, RARRAY_AREF, RARRAY_LEN, rb_ary_clear(), rb_thread_wakeup_alive(), and thread.
Referenced by rb_condvar_broadcast(), and rb_szqueue_clear().
Definition at line 39 of file thread.c.
References NIL_P(), rb_ary_shift(), rb_thread_wakeup_alive(), RTEST, and thread.
Referenced by queue_do_push(), rb_condvar_signal(), and szqueue_do_pop().
|
static |
Definition at line 109 of file thread.c.
Referenced by do_sleep(), and Init_thread().