diff options
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -1798,23 +1798,24 @@ rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd) rb_execution_context_t * volatile ec = GET_EC(); volatile int saved_errno = 0; enum ruby_tag_type state; - COROUTINE_STACK_LOCAL(struct waiting_fd, wfd); - wfd->fd = fd; - wfd->th = rb_ec_thread_ptr(ec); + struct waiting_fd waiting_fd = { + .fd = fd, + .th = rb_ec_thread_ptr(ec) + }; RB_VM_LOCK_ENTER(); { - list_add(&rb_ec_vm_ptr(ec)->waiting_fds, &wfd->wfd_node); + list_add(&rb_ec_vm_ptr(ec)->waiting_fds, &waiting_fd.wfd_node); } RB_VM_LOCK_LEAVE(); EC_PUSH_TAG(ec); if ((state = EC_EXEC_TAG()) == TAG_NONE) { - BLOCKING_REGION(wfd->th, { - val = func(data1); - saved_errno = errno; - }, ubf_select, wfd->th, FALSE); + BLOCKING_REGION(waiting_fd.th, { + val = func(data1); + saved_errno = errno; + }, ubf_select, waiting_fd.th, FALSE); } EC_POP_TAG(); @@ -1824,13 +1825,12 @@ rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd) */ RB_VM_LOCK_ENTER(); { - list_del(&wfd->wfd_node); - COROUTINE_STACK_FREE(wfd); + list_del(&waiting_fd.wfd_node); } RB_VM_LOCK_LEAVE(); if (state) { - EC_JUMP_TAG(ec, state); + EC_JUMP_TAG(ec, state); } /* TODO: check func() */ RUBY_VM_CHECK_INTS_BLOCKING(ec); |