mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
altstack is native thread's attr
Move th->altstack to th->nt->altstack.
This commit is contained in:
parent
78785fb990
commit
08cee2bf80
Notes:
git
2022-05-24 17:51:08 +09:00
3 changed files with 9 additions and 9 deletions
|
@ -1052,7 +1052,7 @@ static void *
|
|||
thread_start_func_1(void *th_ptr)
|
||||
{
|
||||
rb_thread_t *th = th_ptr;
|
||||
RB_ALTSTACK_INIT(void *altstack, th->altstack);
|
||||
RB_ALTSTACK_INIT(void *altstack, th->nt->altstack);
|
||||
#if USE_THREAD_CACHE
|
||||
thread_start:
|
||||
#endif
|
||||
|
@ -1208,7 +1208,7 @@ native_thread_create(rb_thread_t *th)
|
|||
const size_t space = space_size(stack_size);
|
||||
|
||||
#ifdef USE_SIGALTSTACK
|
||||
th->altstack = rb_allocate_sigaltstack();
|
||||
th->nt->altstack = rb_allocate_sigaltstack();
|
||||
#endif
|
||||
th->ec->machine.stack_maxsize = stack_size - space;
|
||||
|
||||
|
|
|
@ -50,6 +50,10 @@ struct rb_native_thread {
|
|||
rb_nativethread_cond_t intr; /* th->interrupt_lock */
|
||||
rb_nativethread_cond_t readyq; /* use sched->lock */
|
||||
} cond;
|
||||
|
||||
#ifdef USE_SIGALTSTACK
|
||||
void *altstack;
|
||||
#endif
|
||||
};
|
||||
|
||||
#undef except
|
||||
|
|
10
vm_core.h
10
vm_core.h
|
@ -101,9 +101,6 @@ extern int ruby_assert_critical_section_entered;
|
|||
#include "vm_opts.h"
|
||||
|
||||
#include "ruby/thread_native.h"
|
||||
#include THREAD_IMPL_H
|
||||
|
||||
#define RUBY_VM_THREAD_MODEL 2
|
||||
|
||||
/*
|
||||
* implementation selector of get_insn_info algorithm
|
||||
|
@ -162,6 +159,9 @@ void *rb_register_sigaltstack(void *);
|
|||
# define RB_ALTSTACK(var) (0)
|
||||
#endif
|
||||
|
||||
#include THREAD_IMPL_H
|
||||
#define RUBY_VM_THREAD_MODEL 2
|
||||
|
||||
/*****************/
|
||||
/* configuration */
|
||||
/*****************/
|
||||
|
@ -1072,10 +1072,6 @@ typedef struct rb_thread_struct {
|
|||
VALUE name;
|
||||
|
||||
struct rb_ext_config ext_config;
|
||||
|
||||
#ifdef USE_SIGALTSTACK
|
||||
void *altstack;
|
||||
#endif
|
||||
} rb_thread_t;
|
||||
|
||||
static inline unsigned int
|
||||
|
|
Loading…
Reference in a new issue