diff options
| author | John Hawthorn <john@hawthorn.email> | 2025-05-14 18:28:53 -0700 |
|---|---|---|
| committer | John Hawthorn <john@hawthorn.email> | 2025-05-20 09:56:31 -0700 |
| commit | 05e0e7223acbc9ab223dd8f4b342d5eb6d3ae8c7 (patch) | |
| tree | 15c3ed684845a6828e0935e87c6d90c2a3c46aec /thread.c | |
| parent | cd15cc250fa7dc6482833327728eeff641d2e41d (diff) | |
Use atomic load to read interrupt mask
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13357
Diffstat (limited to 'thread.c')
| -rw-r--r-- | thread.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -2465,8 +2465,9 @@ threadptr_get_interrupts(rb_thread_t *th) rb_atomic_t interrupt; rb_atomic_t old; + old = ATOMIC_LOAD_RELAXED(ec->interrupt_flag); do { - interrupt = ec->interrupt_flag; + interrupt = old; old = ATOMIC_CAS(ec->interrupt_flag, interrupt, interrupt & ec->interrupt_mask); } while (old != interrupt); return interrupt & (rb_atomic_t)~ec->interrupt_mask; |
