[前][次][番号順一覧][スレッド一覧]

ruby-changes:46213

From: nobu <ko1@a...>
Date: Wed, 12 Apr 2017 23:47:55 +0900 (JST)
Subject: [ruby-changes:46213] nobu:r58328 (trunk): thread.c: during GC for thread

nobu	2017-04-12 23:47:50 +0900 (Wed, 12 Apr 2017)

  New Revision: 58328

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58328

  Log:
    thread.c: during GC for thread
    
    * thread.c (ruby_thread_stack_overflow): check if the given thread
      is during GC.

  Modified files:
    trunk/gc.c
    trunk/gc.h
    trunk/thread.c
Index: thread.c
===================================================================
--- thread.c	(revision 58327)
+++ thread.c	(revision 58328)
@@ -2171,7 +2171,7 @@ ruby_thread_stack_overflow(rb_thread_t * https://github.com/ruby/ruby/blob/trunk/thread.c#L2171
 {
     th->raised_flag = 0;
 #ifdef USE_SIGALTSTACK
-    if (!rb_during_gc()) {
+    if (!rb_threadptr_during_gc(th)) {
 	rb_exc_raise(sysstack_error);
     }
 #endif
Index: gc.c
===================================================================
--- gc.c	(revision 58327)
+++ gc.c	(revision 58328)
@@ -6651,6 +6651,13 @@ rb_during_gc(void) https://github.com/ruby/ruby/blob/trunk/gc.c#L6651
     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
 
 static const char *type_name(int type, VALUE obj);
Index: gc.h
===================================================================
--- gc.h	(revision 58327)
+++ gc.h	(revision 58328)
@@ -90,6 +90,9 @@ const char *rb_obj_info(VALUE obj); https://github.com/ruby/ruby/blob/trunk/gc.h#L90
 const char *rb_raw_obj_info(char *buff, const int buff_size, 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
 
 /* exports for objspace module */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]