summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-13 07:22:10 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-13 07:22:10 (GMT)
commit9e524c68b6a4d2491a967543207c77cc77a425cf (patch)
tree9ab0a07a2167203ebd5136648df6392905515f41 /thread.c
parentf830ace8a831a954db7a6aae280a530651a5b58a (diff)
thread.c: freeze masks
* thread.c (rb_thread_s_handle_interrupt, rb_uninterruptible): freeze mask hashes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index dfd2b21..1d39d16 100644
--- a/thread.c
+++ b/thread.c
@@ -1835,6 +1835,7 @@ rb_thread_s_handle_interrupt(VALUE self, VALUE mask_arg)
if (!mask) {
return rb_yield(Qnil);
}
+ OBJ_FREEZE_RAW(mask);
rb_ary_push(th->pending_interrupt_mask_stack, mask);
if (!rb_threadptr_pending_interrupt_empty_p(th)) {
th->pending_interrupt_queue_checked = 0;
@@ -5288,6 +5289,7 @@ rb_uninterruptible(VALUE (*b_proc)(ANYARGS), VALUE data)
rb_thread_t *cur_th = GET_THREAD();
rb_hash_aset(interrupt_mask, rb_cObject, sym_never);
+ OBJ_FREEZE_RAW(interrupt_mask);
rb_ary_push(cur_th->pending_interrupt_mask_stack, interrupt_mask);
return rb_ensure(b_proc, data, rb_ary_pop, cur_th->pending_interrupt_mask_stack);