summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 936360d5b6..d4916016c5 100644
--- a/thread.c
+++ b/thread.c
@@ -1974,11 +1974,12 @@ rb_thread_atfork(void)
{
rb_thread_t *th = GET_THREAD();
rb_vm_t *vm = th->vm;
+ volatile VALUE thval = th->self;
vm->main_thread = th;
st_free_table(vm->living_threads);
vm->living_threads = st_init_numtable();
- st_insert(vm->living_threads, th->self, (st_data_t) th->thread_id);
+ st_insert(vm->living_threads, thval, (st_data_t) th->thread_id);
}
struct thgroup {