With M:N thread scheduler, the native thread (NT) related resources
should be freed when the NT is no longer needed. So the calling native_thread_destroy() at the end of is will be freed when thread_cleanup_func()` (at the end of Ruby thread) is not correct
timing. Call it when the corresponding Ruby thread is collected.
fix
native_thread_destroy()
timingWith M:N thread scheduler, the native thread (NT) related resources
should be freed when the NT is no longer needed. So the calling
native_thread_destroy()
at the end ofis will be freed when
thread_cleanup_func()` (at the end of Ruby thread) is not correcttiming. Call it when the corresponding Ruby thread is collected.