Ruby
2.5.0dev(2017-10-22revision60238)
|
#include "ccan/list/list.h"
Go to the source code of this file.
Data Structures | |
struct | sync_waiter |
struct | rb_mutex_struct |
struct | queue_waiter |
struct | rb_condvar |
struct | sleep_call |
Macros | |
#define | MUTEX_ALLOW_TRAP FL_USER1 |
#define | GetMutexPtr(obj, tobj) TypedData_Get_Struct((obj), rb_mutex_t, &mutex_data_type, (tobj)) |
#define | mutex_mark NULL |
#define | queue_waitq(q) UNALIGNED_MEMBER_PTR(q, waitq) |
#define | szqueue_waitq(sq) UNALIGNED_MEMBER_PTR(sq, q.waitq) |
#define | szqueue_pushq(sq) UNALIGNED_MEMBER_PTR(sq, pushq) |
#define | QUEUE_CLOSED FL_USER5 |
#define | ALIAS_GLOBAL_CONST(name) alias_global_const(#name, rb_c##name) |
Typedefs | |
typedef struct rb_mutex_struct | rb_mutex_t |
Functions | |
VALUE | rb_obj_is_mutex (VALUE obj) |
VALUE | rb_mutex_new (void) |
VALUE | rb_mutex_locked_p (VALUE self) |
VALUE | rb_mutex_trylock (VALUE self) |
VALUE | rb_mutex_lock (VALUE self) |
VALUE | rb_mutex_owned_p (VALUE self) |
VALUE | rb_mutex_unlock (VALUE self) |
VALUE | rb_mutex_sleep (VALUE self, VALUE timeout) |
VALUE | rb_mutex_synchronize (VALUE mutex, VALUE(*func)(VALUE arg), VALUE arg) |
void | rb_mutex_allow_trap (VALUE self, int val) |
PACKED_STRUCT_UNALIGNED (struct rb_queue { struct list_head waitq;const VALUE que;int num_waiting;}) | |
PACKED_STRUCT_UNALIGNED (struct rb_szqueue { struct rb_queue q;int num_waiting_push;struct list_head pushq;long max;}) | |
#define GetMutexPtr | ( | obj, | |
tobj | |||
) | TypedData_Get_Struct((obj), rb_mutex_t, &mutex_data_type, (tobj)) |
Definition at line 84 of file thread_sync.c.
Referenced by rb_mutex_lock(), rb_mutex_locked_p(), rb_mutex_owned_p(), rb_mutex_trylock(), rb_mutex_unlock(), and rb_thread_shield_wait().
#define MUTEX_ALLOW_TRAP FL_USER1 |
Definition at line 13 of file thread_sync.c.
Referenced by rb_mutex_allow_trap(), and rb_mutex_lock().
#define mutex_mark NULL |
Definition at line 87 of file thread_sync.c.
#define QUEUE_CLOSED FL_USER5 |
Definition at line 580 of file thread_sync.c.
#define queue_waitq | ( | q | ) | UNALIGNED_MEMBER_PTR(q, waitq) |
Definition at line 523 of file thread_sync.c.
#define szqueue_pushq | ( | sq | ) | UNALIGNED_MEMBER_PTR(sq, pushq) |
Definition at line 531 of file thread_sync.c.
#define szqueue_waitq | ( | sq | ) | UNALIGNED_MEMBER_PTR(sq, q.waitq) |
Definition at line 530 of file thread_sync.c.
typedef struct rb_mutex_struct rb_mutex_t |
PACKED_STRUCT_UNALIGNED | ( | struct rb_queue { struct list_head waitq;const VALUE que;int num_waiting;} | ) |
PACKED_STRUCT_UNALIGNED | ( | struct rb_szqueue { struct rb_queue q;int num_waiting_push;struct list_head pushq;long max;} | ) |
void rb_mutex_allow_trap | ( | VALUE | self, |
int | val | ||
) |
Definition at line 511 of file thread_sync.c.
References Check_TypedStruct, FL_SET_RAW, FL_UNSET_RAW, and MUTEX_ALLOW_TRAP.
Definition at line 232 of file thread_sync.c.
References FL_TEST_RAW, GET_THREAD, GetMutexPtr, rb_thread_struct::interrupt_mask, rb_thread_struct::locking_mutex, MUTEX_ALLOW_TRAP, Qfalse, rb_eThreadError, rb_mutex_trylock(), rb_raise(), rb_vm_struct::sleeper, rb_thread_struct::status, sync_waiter::th, rb_mutex_struct::th, THREAD_STOPPED_FOREVER, TRAP_INTERRUPT_MASK, and rb_thread_struct::vm.
Referenced by rb_mutex_synchronize().
Definition at line 173 of file thread_sync.c.
References GetMutexPtr, Qfalse, Qtrue, and rb_mutex_struct::th.
VALUE rb_mutex_new | ( | void | ) |
Definition at line 161 of file thread_sync.c.
Definition at line 306 of file thread_sync.c.
References GET_THREAD, GetMutexPtr, Qfalse, Qtrue, and rb_mutex_struct::th.
Definition at line 436 of file thread_sync.c.
References NIL_P, rb_ensure(), rb_mutex_unlock(), and rb_time_interval().
Definition at line 488 of file thread_sync.c.
References rb_ensure(), rb_mutex_lock(), and rb_mutex_unlock().
Definition at line 200 of file thread_sync.c.
References GET_THREAD, GetMutexPtr, Qfalse, Qtrue, sync_waiter::th, and rb_mutex_struct::th.
Referenced by rb_mutex_lock().
Definition at line 370 of file thread_sync.c.
References err, and GetMutexPtr.
Referenced by rb_mutex_sleep(), and rb_mutex_synchronize().
Definition at line 127 of file thread_sync.c.
References Qfalse, Qtrue, and rb_typeddata_is_kind_of().