Add VM_ASSERT on fiber->blocking == 0
. (#7926)
I have not seen any problems with this code, but this ensures the invariant.
This commit is contained in:
parent
a41e088604
commit
be86767eef
Notes:
git
2023-06-10 14:13:21 +00:00
Merged-By: ioquatix <samuel@codeotaku.com>
2
cont.c
2
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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user