summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorSamuel Williams <[email protected]>2025-06-14 12:32:51 +0900
committer<[email protected]>2025-06-14 12:32:51 +0900
commit68625a23d6deeb2e4c498d4bccc36d616608e05f ()
treece9859b8706304a195692326680bd153997a32cb /thread.c
parentc45c600e2237affa8ba62ea5b290e29a1045d483 (diff)
Fix blocking operation cancellation. (#13614)
Expose `rb_thread_resolve_unblock_function` internally.
Notes: Merged-By: ioquatix <[email protected]>
-rw-r--r--thread.c31
1 files changed, 26 insertions, 5 deletions
@@ -1540,6 +1540,29 @@ blocking_region_end(rb_thread_t *th, struct rb_blocking_region_buffer *region)
#endif
}
void *
rb_nogvl(void *(*func)(void *), void *data1,
rb_unblock_function_t *ubf, void *data2,
@@ -1566,11 +1589,9 @@ rb_nogvl(void *(*func)(void *), void *data1,
bool is_main_thread = vm->ractor.main_thread == th;
int saved_errno = 0;
- if ((ubf == RUBY_UBF_IO) || (ubf == RUBY_UBF_PROCESS)) {
- ubf = ubf_select;
- data2 = th;
- }
- else if (ubf && rb_ractor_living_thread_num(th->ractor) == 1 && is_main_thread) {
if (flags & RB_NOGVL_UBF_ASYNC_SAFE) {
vm->ubf_async_safe = 1;
}