summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-23 07:25:52 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-06-23 07:25:52 +0000
commit2108e55c0b8fd31cec8968868a56876a22f3104c (patch)
tree479ee29eaecd26251ee6c4a783ad9c52db7f541f /thread.c
parent1d248f04294bf5916f54168ee28cc42471132c54 (diff)
use "enum ruby_tag_type" and TAG_NONE.
Return value of EXEC_TAG() is saved by "int state". Instead of "int", use "enum ruby_tag_type". First EXEC_TAG() value should be 0, so that define TAG_NONE (= 0) and use it. Some code used "status" instead of "state". To make them clear, rename them to state. We can change variable name from "state" to "tag_state", but this ticket doesn't contain it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59155 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/thread.c b/thread.c
index 80c48666e8..57044f2154 100644
--- a/thread.c
+++ b/thread.c
@@ -490,7 +490,7 @@ rb_thread_terminate_all(void)
rb_threadptr_unlock_all_locking_mutexes(th);
TH_PUSH_TAG(th);
- if (TH_EXEC_TAG() == 0) {
+ if (TH_EXEC_TAG() == TAG_NONE) {
retry:
thread_debug("rb_thread_terminate_all (main thread: %p)\n", (void *)th);
terminate_all(vm, th);
@@ -597,7 +597,7 @@ thread_do_start(rb_thread_t *th, VALUE args)
static int
thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_start)
{
- int state;
+ enum ruby_tag_type state;
VALUE args = th->first_args;
rb_thread_list_t *join_list;
rb_thread_t *main_th;
@@ -625,7 +625,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
rb_thread_set_current(th);
TH_PUSH_TAG(th);
- if ((state = EXEC_TAG()) == 0) {
+ if ((state = EXEC_TAG()) == TAG_NONE) {
SAVE_ROOT_JMPBUF(th, thread_do_start(th, args));
}
else {
@@ -1444,7 +1444,7 @@ rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd)
rb_vm_t *vm = GET_VM();
rb_thread_t *th = GET_THREAD();
volatile int saved_errno = 0;
- int state;
+ enum ruby_tag_type state;
struct waiting_fd wfd;
wfd.fd = fd;
@@ -1452,7 +1452,7 @@ rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd)
list_add(&vm->waiting_fds, &wfd.wfd_node);
TH_PUSH_TAG(th);
- if ((state = EXEC_TAG()) == 0) {
+ if ((state = EXEC_TAG()) == TAG_NONE) {
BLOCKING_REGION({
val = func(data1);
saved_errno = errno;
@@ -1865,7 +1865,7 @@ rb_thread_s_handle_interrupt(VALUE self, VALUE mask_arg)
VALUE mask;
rb_thread_t *th = GET_THREAD();
volatile VALUE r = Qnil;
- int state;
+ enum ruby_tag_type state;
if (!rb_block_given_p()) {
rb_raise(rb_eArgError, "block is needed.");
@@ -1885,7 +1885,7 @@ rb_thread_s_handle_interrupt(VALUE self, VALUE mask_arg)
}
TH_PUSH_TAG(th);
- if ((state = EXEC_TAG()) == 0) {
+ if ((state = EXEC_TAG()) == TAG_NONE) {
r = rb_yield(Qnil);
}
TH_POP_TAG();
@@ -4689,7 +4689,7 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE
return (*func)(obj, arg, TRUE);
}
else {
- int state;
+ enum ruby_tag_type state;
p.func = func;
@@ -4708,7 +4708,7 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE
volatile VALUE ret = Qundef;
recursive_push(p.list, p.objid, p.pairid);
PUSH_TAG();
- if ((state = EXEC_TAG()) == 0) {
+ if ((state = EXEC_TAG()) == TAG_NONE) {
ret = (*func)(obj, arg, FALSE);
}
POP_TAG();