summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-24 07:50:36 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-24 07:50:36 +0000
commitc37d8b287e63815e09c82f4fb9bc63dca6193489 (patch)
tree1eb82af31091f1b8288b6880c2e836f1403c56ff
parent1a890d82c387d2902c22c9a5b86007281cfe86d2 (diff)
* gc.c (run_final): backout unnecessary modifies.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--gc.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/gc.c b/gc.c
index cefe86fa4a6..deb7905b808 100644
--- a/gc.c
+++ b/gc.c
@@ -1533,29 +1533,22 @@ run_final(obj)
VALUE obj;
{
long i;
- int status, critical_save;
+ int status, critical_save = rb_thread_critical;
VALUE args[2], table;
+ rb_thread_critical = Qtrue;
args[1] = rb_ary_new3(1, rb_obj_id(obj)); /* make obj into id */
for (i=0; i<RARRAY(finalizers)->len; i++) {
args[0] = RARRAY(finalizers)->ptr[i];
- critical_save = rb_thread_critical;
- rb_thread_critical = Qtrue;
rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status);
- rb_thread_critical = critical_save;
- CHECK_INTS;
}
- CHECK_INTS;
if (finalizer_table && st_delete(finalizer_table, &obj, &table)) {
for (i=0; i<RARRAY(table)->len; i++) {
args[0] = RARRAY(table)->ptr[i];
- critical_save = rb_thread_critical;
- rb_thread_critical = Qtrue;
rb_protect((VALUE(*)_((VALUE)))run_single_final, (VALUE)args, &status);
- rb_thread_critical = critical_save;
- CHECK_INTS;
}
}
+ rb_thread_critical = critical_save;
}
void