cleanup by RUBY_DEBUG_LOG2
and VM_ASSERT
This commit is contained in:
parent
d270d984bd
commit
37ccf91bfb
Notes:
git
2022-05-24 02:23:12 +09:00
@ -256,8 +256,10 @@ rb_ractor_thread_switch(rb_ractor_t *cr, rb_thread_t *th)
|
|||||||
VM_ASSERT(cr == GET_RACTOR());
|
VM_ASSERT(cr == GET_RACTOR());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define rb_ractor_set_current_ec(cr, ec) rb_ractor_set_current_ec_(cr, ec, __FILE__, __LINE__)
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
rb_ractor_set_current_ec(rb_ractor_t *cr, rb_execution_context_t *ec)
|
rb_ractor_set_current_ec_(rb_ractor_t *cr, rb_execution_context_t *ec, const char *file, int line)
|
||||||
{
|
{
|
||||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
@ -268,17 +270,8 @@ rb_ractor_set_current_ec(rb_ractor_t *cr, rb_execution_context_t *ec)
|
|||||||
#else
|
#else
|
||||||
native_tls_set(ruby_current_ec_key, ec);
|
native_tls_set(ruby_current_ec_key, ec);
|
||||||
#endif
|
#endif
|
||||||
|
RUBY_DEBUG_LOG2(file, line, "ec:%p->%p", cr->threads.running_ec, ec);
|
||||||
if (cr->threads.running_ec != ec) {
|
VM_ASSERT(cr->threads.running_ec != ec);
|
||||||
if (0) {
|
|
||||||
ruby_debug_printf("rb_ractor_set_current_ec ec:%p->%p\n",
|
|
||||||
(void *)cr->threads.running_ec, (void *)ec);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
VM_ASSERT(0); // should be different
|
|
||||||
}
|
|
||||||
|
|
||||||
cr->threads.running_ec = ec;
|
cr->threads.running_ec = ec;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user