summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-13 21:34:20 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-13 21:34:20 +0000
commit48b6bd74e2febde095ac85d818e94c0e58677647 (patch)
tree73348a2cf6a66b1f1d6620b93109b7f7dfb0ca03 /internal.h
parent4d2e0fffb08f0418fa6995be2e15aad7ee11b048 (diff)
thread_pthread.c: eliminate timer thread by restructuring GVL
This reverts commit 194a6a2c68e9c8a3536b24db18ceac87535a6051 (r64203). Race conditions which caused the original reversion will be fixed in the subsequent commit. [ruby-core:88360] [Misc #14937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 072c5ce158..fbac11fe9e 100644
--- a/internal.h
+++ b/internal.h
@@ -77,6 +77,9 @@ extern "C" {
# define __has_extension __has_feature
#endif
+/* Prevent compiler from reordering access */
+#define ACCESS_ONCE(type,x) (*((volatile type *)&(x)))
+
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
# define STATIC_ASSERT(name, expr) _Static_assert(expr, #name ": " #expr)
#elif GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)