summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-05 02:13:40 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-05 02:13:40 +0000
commite067a32f6256bd1e3e41d03918b828c72ecd607b (patch)
treeaee1c51de0d6ba9278ccd82661d059c06008af8e
parent1d9b5929b7ef3d5f2017a800e61240a4c9f181b4 (diff)
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@21332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog15
-rw-r--r--eval.c1
-rw-r--r--gc.c1
-rw-r--r--rubysig.h8
-rw-r--r--version.h8
5 files changed, 25 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index a9336cc..9afe0b8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+Mon Jan 5 11:12:39 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@ruby-lang.org>
+
+ * 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@ruby-lang.org>
* win32/win32.c (rb_w32_telldir): just returns loc.
diff --git a/eval.c b/eval.c
index 54a0fee..2938c70 100644
--- a/eval.c
+++ b/eval.c
@@ -10665,6 +10665,7 @@ rb_thread_schedule()
}
#endif
rb_thread_pending = 0;
+ rb_gc_finalize_deferred();
if (curr_thread == curr_thread->next
&& curr_thread->status == THREAD_RUNNABLE)
return;
diff --git a/gc.c b/gc.c
index 33f035e..00c4257 100644
--- a/gc.c
+++ b/gc.c
@@ -1147,6 +1147,7 @@ gc_sweep()
/* clear finalization list */
if (final_list) {
deferred_final_list = final_list;
+ rb_thread_pending = 1;
return;
}
free_unused_heaps();
diff --git a/rubysig.h b/rubysig.h
index f716824..3eb8778 100644
--- a/rubysig.h
+++ b/rubysig.h
@@ -78,12 +78,12 @@ RUBY_EXTERN rb_atomic_t rb_trap_pending;
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 @@ RUBY_EXTERN int rb_thread_tick;
#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();\
diff --git a/version.h b/version.h
index 89a87ed..ca2d165 100644
--- a/version.h
+++ b/version.h
@@ -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[];