mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
44af023d44
commit
13d62659ce
1 changed files with 2 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue