зеркало из https://github.com/github/ruby.git
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:
Родитель
a41e088604
Коммит
be86767eef
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;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче