summaryrefslogtreecommitdiff
path: root/ractor.c
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2021-11-24 12:03:46 +0900
committernagachika <nagachika@ruby-lang.org>2021-11-24 12:03:46 +0900
commit7b3948750e1b1dd8cb271c0a7377b911bb3b8f1b (patch)
treeb07091327cf0ca7a163a38d9c47932be32592b71 /ractor.c
parent949af69408e44b69cc7437b58e8edbe3cd77c966 (diff)
merge revision(s) e1b03b0c2b2449a7794f4701bab8b2382eb15116,007e439fe965871c73127928f7244ebb96a86e58:
Enable VM_ASSERT in --jit CIs (#4543) --- .github/workflows/mjit.yml | 2 +- ractor.c | 6 +++--- vm_core.h | 6 +++--- vm_method.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) Do not expect ec on rb_vm_bugreport because a SEGV might happen on an MJIT worker. As you can clearly see from `if (vm && ec) {`, ec is not guaranteed to exist here. --- vm_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Diffstat (limited to 'ractor.c')
-rw-r--r--ractor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ractor.c b/ractor.c
index 7d6fec76e0..de3ab8c16f 100644
--- a/ractor.c
+++ b/ractor.c
@@ -34,7 +34,7 @@ ASSERT_ractor_unlocking(rb_ractor_t *r)
{
#if RACTOR_CHECK_MODE > 0
// GET_EC is NULL in an MJIT worker
- if (GET_EC() != NULL && r->sync.locked_by == rb_ractor_self(GET_RACTOR())) {
+ if (rb_current_execution_context(false) != NULL && r->sync.locked_by == rb_ractor_self(GET_RACTOR())) {
rb_bug("recursive ractor locking");
}
#endif
@@ -45,7 +45,7 @@ ASSERT_ractor_locking(rb_ractor_t *r)
{
#if RACTOR_CHECK_MODE > 0
// GET_EC is NULL in an MJIT worker
- if (GET_EC() != NULL && r->sync.locked_by != rb_ractor_self(GET_RACTOR())) {
+ if (rb_current_execution_context(false) != NULL && r->sync.locked_by != rb_ractor_self(GET_RACTOR())) {
rp(r->sync.locked_by);
rb_bug("ractor lock is not acquired.");
}
@@ -61,7 +61,7 @@ ractor_lock(rb_ractor_t *r, const char *file, int line)
rb_native_mutex_lock(&r->sync.lock);
#if RACTOR_CHECK_MODE > 0
- if (GET_EC() != NULL) { // GET_EC is NULL in an MJIT worker
+ if (rb_current_execution_context(false) != NULL) { // GET_EC is NULL in an MJIT worker
r->sync.locked_by = rb_ractor_self(GET_RACTOR());
}
#endif