summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2025-05-14 18:28:53 -0700
committerJohn Hawthorn <[email protected]>2025-05-20 09:56:31 -0700
commit05e0e7223acbc9ab223dd8f4b342d5eb6d3ae8c7 ()
tree15c3ed684845a6828e0935e87c6d90c2a3c46aec /thread.c
parentcd15cc250fa7dc6482833327728eeff641d2e41d (diff)
Use atomic load to read interrupt mask
Notes: Merged: https://.com/ruby/ruby/pull/13357
-rw-r--r--thread.c3
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;
do {
- interrupt = ec->interrupt_flag;
old = ATOMIC_CAS(ec->interrupt_flag, interrupt, interrupt & ec->interrupt_mask);
} while (old != interrupt);
return interrupt & (rb_atomic_t)~ec->interrupt_mask;