mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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>
1 changed files with 2 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue