summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Valentine-House <[email protected]>2024-11-23 09:28:17 +0000
committerMatt Valentine-House <[email protected]>2024-11-25 13:05:23 +0000
commitf127bcb8294fd417c253dd7acab3ff3b9f0bf555 (patch)
tree35f8f5c7b17d8eb8ecb98a8b1b5f806fc1e80ad7
parent551be8219e8a4c5b0021716b047976d66feb3048 (diff)
define rb_current_ec_set in all cases
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12149
-rw-r--r--gc.c8
-rw-r--r--ractor_core.h9
2 files changed, 3 insertions, 14 deletions
diff --git a/gc.c b/gc.c
index b2afd55705..4a29b4e7af 100644
--- a/gc.c
+++ b/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
diff --git a/ractor_core.h b/ractor_core.h
index c5ca883d31..82fc7047e5 100644
--- a/ractor_core.h
+++ b/ractor_core.h
@@ -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