зеркало из https://github.com/github/ruby.git
thread.c: during GC for thread
* thread.c (ruby_thread_stack_overflow): check if the given thread is during GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
796e995007
Коммит
a1caed95cb
7
gc.c
7
gc.c
|
@ -6651,6 +6651,13 @@ rb_during_gc(void)
|
||||||
return during_gc;
|
return during_gc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
rb_threadptr_during_gc(rb_thread_t *th)
|
||||||
|
{
|
||||||
|
rb_objspace_t *objspace = rb_objspace_of(th->vm);
|
||||||
|
return during_gc;
|
||||||
|
}
|
||||||
|
|
||||||
#if RGENGC_PROFILE >= 2
|
#if RGENGC_PROFILE >= 2
|
||||||
|
|
||||||
static const char *type_name(int type, VALUE obj);
|
static const char *type_name(int type, VALUE obj);
|
||||||
|
|
3
gc.h
3
gc.h
|
@ -90,6 +90,9 @@ const char *rb_obj_info(VALUE obj);
|
||||||
const char *rb_raw_obj_info(char *buff, const int buff_size, VALUE obj);
|
const char *rb_raw_obj_info(char *buff, const int buff_size, VALUE obj);
|
||||||
void rb_obj_info_dump(VALUE obj);
|
void rb_obj_info_dump(VALUE obj);
|
||||||
|
|
||||||
|
struct rb_thread_struct;
|
||||||
|
int rb_threadptr_during_gc(struct rb_thread_struct *th);
|
||||||
|
|
||||||
RUBY_SYMBOL_EXPORT_BEGIN
|
RUBY_SYMBOL_EXPORT_BEGIN
|
||||||
|
|
||||||
/* exports for objspace module */
|
/* exports for objspace module */
|
||||||
|
|
2
thread.c
2
thread.c
|
@ -2171,7 +2171,7 @@ ruby_thread_stack_overflow(rb_thread_t *th)
|
||||||
{
|
{
|
||||||
th->raised_flag = 0;
|
th->raised_flag = 0;
|
||||||
#ifdef USE_SIGALTSTACK
|
#ifdef USE_SIGALTSTACK
|
||||||
if (!rb_during_gc()) {
|
if (!rb_threadptr_during_gc(th)) {
|
||||||
rb_exc_raise(sysstack_error);
|
rb_exc_raise(sysstack_error);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Загрузка…
Ссылка в новой задаче