In the rb_thread_s_new() of eval.c, a volatile VALUE *pos is assigned
th->stk_pos
This volatile VALUE *pos is never subsequently accessed (before it goes out
of scope).
I suspect I'm missing some deep magic here. Does anyone know the purpose
of *pos in this context?
---- from eval.c ----
static VALUE
rb_thread_s_new(argc, argv, klass)
int argc;
VALUE *argv;
VALUE klass;
{
rb_thread_t th = rb_thread_alloc(klass);
volatile VALUE *pos;
pos = th->stk_pos; //<--- what does this accomplish?
rb_obj_call_init(th->thread, argc, argv);
if (th->stk_pos == 0) {
rb_raise(rb_eThreadError, "uninitialized thread - check `%s#initialize'",
rb_class2name(klass));
}
return th->thread;
}
--
View this message in context: http://www.nabble.com/What-does-volatile-assignment-of-*pos-in-rb_thread_s_new%28%29-do--tp14354891p14354891.html
Sent from the ruby-core mailing list archive at Nabble.com.