aboutsummaryrefslogtreecommitdiffstats
path: root/thread_pthread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread_pthread.c')
-rw-r--r--thread_pthread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread_pthread.c b/thread_pthread.c
index 29284ff0f9..b9ac63f298 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -950,7 +950,7 @@ static void *
thread_start_func_1(void *th_ptr)
{
rb_thread_t *th = th_ptr;
- RB_ALTSTACK_INIT(void *altstack);
+ RB_ALTSTACK_INIT(void *altstack, th->altstack);
#if USE_THREAD_CACHE
thread_start:
#endif
@@ -1099,6 +1099,9 @@ native_thread_create(rb_thread_t *th)
const size_t stack_size = th->vm->default_params.thread_machine_stack_size + th->vm->default_params.thread_vm_stack_size;
const size_t space = space_size(stack_size);
+#ifdef USE_SIGALTSTACK
+ th->altstack = rb_allocate_sigaltstack();
+#endif
th->ec->machine.stack_maxsize = stack_size - space;
CHECK_ERR(pthread_attr_init(&attr));