aboutsummaryrefslogtreecommitdiffstats
path: root/thread_sync.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-30 02:55:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-04-30 02:55:18 +0000
commit4876c0ee1aa582f725a5c161d7672a140b4f46cb (patch)
treeeb3c4100d6aa752daf07e8b56841b5158de8e546 /thread_sync.c
parent749945c46536d600f1874ed3c8a290d3ae386278 (diff)
downloadruby-4876c0ee1aa582f725a5c161d7672a140b4f46cb.tar.gz
thread_sync.c: define global constants always
* thread_sync.c (ALIAS_GLOBAL_CONST): define global constant aliases unconditionally. same constants are not defined at this time. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_sync.c')
-rw-r--r--thread_sync.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/thread_sync.c b/thread_sync.c
index 9de9c32965..ed0daa95d3 100644
--- a/thread_sync.c
+++ b/thread_sync.c
@@ -1304,12 +1304,8 @@ Init_thread_sync(void)
rb_define_method(rb_cConditionVariable, "signal", rb_condvar_signal, 0);
rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0);
-#define ALIAS_GLOBAL_CONST(name) do { \
- ID id = rb_intern_const(#name); \
- if (!rb_const_defined_at(rb_cObject, id)) { \
- rb_const_set(rb_cObject, id, rb_c##name); \
- } \
- } while (0)
+#define ALIAS_GLOBAL_CONST(name) \
+ rb_define_const(rb_cObject, #name, rb_c##name)
ALIAS_GLOBAL_CONST(Mutex);
ALIAS_GLOBAL_CONST(Queue);