summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-07 23:27:51 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-12-07 23:27:51 +0000
commit472959f9c20e7aff1776312d6c8e2236a52e29a7 (patch)
treede3ac74b5f70b9251972088215a294d7e6fb3ba8 /thread.c
parente8914fb351bfcd7ff198feac208c55d4bc396dbd (diff)
Add clang volatile fixes from FreeBSD and NetBSD.
Use volatile instead of optnone to avoid optimization which causes segmentation faults. Patch by Dimitry Andric. [ruby-core:78531] [Bug #13014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index 1dbb70d2d7..70a438c3b9 100644
--- a/thread.c
+++ b/thread.c
@@ -466,8 +466,8 @@ rb_threadptr_unlock_all_locking_mutexes(rb_thread_t *th)
void
rb_thread_terminate_all(void)
{
- rb_thread_t *th = GET_THREAD(); /* main thread */
- rb_vm_t *vm = th->vm;
+ rb_thread_t *volatile th = GET_THREAD(); /* main thread */
+ rb_vm_t *volatile vm = th->vm;
volatile int sleeping = 0;
if (vm->main_thread != th) {