public
Created

Set stack_start of rb_thread_t in ruby_init_stack()

  • Download Gist
thread_pthread.patch
Diff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
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) \

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.