aboutsummaryrefslogtreecommitdiffstats
path: root/cont.c
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2023-06-10 23:13:01 +0900
committerGitHub <noreply@github.com>2023-06-10 23:13:01 +0900
commitbe86767eeff745ac4d0255fa5d14da99e32f59bd (patch)
tree255ef2e579256cbc288d6da2883e111d262530d2 /cont.c
parenta41e088604e70302d01ae6ba41ae334e08bdc690 (diff)
downloadruby-be86767eeff745ac4d0255fa5d14da99e32f59bd.tar.gz
Add VM_ASSERT on `fiber->blocking == 0`. (#7926)
I have not seen any problems with this code, but this ensures the invariant.
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/cont.c b/cont.c
index 4d1b9f0b7a..9132ef96eb 100644
--- a/cont.c
+++ b/cont.c
@@ -2810,6 +2810,8 @@ fiber_blocking_yield(VALUE fiber_value)
rb_fiber_t *fiber = fiber_ptr(fiber_value);
rb_thread_t * volatile th = fiber->cont.saved_ec.thread_ptr;
+ VM_ASSERT(fiber->blocking == 0);
+
// fiber->blocking is `unsigned int : 1`, so we use it as a boolean:
fiber->blocking = 1;