summaryrefslogtreecommitdiff
path: root/vm_sync.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm_sync.h')
-rw-r--r--vm_sync.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/vm_sync.h b/vm_sync.h
index 9833f5aecf..8244b6173e 100644
--- a/vm_sync.h
+++ b/vm_sync.h
@@ -19,6 +19,9 @@
bool rb_vm_locked_p(void);
void rb_vm_lock_body(LOCATION_ARGS);
void rb_vm_unlock_body(LOCATION_ARGS);
+
+struct rb_ractor_struct;
+void rb_vm_lock_enter_body_cr(struct rb_ractor_struct *cr, unsigned int *lev APPEND_LOCATION_ARGS);
void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS);
void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS);
void rb_vm_barrier(void);
@@ -72,15 +75,29 @@ static inline void
rb_vm_lock_leave(unsigned int *lev, const char *file, int line)
{
if (rb_multi_ractor_p()) {
- rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS);
+ rb_vm_lock_leave_body(lev APPEND_LOCATION_PARAMS);
}
}
+static inline void
+rb_vm_lock_enter_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
+{
+ rb_vm_lock_enter_body_cr(cr, levp APPEND_LOCATION_PARAMS);
+}
+
+static inline void
+rb_vm_lock_leave_cr(struct rb_ractor_struct *cr, unsigned int *levp, const char *file, int line)
+{
+ rb_vm_lock_leave_body(levp APPEND_LOCATION_PARAMS);
+}
+
#define RB_VM_LOCKED_P() rb_vm_locked_p()
#define RB_VM_LOCK() rb_vm_lock(__FILE__, __LINE__)
#define RB_VM_UNLOCK() rb_vm_unlock(__FILE__, __LINE__)
+#define RB_VM_LOCK_ENTER_CR_LEV(cr, levp) rb_vm_lock_enter_cr(cr, levp, __FILE__, __LINE__)
+#define RB_VM_LOCK_LEAVE_CR_LEV(cr, levp) rb_vm_lock_leave_cr(cr, levp, __FILE__, __LINE__)
#define RB_VM_LOCK_ENTER_LEV(levp) rb_vm_lock_enter(levp, __FILE__, __LINE__)
#define RB_VM_LOCK_LEAVE_LEV(levp) rb_vm_lock_leave(levp, __FILE__, __LINE__)