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

ruby-changes:9791

From: shyouhei <ko1@a...>
Date: Mon, 5 Jan 2009 11:13:52 +0900 (JST)
Subject: [ruby-changes:9791] Ruby:r21332 (ruby_1_8_6): merge revision(s) 18316,18319:

shyouhei	2009-01-05 11:13:40 +0900 (Mon, 05 Jan 2009)

  New Revision: 21332

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21332

  Log:
    merge revision(s) 18316,18319:
    * rubysig.h (CHECK_INTS): gives the chance to perform to deferred
      finalizers before explicit GC.start or the process termination.
      [ruby-core:18045]
    * eval.c (rb_thread_schedule): runs deferred finalizers.
    * gc.c (gc_sweep): sets rb_thread_pending to run deferred finalizers.
    * rubysig.h (CHECK_INTS): now checks rb_thread_pending even on
      platforms where setitimer is not available.  [ruby-core:18045]

  Modified files:
    branches/ruby_1_8_6/ChangeLog
    branches/ruby_1_8_6/eval.c
    branches/ruby_1_8_6/gc.c
    branches/ruby_1_8_6/rubysig.h
    branches/ruby_1_8_6/version.h

Index: ruby_1_8_6/ChangeLog
===================================================================
--- ruby_1_8_6/ChangeLog	(revision 21331)
+++ ruby_1_8_6/ChangeLog	(revision 21332)
@@ -1,3 +1,18 @@
+Mon Jan  5 11:12:39 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* eval.c (rb_thread_schedule): runs deferred finalizers.
+
+	* gc.c (gc_sweep): sets rb_thread_pending to run deferred finalizers.
+
+	* rubysig.h (CHECK_INTS): now checks rb_thread_pending even on
+	  platforms where setitimer is not available.  [ruby-core:18045]
+
+Mon Jan  5 11:12:39 2009  Nobuyoshi Nakada  <nobu@r...>
+
+	* rubysig.h (CHECK_INTS): gives the chance to perform to deferred
+	  finalizers before explicit GC.start or the process termination.
+	  [ruby-core:18045]
+
 Sun Jan  4 04:47:57 2009  Nobuyoshi Nakada  <nobu@r...>
 
 	* win32/win32.c (rb_w32_telldir): just returns loc.
Index: ruby_1_8_6/version.h
===================================================================
--- ruby_1_8_6/version.h	(revision 21331)
+++ ruby_1_8_6/version.h	(revision 21332)
@@ -1,15 +1,15 @@
 #define RUBY_VERSION "1.8.6"
-#define RUBY_RELEASE_DATE "2009-01-04"
+#define RUBY_RELEASE_DATE "2009-01-05"
 #define RUBY_VERSION_CODE 186
-#define RUBY_RELEASE_CODE 20090104
-#define RUBY_PATCHLEVEL 289
+#define RUBY_RELEASE_CODE 20090105
+#define RUBY_PATCHLEVEL 290
 
 #define RUBY_VERSION_MAJOR 1
 #define RUBY_VERSION_MINOR 8
 #define RUBY_VERSION_TEENY 6
 #define RUBY_RELEASE_YEAR 2009
 #define RUBY_RELEASE_MONTH 1
-#define RUBY_RELEASE_DAY 4
+#define RUBY_RELEASE_DAY 5
 
 #ifdef RUBY_EXTERN
 RUBY_EXTERN const char ruby_version[];
Index: ruby_1_8_6/eval.c
===================================================================
--- ruby_1_8_6/eval.c	(revision 21331)
+++ ruby_1_8_6/eval.c	(revision 21332)
@@ -10665,6 +10665,7 @@
     }
 #endif
     rb_thread_pending = 0;
+    rb_gc_finalize_deferred();
     if (curr_thread == curr_thread->next
 	&& curr_thread->status == THREAD_RUNNABLE)
 	return;
Index: ruby_1_8_6/gc.c
===================================================================
--- ruby_1_8_6/gc.c	(revision 21331)
+++ ruby_1_8_6/gc.c	(revision 21332)
@@ -1147,6 +1147,7 @@
     /* clear finalization list */
     if (final_list) {
 	deferred_final_list = final_list;
+	rb_thread_pending = 1;
 	return;
     }
     free_unused_heaps();
Index: ruby_1_8_6/rubysig.h
===================================================================
--- ruby_1_8_6/rubysig.h	(revision 21331)
+++ ruby_1_8_6/rubysig.h	(revision 21332)
@@ -78,12 +78,12 @@
 void rb_trap_restore_mask _((void));
 
 RUBY_EXTERN int rb_thread_critical;
+RUBY_EXTERN int rb_thread_pending;
 void rb_thread_schedule _((void));
 #if defined(HAVE_SETITIMER) || defined(_THREAD_SAFE)
-RUBY_EXTERN int rb_thread_pending;
 # define CHECK_INTS do {\
     if (!(rb_prohibit_interrupt || rb_thread_critical)) {\
-        if (rb_thread_pending) rb_thread_schedule();\
+	if (rb_thread_pending) rb_thread_schedule();\
 	if (rb_trap_pending) rb_trap_exec();\
     }\
 } while (0)
@@ -93,9 +93,9 @@
 #define THREAD_TICK 500
 #define CHECK_INTS do {\
     if (!(rb_prohibit_interrupt || rb_thread_critical)) {\
-	if (rb_thread_tick-- <= 0) {\
+	if (rb_thread_pending || rb_thread_tick-- <= 0) {\
 	    rb_thread_tick = THREAD_TICK;\
-            rb_thread_schedule();\
+	    rb_thread_schedule();\
 	}\
     }\
     if (rb_trap_pending) rb_trap_exec();\

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

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