aboutsummaryrefslogtreecommitdiffstats
path: root/vm_sync.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-09-04 05:51:55 +0900
committerKoichi Sasada <ko1@atdot.net>2020-09-04 14:18:48 +0900
commit3b0bcaf2872e5ab6d2475e9cd6dd5c374d93ae0b (patch)
treebec58277c5c1efe374236f8438661ad633740d13 /vm_sync.h
parent169b1d1aca0c26d38f8bbd25ecaf5fdb8015f5cf (diff)
downloadruby-3b0bcaf2872e5ab6d2475e9cd6dd5c374d93ae0b.tar.gz
check multi_ractor mode at main_p
rb_ractor_main_p() need to access to the ractor pointer in TLS. However it is slow operation so that we need to skip this check if it is not multi-ractor mode (!ruby_multi_ractor). This performance regression is pointed at https://bugs.ruby-lang.org/issues/17100#note-27
Diffstat (limited to 'vm_sync.h')
-rw-r--r--vm_sync.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/vm_sync.h b/vm_sync.h
index e9cc274bb8..f601143416 100644
--- a/vm_sync.h
+++ b/vm_sync.h
@@ -4,6 +4,7 @@
#include "vm_core.h"
#include "vm_debug.h"
+#include "ractor_pub.h"
#if USE_RUBY_DEBUG_LOG
#define LOCATION_ARGS const char *file, int line
@@ -26,8 +27,6 @@ void rb_vm_barrier(void);
void rb_vm_cond_wait(rb_vm_t *vm, rb_nativethread_cond_t *cond);
void rb_vm_cond_timedwait(rb_vm_t *vm, rb_nativethread_cond_t *cond, unsigned long msec);
-extern bool ruby_multi_ractor;
-
static inline bool
rb_multi_ractor_p(void)
{