summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-13 09:04:29 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-10-13 09:04:29 +0000
commitc180eabf8f0c818ca1f8fcdca424588b8daf5bb3 (patch)
tree055b225805ed5eff13dd64e4dfedc92ab51729e9 /gc.c
parent9f3f24e22a8c4916b23fe17d8b7f5f0caa2ced75 (diff)
* gc.c (rb_gc_finalize_deferred, rb_objspace_call_finalizer):
should use ATOMIC_EXCHANGE() to check the previous value. [ruby-dev:44596] [Bug #5439] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33460 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 8840771c2f..ccd74412bd 100644
--- a/gc.c
+++ b/gc.c
@@ -2977,7 +2977,7 @@ void
rb_gc_finalize_deferred(void)
{
rb_objspace_t *objspace = &rb_objspace;
- if (ATOMIC_SET(finalizing, 1)) return;
+ if (ATOMIC_EXCHANGE(finalizing, 1)) return;
finalize_deferred(objspace);
ATOMIC_SET(finalizing, 0);
}
@@ -3031,7 +3031,7 @@ rb_objspace_call_finalizer(rb_objspace_t *objspace)
/* run finalizers */
gc_clear_mark_on_sweep_slots(objspace);
- if (ATOMIC_SET(finalizing, 1)) return;
+ if (ATOMIC_EXCHANGE(finalizing, 1)) return;
do {
/* XXX: this loop will make no sense */