define rb_current_ec_set in all cases
This commit is contained in:
parent
551be8219e
commit
f127bcb829
Notes:
git
2024-11-25 13:05:40 +00:00
8
gc.c
8
gc.c
@ -200,11 +200,7 @@ rb_gc_worker_thread_set_vm_context(struct rb_gc_vm_context *context)
|
||||
GC_ASSERT(rb_current_execution_context(false) == NULL);
|
||||
|
||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||
# ifdef __APPLE__
|
||||
rb_current_ec_set(context->ec);
|
||||
# else
|
||||
ruby_current_ec = context->ec;
|
||||
# endif
|
||||
#else
|
||||
native_tls_set(ruby_current_ec_key, context->ec);
|
||||
#endif
|
||||
@ -218,11 +214,7 @@ rb_gc_worker_thread_unset_vm_context(struct rb_gc_vm_context *context)
|
||||
GC_ASSERT(rb_current_execution_context(true) == context->ec);
|
||||
|
||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||
# ifdef __APPLE__
|
||||
rb_current_ec_set(NULL);
|
||||
# else
|
||||
ruby_current_ec = NULL;
|
||||
# endif
|
||||
#else
|
||||
native_tls_set(ruby_current_ec_key, NULL);
|
||||
#endif
|
||||
|
@ -306,18 +306,15 @@ rb_ractor_thread_switch(rb_ractor_t *cr, rb_thread_t *th)
|
||||
}
|
||||
|
||||
#define rb_ractor_set_current_ec(cr, ec) rb_ractor_set_current_ec_(cr, ec, __FILE__, __LINE__)
|
||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||
void rb_current_ec_set(rb_execution_context_t *ec);
|
||||
#endif
|
||||
|
||||
static inline void
|
||||
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 __APPLE__
|
||||
rb_current_ec_set(ec);
|
||||
# else
|
||||
ruby_current_ec = ec;
|
||||
# endif
|
||||
|
||||
#else
|
||||
native_tls_set(ruby_current_ec_key, ec);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user