diff options
author | John Hawthorn <[email protected]> | 2025-06-05 13:48:34 -0700 |
---|---|---|
committer | John Hawthorn <[email protected]> | 2025-06-12 13:13:55 -0700 |
commit | a34fcf401b5b20c38eb98b42815e17bc2af9bad5 (patch) | |
tree | 6345fd91f8caba0646adae640cf0389b124c41d7 /internal/thread.h | |
parent | 97994c77fb5b82ca959e1188ecaee7d633d60a8e (diff) |
Add a new_thread flag to rb_interrupt_exec
Previously rb_ractor_interrupt_exec would use an intermediate function
to create a new thread with the actual target function, replacing the
data being passed in with a piece of malloc memory holding the "next"
function and the original data.
Because of this, passing rb_interrupt_exec_flag_value_data to
rb_ractor_interrupt_exec didn't have the intended effect of allowing
data to be passed in and marked.
This commit adds a rb_interrupt_exec_flag_new_thread flag, which
both simplifies the implementation and allows the original data to be
marked.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/13531
Diffstat (limited to 'internal/thread.h')
-rw-r--r-- | internal/thread.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/internal/thread.h b/internal/thread.h index 8403ac2663..00fcbfc560 100644 --- a/internal/thread.h +++ b/internal/thread.h @@ -90,6 +90,7 @@ typedef VALUE (rb_interrupt_exec_func_t)(void *data); enum rb_interrupt_exec_flag { rb_interrupt_exec_flag_none = 0x00, rb_interrupt_exec_flag_value_data = 0x01, + rb_interrupt_exec_flag_new_thread = 0x02, }; // interrupt the target_th and run func. |