diff options
| author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2023-06-10 23:13:01 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-10 23:13:01 +0900 |
| commit | be86767eeff745ac4d0255fa5d14da99e32f59bd (patch) | |
| tree | 255ef2e579256cbc288d6da2883e111d262530d2 | |
| parent | a41e088604e70302d01ae6ba41ae334e08bdc690 (diff) | |
Add VM_ASSERT on `fiber->blocking == 0`. (#7926)
I have not seen any problems with this code, but this ensures the invariant.
Notes
Notes:
Merged-By: ioquatix <samuel@codeotaku.com>
| -rw-r--r-- | cont.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |
