Ruby: include/ruby/internal/intern/thread.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

thread.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_THREAD_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_THREAD_H
23#include "ruby/internal/config.h"
24#include "ruby/internal/cast.h"
25#include "ruby/internal/dllexport.h"
26#include "ruby/internal/value.h"
27
28 RBIMPL_SYMBOL_EXPORT_BEGIN()
29
30struct timeval;
31
32/* thread.c */
33void rb_thread_schedule(void);
34void rb_thread_wait_fd(int);
35int rb_thread_fd_writable(int);
36void rb_thread_fd_close(int);
37int rb_thread_alone(void);
38void rb_thread_sleep(int);
39void rb_thread_sleep_forever(void);
40void rb_thread_sleep_deadly(void);
41 VALUE rb_thread_stop(void);
42 VALUE rb_thread_wakeup(VALUE);
43 VALUE rb_thread_wakeup_alive(VALUE);
44 VALUE rb_thread_run(VALUE);
45 VALUE rb_thread_kill(VALUE);
46 VALUE rb_thread_create(VALUE (*)(void *), void*);
47void rb_thread_wait_for(struct timeval);
48 VALUE rb_thread_current(void);
49 VALUE rb_thread_main(void);
50 VALUE rb_thread_local_aref(VALUE, ID);
51 VALUE rb_thread_local_aset(VALUE, ID, VALUE);
52void rb_thread_atfork(void);
53void rb_thread_atfork_before_exec(void);
54 VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
55 VALUE rb_exec_recursive_paired(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
56 VALUE rb_exec_recursive_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE);
57 VALUE rb_exec_recursive_paired_outer(VALUE(*)(VALUE, VALUE, int),VALUE,VALUE,VALUE);
58
59typedef void rb_unblock_function_t(void *);
60typedef VALUE rb_blocking_function_t(void *);
61void rb_thread_check_ints(void);
62int rb_thread_interrupted(VALUE thval);
63
64#define RUBY_UBF_IO RBIMPL_CAST((rb_unblock_function_t *)-1)
65#define RUBY_UBF_PROCESS RBIMPL_CAST((rb_unblock_function_t *)-1)
66 VALUE rb_mutex_new(void);
67 VALUE rb_mutex_locked_p(VALUE mutex);
68 VALUE rb_mutex_trylock(VALUE mutex);
69 VALUE rb_mutex_lock(VALUE mutex);
70 VALUE rb_mutex_unlock(VALUE mutex);
71 VALUE rb_mutex_sleep(VALUE self, VALUE timeout);
72 VALUE rb_mutex_synchronize(VALUE mutex, VALUE (*func)(VALUE arg), VALUE arg);
73
74 RBIMPL_SYMBOL_EXPORT_END()
75
76#endif /* RBIMPL_INTERN_THREAD_H */
cast.h
Defines RBIMPL_CAST.
dllexport.h
Tewaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
config.h
Thin wrapper to ruby/config.h.
rb_thread_wait_for
void rb_thread_wait_for(struct timeval)
Definition: thread.c:1562
rb_exec_recursive_paired
VALUE rb_exec_recursive_paired(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE, VALUE)
Definition: thread.c:5371
rb_thread_interrupted
int rb_thread_interrupted(VALUE thval)
Definition: thread.c:1594
rb_thread_wakeup_alive
VALUE rb_thread_wakeup_alive(VALUE)
Definition: thread.c:2797
rb_thread_local_aref
VALUE rb_thread_local_aref(VALUE, ID)
Definition: thread.c:3480
rb_exec_recursive_outer
VALUE rb_exec_recursive_outer(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE)
Definition: thread.c:5383
rb_mutex_new
VALUE rb_mutex_new(void)
Definition: thread_sync.c:177
rb_thread_wait_fd
void rb_thread_wait_fd(int)
Definition: thread.c:4305
rb_thread_kill
VALUE rb_thread_kill(VALUE)
Definition: thread.c:2694
rb_thread_run
VALUE rb_thread_run(VALUE)
Definition: thread.c:2835
rb_thread_main
VALUE rb_thread_main(void)
Definition: thread.c:2932
rb_thread_sleep_forever
void rb_thread_sleep_forever(void)
Definition: thread.c:1524
rb_thread_wakeup
VALUE rb_thread_wakeup(VALUE)
Definition: thread.c:2788
rb_mutex_trylock
VALUE rb_mutex_trylock(VALUE mutex)
Definition: thread_sync.c:236
rb_mutex_locked_p
VALUE rb_mutex_locked_p(VALUE mutex)
Definition: thread_sync.c:189
rb_mutex_synchronize
VALUE rb_mutex_synchronize(VALUE mutex, VALUE(*func)(VALUE arg), VALUE arg)
Definition: thread_sync.c:598
rb_thread_stop
VALUE rb_thread_stop(void)
Definition: thread.c:2844
rb_thread_create
VALUE rb_thread_create(VALUE(*)(void *), void *)
Definition: thread.c:1119
rb_exec_recursive_paired_outer
VALUE rb_exec_recursive_paired_outer(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE, VALUE)
Definition: thread.c:5395
rb_mutex_sleep
VALUE rb_mutex_sleep(VALUE self, VALUE timeout)
Definition: thread_sync.c:537
rb_unblock_function_t
void rb_unblock_function_t(void *)
Definition: thread.h:59
rb_thread_atfork_before_exec
void rb_thread_atfork_before_exec(void)
Definition: thread.c:4835
rb_thread_check_ints
void rb_thread_check_ints(void)
Definition: thread.c:1577
rb_mutex_unlock
VALUE rb_mutex_unlock(VALUE mutex)
Definition: thread_sync.c:474
rb_thread_sleep_deadly
void rb_thread_sleep_deadly(void)
Definition: thread.c:1531
rb_thread_fd_writable
int rb_thread_fd_writable(int)
Definition: thread.c:4311
rb_thread_atfork
void rb_thread_atfork(void)
Definition: thread.c:4830
rb_thread_current
VALUE rb_thread_current(void)
Definition: thread.c:2911
rb_thread_alone
int rb_thread_alone(void)
Definition: thread.c:3757
rb_thread_fd_close
void rb_thread_fd_close(int)
Definition: thread.c:2634
rb_thread_sleep
void rb_thread_sleep(int)
Definition: thread.c:1600
rb_thread_schedule
void rb_thread_schedule(void)
Definition: thread.c:1623
rb_thread_local_aset
VALUE rb_thread_local_aset(VALUE, ID, VALUE)
Definition: thread.c:3628
rb_blocking_function_t
VALUE rb_blocking_function_t(void *)
Definition: thread.h:60
rb_exec_recursive
VALUE rb_exec_recursive(VALUE(*)(VALUE, VALUE, int), VALUE, VALUE)
Definition: thread.c:5360
rb_mutex_lock
VALUE rb_mutex_lock(VALUE mutex)
Definition: thread_sync.c:402
timeval
Definition: missing.h:51
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38
ID
unsigned long ID
Definition: value.h:39