diff options
-rw-r--r-- | ractor.c | 4 | ||||
-rw-r--r-- | ractor_core.h | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -74,7 +74,9 @@ static void ractor_lock_self(rb_ractor_t *cr, const char *file, int line) { VM_ASSERT(cr == GET_RACTOR()); +#if RACTOR_CHECK_MODE > 0 VM_ASSERT(cr->sync.locked_by != cr->pub.self); +#endif ractor_lock(cr, file, line); } @@ -94,7 +96,9 @@ static void ractor_unlock_self(rb_ractor_t *cr, const char *file, int line) { VM_ASSERT(cr == GET_RACTOR()); +#if RACTOR_CHECK_MODE > 0 VM_ASSERT(cr->sync.locked_by == cr->pub.self); +#endif ractor_unlock(cr, file, line); } diff --git a/ractor_core.h b/ractor_core.h index 412971decf..a065f5f809 100644 --- a/ractor_core.h +++ b/ractor_core.h @@ -5,7 +5,7 @@ #include "vm_debug.h" #ifndef RACTOR_CHECK_MODE -#define RACTOR_CHECK_MODE (0 || VM_CHECK_MODE || RUBY_DEBUG) +#define RACTOR_CHECK_MODE (VM_CHECK_MODE || RUBY_DEBUG) && (SIZEOF_UINT64_T == SIZEOF_VALUE) #endif enum rb_ractor_basket_type { |