Skip to content

@shirosaki /thread_pthread.patch
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Set stack_start of rb_thread_t in ruby_init_stack()
diff --git a/thread_pthread.c b/thread_pthread.c
index eb98024..30ca276 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -45,6 +45,7 @@ static void native_cond_wait(rb_thread_cond_t *cond, pthread_mutex_t *mutex);
static void native_cond_initialize(rb_thread_cond_t *cond, int flags);
static void native_cond_destroy(rb_thread_cond_t *cond);
static void rb_thread_wakeup_timer_thread_low(void);
+static int native_thread_init_stack(rb_thread_t *th);
static pthread_t timer_thread_id;
#define RB_CONDATTR_CLOCK_MONOTONIC 1
@@ -690,6 +691,12 @@ ruby_init_stack(volatile VALUE *addr
native_main_thread.stack_maxsize = 0; /* unknown */
}
}
+ {
+ rb_thread_t *th = GET_THREAD();
+ if (th && pthread_equal(th->thread_id, native_main_thread.id)) {
+ native_thread_init_stack(th);
+ }
+ }
}
#define CHECK_ERR(expr) \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.