зеркало из https://github.com/github/ruby.git
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:
Родитель
44af023d44
Коммит
13d62659ce
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче