summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2025-10-03 19:51:01 -0400
committerPeter Zhu <peter@peterzhu.ca>2025-10-04 18:21:13 -0400
commit1858233ffaee482a73a91b796f02ebb7ae1306b9 (patch)
tree22171b34cb33d4b658e9cf4953d7a88cedb789ad /thread.c
parent8eb28da3e73cd571cb06d1450ee87384e37b83a7 (diff)
Free the native thread of the main thread on FREE_AT_EXIT
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/thread.c b/thread.c
index 5556100102..0419fdf054 100644
--- a/thread.c
+++ b/thread.c
@@ -529,6 +529,15 @@ thread_cleanup_func(void *th_ptr, int atfork)
rb_native_mutex_destroy(&th->interrupt_lock);
}
+void
+rb_thread_free_native_thread(void *th_ptr)
+{
+ rb_thread_t *th = th_ptr;
+
+ native_thread_destroy_atfork(th->nt);
+ th->nt = NULL;
+}
+
static VALUE rb_threadptr_raise(rb_thread_t *, int, VALUE *);
static VALUE rb_thread_to_s(VALUE thread);